/* Valcourt r3 — Battle Map (war.html). Built from the approved mockups; loaded after style.css. */

.container.wide { max-width: 1240px; }

.mk-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 8px 14px;
  border: 1px dashed rgba(153,163,175,.45); border-radius: 6px;
  background: rgba(8,14,28,.65);
  font-size: .82rem; color: var(--muted);
}
.mk-banner b { color: var(--goldb); font-family: 'IM Fell English SC', serif; letter-spacing: .1em; font-weight: 600; }
.mk-banner a { color: var(--goldb); text-decoration: none; border-bottom: 1px solid rgba(212,200,166,.35); }
.mk-banner a:hover { color: #e1e6ed; }

.mk-lead {
  text-align: center; max-width: 720px; margin: -6px auto 22px;
  font-family: 'IM Fell English', serif; font-style: italic;
  color: var(--text); font-size: 1.05rem; line-height: 1.5;
}

/* Generic bits */
.mk-row { display: grid; gap: 16px; margin-bottom: 18px; }
.mk-2 { grid-template-columns: 1fr 1fr; }
.mk-3 { grid-template-columns: 1fr 1fr 1fr; }
.mk-sidebar { grid-template-columns: 1fr 300px; }
.mk-sidebar-left { grid-template-columns: 280px 1fr; }
.mk-split { grid-template-columns: 1.15fr .85fr; }
@media (max-width: 980px) {
  .mk-2, .mk-3, .mk-sidebar, .mk-sidebar-left, .mk-split { grid-template-columns: 1fr; }
}

.mk-k {
  font-family: 'IM Fell English SC', serif; font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.muted { color: var(--muted); }
.ok { color: #9dba8a; }
.warn { color: #d4c8a6; }
.bad { color: #c98989; }
.small { font-size: .85rem; }

.bar {
  height: 9px; background: var(--bar-bg); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.8);
}
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #5e6a7a, #99a3af 55%, #d7cba8); box-shadow: 0 0 8px rgba(215,203,168,.25); }
.bar.morale > i { background: linear-gradient(90deg, #2a4a2a, #6f9a3a 60%, #c5d4a0); }
.bar.supply > i { background: linear-gradient(90deg, #3a4a1a, #b8a45a 70%, #e6dcb4); }
.bar.danger > i { background: linear-gradient(90deg, #5a2020, #a05050 60%, #d4a0a0); }
.bar.wall > i { background: linear-gradient(90deg, #2a3344, #6a7a90 60%, #c8d0dc); }
.bar.thin { height: 7px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 10px; border: 1px solid var(--border);
  font-family: 'IM Fell English SC', serif; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--goldb); background: rgba(0,0,0,.3);
}
.pill.on { border-color: var(--goldb); color: #e1e6ed; box-shadow: 0 0 10px rgba(153,163,175,.25); }
.pill.ally { border-color: #6f9a3a; color: #b8d49a; }
.pill.war { border-color: #a05050; color: #e0a8a8; }
.pill.neutral { border-color: #6a7a90; color: #c0c6d0; }
.pill.crown { border-color: #e6dcb4; color: #e6dcb4; }
.pill.siege { border-color: #c5b88f; color: #e6dcb4; }

.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,.5); display: inline-block; }

/* ---------- Index gallery ---------- */
.mk-scenario {
  display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center;
  padding: 18px 22px; margin-bottom: 22px;
}
.mk-scenario img { width: 160px; height: 200px; object-fit: cover; border-radius: 4px; box-shadow: var(--frame); }
.mk-scenario h2 { margin-bottom: 6px; }
.mk-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mk-tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  padding: 0; overflow: hidden;
}
.mk-tile .ph {
  height: 88px; display: flex; align-items: flex-end; padding: 12px 14px;
  background:
    linear-gradient(180deg, transparent 20%, rgba(6,10,18,.92)),
    var(--tile-img, #0b1220) center/cover no-repeat;
  border-bottom: 1px solid var(--border-soft);
}
.mk-tile h3 { margin: 0; font-size: 1.05rem; color: #e6dcb4; text-shadow: 0 2px 8px #000; }
.mk-tile .bd { padding: 12px 14px 16px; font-size: .88rem; color: var(--text); line-height: 1.45; flex: 1; }
.mk-tile .n { font-family: 'IM Fell English SC', serif; font-size: .68rem; letter-spacing: .12em; color: var(--gold); }
@media (max-width: 980px) { .mk-gallery { grid-template-columns: 1fr 1fr; } .mk-scenario { grid-template-columns: 1fr; } }

/* ---------- War map ---------- */
.war-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.war-map-frame { position: relative; border: 1px solid rgba(190,200,215,.45); border-radius: 6px; overflow: hidden; background: #0a1020; box-shadow: 0 6px 22px rgba(0,0,0,.6); }
.war-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.war-svg { display: block; width: 100%; height: auto; }
.war-cell { fill-opacity: .36; stroke: #e8ecf4; stroke-opacity: .55; stroke-width: 1.6; cursor: pointer; transition: fill-opacity .2s; }
.war-cell:hover, .war-cell.is-on { fill-opacity: .55; }
.war-cell.is-on { stroke: #e6dcb4; stroke-opacity: .95; stroke-width: 3; }
.war-cell.contested { fill-opacity: .45; stroke: #e6dcb4; stroke-dasharray: 7 5; stroke-width: 2.4; }
.war-lbl text { font-family: 'IM Fell English SC', serif; font-size: 17px; text-anchor: middle; fill: #f4f1e6; paint-order: stroke; stroke: #0b1222; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.war-lbl circle { stroke: #0b1222; stroke-width: 2; }
.war-pin { cursor: pointer; }
.war-pin .disc { stroke: #0b1222; stroke-width: 2.5; }
.war-pin .flag { font-family: 'IM Fell English SC', serif; font-size: 15px; fill: #f4f1e6; paint-order: stroke; stroke: #0b1222; stroke-width: 3.5px; }
.war-pin.is-on .disc { stroke: #e6dcb4; stroke-width: 3; }
.war-march { fill: none; stroke: #f2f4f8; stroke-width: 3.5; stroke-dasharray: 12 8; opacity: .85; }
.war-supply { fill: none; stroke: #d7cba8; stroke-width: 2.2; stroke-dasharray: 3 8; opacity: .75; }
.war-compass {
  position: absolute; right: 12px; top: 12px; width: 64px; height: 64px;
  background: rgba(8,12,22,.72); border: 1px solid rgba(212,200,166,.4); border-radius: 50%;
  display: grid; place-items: center; color: #e6dcb4; font-family: 'IM Fell English SC', serif; font-size: .7rem; letter-spacing: .08em;
  pointer-events: none;
}
.war-scale {
  position: absolute; right: 12px; bottom: 10px; color: #e6dcb4;
  font-family: 'IM Fell English SC', serif; font-size: .68rem; letter-spacing: .08em;
  background: rgba(8,12,22,.72); padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(212,200,166,.3);
  pointer-events: none;
}
.war-side h3 { margin-bottom: 8px; }
.war-side .panel { margin-bottom: 12px; }
.own-list { list-style: none; display: grid; gap: 5px; }
.own-list li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; font-size: .86rem; cursor: pointer; padding: 2px 0; }
.own-list li b { color: var(--goldb); font-weight: 600; }
.army-mini { list-style: none; display: grid; gap: 6px; }
.army-mini li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; padding: 7px 8px; border: 1px solid var(--border-soft); border-radius: 5px; cursor: pointer; background: rgba(0,0,0,.2); }
.army-mini li:hover, .army-mini li.is-on { border-color: var(--goldb); }
.army-mini b { color: var(--goldb); display: block; font-size: .9rem; }
.detail-face { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.detail-face img { width: 64px; height: 80px; object-fit: cover; object-position: top; border-radius: 3px; box-shadow: var(--frame); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 8px 0; font-size: .86rem; }
.stat-grid b { color: var(--goldb); }
.war-log { list-style: none; display: grid; gap: 4px; margin-top: 8px; }
.war-log li { font-size: .86rem; padding: 5px 8px; border-left: 3px solid #6a7a96; background: rgba(255,255,255,.03); }
.war-log li.won { border-left-color: #e6dcb4; }
.war-log li.bad { border-left-color: #a05050; }
@media (max-width: 980px) { .war-layout { grid-template-columns: 1fr; } }

/* ---------- Armies ---------- */
.host-card {
  display: grid; grid-template-columns: 110px 1fr 220px; gap: 16px; padding: 14px; margin-bottom: 12px; cursor: pointer;
}
.host-card:hover, .host-card.is-on { border-color: var(--goldb) !important; }
.host-card img.face { width: 110px; height: 140px; object-fit: cover; object-position: top; border-radius: 4px; box-shadow: var(--frame); }
.host-card h3 { margin: 0 0 2px; font-size: 1.25rem; }
.host-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 8px; }
.comp-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); margin-top: 8px; }
.comp-bar i { display: block; height: 100%; }
.comp-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: .75rem; color: var(--muted); }
.comp-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.host-side { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.host-side .big { font-family: 'IM Fell English SC', serif; font-size: 1.7rem; color: var(--goldb); line-height: 1; }
.host-side .lab { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-family: 'IM Fell English SC', serif; }
@media (max-width: 800px) { .host-card { grid-template-columns: 90px 1fr; } .host-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 16px; } }

/* ---------- Units ---------- */
.unit-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 16px; }
.unit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.unit-plate { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px; }
.unit-plate .art {
  width: 120px; height: 150px; object-fit: cover; object-position: center top;
  border-radius: 4px; box-shadow: var(--frame); background: #0b1220;
}
.unit-plate h3 { margin: 0 0 4px; font-size: 1.15rem; }
.unit-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.unit-stats span { display: flex; flex-direction: column; background: rgba(0,0,0,.25); border: 1px solid var(--border-soft); border-radius: 4px; padding: 4px 6px; text-align: center; }
.unit-stats b { font-family: 'IM Fell English SC', serif; color: var(--goldb); font-size: 1.05rem; }
.unit-stats i { font-style: normal; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); font-family: 'IM Fell English SC', serif; }
@media (max-width: 800px) { .unit-grid { grid-template-columns: 1fr; } }

/* ---------- Factions ---------- */
.fac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fac-card { padding: 0; overflow: hidden; cursor: pointer; }
.fac-card.is-on, .fac-card:hover { border-color: var(--goldb) !important; }
.fac-chief { height: 8px; }
.fac-body { padding: 14px 16px 16px; }
.fac-head { display: grid; grid-template-columns: 72px 1fr; gap: 12px; margin-bottom: 8px; }
.fac-head img { width: 72px; height: 92px; object-fit: cover; object-position: top; border-radius: 3px; box-shadow: var(--frame); }
.fac-head h3 { margin: 0 0 2px; font-size: 1.12rem; line-height: 1.2; }
.att { height: 8px; background: linear-gradient(90deg, #6a3030, #2a2e38 50%, #3a5a30); border: 1px solid var(--border); border-radius: 6px; position: relative; margin: 8px 0; }
.att i { position: absolute; top: -3px; width: 2px; height: 12px; background: #e6dcb4; box-shadow: 0 0 6px rgba(230,220,180,.8); }
.fac-hold { font-size: .84rem; color: var(--muted); }
.fac-hold b { color: var(--goldb); }
@media (max-width: 980px) { .fac-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Holdings ---------- */
.hold-list { list-style: none; display: grid; gap: 1px; padding-right: 4px; }
.hold-list h4 { font-size: .68rem; letter-spacing: .12em; color: var(--gold); margin: 8px 0 2px; text-transform: uppercase; }
.hold-list button {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center;
  width: 100%; text-align: left; padding: 4px 6px; border-radius: 4px;
  background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit;
}
.hold-list button:hover, .hold-list button.is-on { border-color: var(--border); background: rgba(153,163,175,.08); }
.hold-list button.is-on { border-color: var(--goldb); }
.hold-dossier { position: sticky; top: 8px; }
.hold-dossier .hero { display: grid; grid-template-columns: 140px 1fr; gap: 16px; margin-bottom: 14px; }
.hold-dossier .hero img { width: 140px; height: 170px; object-fit: cover; object-position: top; border-radius: 4px; box-shadow: var(--frame); }
.mini-map { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #0a1020; margin-top: 12px; }
.mini-map svg { display: block; width: 100%; height: auto; }
.levy-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.levy-table th { font-family: 'IM Fell English SC', serif; font-size: .68rem; letter-spacing: .08em; color: var(--gold); text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-soft); }
.levy-table td { padding: 6px 8px; border-bottom: 1px solid rgba(153,163,175,.12); }
.levy-table td:last-child, .levy-table th:last-child { text-align: right; }
.levy-table b { color: var(--goldb); }

/* ---------- Supplies ---------- */
.sup-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sup-stat { text-align: center; padding: 16px 12px; }
.sup-stat .n { display:block; font-family: 'Source Sans 3', system-ui, sans-serif; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.85rem; color: var(--goldb); line-height: 1.15; margin: 4px 0 2px; }
.sup-stat .small { display:block; }
.sup-stat .k { display: block; }
.wagon { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 12px; margin-bottom: 10px; align-items: center; }
.wagon img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; mix-blend-mode: lighten; }
.flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 0; }
.flow .node { flex: 1; min-width: 120px; text-align: center; padding: 10px 8px; border: 1px solid var(--border); border-radius: 6px; background: rgba(0,0,0,.25); }
.flow .node b { display: block; color: var(--goldb); font-family: 'IM Fell English SC', serif; }
.flow .arr { color: var(--gold); letter-spacing: .2em; }
@media (max-width: 800px) { .sup-hero { grid-template-columns: 1fr 1fr; } }

/* ---------- Muster ---------- */
.muster-total {
  position: sticky; top: 8px; z-index: 2;
  display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center;
  padding: 14px 18px; margin-bottom: 16px;
}
.muster-total .n { font-family: 'IM Fell English SC', serif; font-size: 1.6rem; color: var(--goldb); }
.roll { width: 100%; border-collapse: collapse; }
.roll th { font-family: 'IM Fell English SC', serif; font-size: .68rem; letter-spacing: .08em; color: var(--gold); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.roll td { padding: 8px; border-bottom: 1px solid rgba(153,163,175,.12); vertical-align: middle; }
.roll td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.roll tr.is-off { opacity: .45; }
.roll .src { color: var(--goldb); font-family: 'IM Fell English SC', serif; }
.merc { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; padding: 12px; margin-bottom: 10px; align-items: center; }
.merc img { width: 90px; height: 110px; object-fit: cover; object-position: top; border-radius: 4px; box-shadow: var(--frame); }
.merc h3 { margin: 0 0 4px; font-size: 1.1rem; }
.chk {
  width: 18px; height: 18px; accent-color: #99a3af; cursor: pointer;
}

/* ---------- Battle report + siege ---------- */
.battle-hero {
  position: relative; min-height: 220px; margin-bottom: 18px; overflow: hidden; padding: 0;
}
.battle-hero img.bg { width: 100%; height: 240px; object-fit: cover; object-position: center 30%; display: block; filter: saturate(.7) brightness(.7); }
.battle-hero .veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,10,18,.15) 0%, rgba(6,10,18,.85) 70%, var(--panel) 100%);
}
.battle-hero .cap { position: absolute; left: 24px; right: 24px; bottom: 16px; }
.battle-hero h2 { font-size: 1.8rem; margin: 0 0 4px; text-shadow: 0 2px 10px #000; }
.vs-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; margin-bottom: 16px; }
.vs-mid { align-self: center; font-family: 'IM Fell English SC', serif; font-size: 1.6rem; color: var(--goldb); text-align: center; padding-top: 40px; }
.side-col h3 { margin-bottom: 8px; }
.loss-list { list-style: none; display: grid; gap: 4px; font-size: .9rem; }
.loss-list li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid rgba(153,163,175,.1); }
.chronic { font-family: 'IM Fell English', serif; font-style: italic; font-size: 1.08rem; line-height: 1.55; color: #c9d0da; }
.seal {
  display: inline-block; margin-top: 8px; padding: 6px 16px;
  border: 2px solid #e6dcb4; border-radius: 2px; color: #e6dcb4;
  font-family: 'IM Fell English SC', serif; letter-spacing: .16em; text-transform: uppercase;
  background: rgba(20,24,16,.5);
}

.siege-board { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.keep-art { position: relative; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; min-height: 280px; background: #0a1020; }
.keep-art img { width: 100%; height: 320px; object-fit: cover; object-position: center; display: block; filter: brightness(.75) saturate(.8); }
.keep-art .ov { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6,10,18,.85)); }
.keep-art .lab { position: absolute; left: 14px; right: 14px; bottom: 12px; }
.wall-seg { display: grid; gap: 8px; margin: 10px 0; }
.wall-seg .row { display: grid; grid-template-columns: 110px 1fr 48px; gap: 8px; align-items: center; font-size: .86rem; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.acts .btn { justify-content: center; }
@media (max-width: 800px) { .vs-cols, .siege-board { grid-template-columns: 1fr; } .vs-mid { padding-top: 0; } }

.mk-foot {
  text-align: center; margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: .82rem; color: var(--muted);
}
.mk-foot a { color: var(--goldb); text-decoration: none; }

/* ---------- war mode chrome ---------- */
.pg-war .menu.war-menu { background: linear-gradient(180deg, rgba(10,18,36,.97), rgba(6,10,20,.97)) !important; border-bottom-color: rgba(212,200,166,.45) !important; }
.menu a.war-exit { margin-left: 14px; border: 1px solid rgba(212,200,166,.65) !important; border-radius: 4px !important; color: #f0e6c8 !important; background: linear-gradient(180deg, #2a3446, #141a26) !important; }
.menu a.war-exit:hover { background: linear-gradient(180deg, #3a4660, #1a2232) !important; }
.menu a.war-exit::after { display: none; }
#nocVeil.war-veil { background: radial-gradient(ellipse at center, #0e1d40 0%, #03060d 75%); }
.war-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; background: linear-gradient(180deg, rgba(14,24,46,.92), rgba(8,13,26,.92)); }
.war-strip .ws-day { font-family: 'IM Fell English SC', serif; letter-spacing: .08em; color: var(--goldb); font-size: 1.05rem; }
.war-strip .ws-bits { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.war-over { padding: 14px 18px; margin-bottom: 16px; border: 2px solid #e6dcb4; border-radius: 6px; text-align: center; font-family: 'IM Fell English SC', serif; letter-spacing: .08em; color: #f0e6c8; background: rgba(30,36,22,.55); }
.war-over.bad { border-color: #a05050; background: rgba(50,20,20,.5); }
.btn.sm { padding: 5px 10px; font-size: .72rem; }
.war-sel { background: #060a12; color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; font: inherit; }
.war-num { width: 70px; }
.war-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.war-empty { color: var(--muted); font-style: italic; padding: 8px 0; }

/* ---------- the organic war map ---------- */
.wm-svg { display: block; width: 100%; height: auto; background: radial-gradient(ellipse at 50% 45%, #10264a 0%, #0a1830 55%, #050b18 100%); }
.wm-sea-lines path { fill: none; stroke: rgba(160,185,220,.10); stroke-width: 1.2; }
.wm-coast-halo { fill: none; stroke: rgba(196,214,236,.20); stroke-width: 16; stroke-linejoin: round; }
.wm-coast-halo2 { fill: none; stroke: rgba(196,214,236,.10); stroke-width: 34; stroke-linejoin: round; }
.wm-land { fill: #2b3442; stroke: none; }
.wm-cell { stroke: #d8dee8; stroke-opacity: .5; stroke-width: 1.3; stroke-linejoin: round; fill-opacity: .30; cursor: pointer; transition: fill-opacity .2s; }
.wm-cell:hover { fill-opacity: .48; }
.wm-cell.is-on { stroke: #f0e6c8; stroke-opacity: 1; stroke-width: 3; fill-opacity: .5; }
.wm-cell.besieged { stroke: #e6dcb4; stroke-dasharray: 6 4; stroke-width: 2.4; stroke-opacity: .95; }
.wm-coast { fill: none; stroke: #c9d3e0; stroke-width: 2; stroke-opacity: .7; stroke-linejoin: round; }
.wm-mtn { fill: #5d6676; stroke: #1b2230; stroke-width: 1; }
.wm-mtn-snow { fill: #e4e9f0; }
.wm-hill { fill: none; stroke: #9aa48c; stroke-width: 2; stroke-linecap: round; opacity: .8; }
.wm-tree circle { fill: #2e5236; stroke: #16281b; stroke-width: 1; }
.wm-tree line { stroke: #3a2c1c; stroke-width: 1.6; }
.wm-reed { stroke: #8fa47a; stroke-width: 1.3; stroke-linecap: round; fill: none; opacity: .85; }
.wm-pool { fill: #3c5f7c; stroke: #8fb0cc; stroke-width: .8; opacity: .75; }
.wm-field { stroke: #a49a72; stroke-width: 1.1; opacity: .45; fill: none; }
.wm-lake { fill: #2f5c86; stroke: #a8c4e0; stroke-width: 1.5; }
.wm-river { fill: none; stroke: #5d8fbf; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.wm-water-lbl { font-family: 'IM Fell English', serif; font-style: italic; font-size: 14px; fill: #bcd3ea; paint-order: stroke; stroke: #0b1222; stroke-width: 3px; }
.wm-road { fill: none; stroke: #d7cba8; stroke-width: 1.4; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .55; }
.wm-route { fill: none; stroke: #f4f1e6; stroke-width: 3.5; stroke-dasharray: 10 7; opacity: .9; }
.wm-route.foe { stroke: #e0a0a0; }
.wm-lbl text { font-family: 'IM Fell English SC', serif; font-size: 16px; text-anchor: middle; fill: #f4f1e6; paint-order: stroke; stroke: #0b1222; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.wm-lbl circle { stroke: #0b1222; stroke-width: 2; pointer-events: none; }
.wm-choke { cursor: help; }
.wm-choke circle { fill: #0d1626; stroke: #e6dcb4; stroke-width: 2; }
.wm-choke text { font-size: 13px; text-anchor: middle; fill: #f0e6c8; font-weight: 700; pointer-events: none; }
.wm-choke .cn { font-family: 'IM Fell English', serif; font-style: italic; font-size: 12px; font-weight: 400; fill: #e6dcb4; paint-order: stroke; stroke: #0b1222; stroke-width: 3px; }
.wm-closed { stroke: #c98989; stroke-width: 2; opacity: .8; }
.wm-army { cursor: pointer; }
.wm-army .disc { stroke: #0b1222; stroke-width: 2.5; }
.wm-army.is-on .disc { stroke: #f0e6c8; stroke-width: 3.5; }
.wm-army text { font-family: 'IM Fell English SC', serif; font-size: 12px; text-anchor: middle; pointer-events: none; }
.wm-army .tag { font-size: 12px; fill: #f4f1e6; paint-order: stroke; stroke: #0b1222; stroke-width: 3px; text-anchor: start; }
.wm-siege { fill: none; stroke: #e6dcb4; stroke-width: 2.5; stroke-dasharray: 4 3; }
.wm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.wm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wm-legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid #5d8fbf; }
.rep-mods { list-style: none; display: grid; gap: 5px; margin-top: 8px; }
.rep-mods li { font-size: .88rem; padding: 6px 10px; border-left: 3px solid #6a7a96; background: rgba(255,255,255,.03); }
.rep-mods li.choke { border-left-color: #e6dcb4; background: rgba(230,220,180,.07); }
.rep-mods li.walls { border-left-color: #a8b4c8; }
.rep-mods b { color: var(--goldb); margin-right: 6px; font-family: 'IM Fell English SC', serif; letter-spacing: .04em; }
.rep-list { list-style: none; display: grid; gap: 4px; }
.rep-list button { width: 100%; text-align: left; font: inherit; color: var(--text); background: rgba(0,0,0,.2); border: 1px solid var(--border-soft); border-radius: 4px; padding: 6px 9px; cursor: pointer; }
.rep-list button.is-on, .rep-list button:hover { border-color: var(--goldb); }
/* r3: keep the eight war tabs and EXIT on one line at desktop widths */
@media (min-width: 1000px) {
  .pg-war .menu.war-menu { flex-wrap: nowrap !important; padding-left: 8px !important; padding-right: 8px !important; }
  .pg-war .menu.war-menu a { padding-left: 14px !important; padding-right: 14px !important; white-space: nowrap; }
  .pg-war .menu.war-menu a img { width: 20px !important; height: 20px !important; }
  .menu a.war-exit { margin-left: 10px; align-self: center; padding: 7px 14px !important; }
}

/* =================== Valcourt r4: parchment & teal campaign map, zoom, world map, diplomacy =================== */
.war-map-big { grid-template-columns: minmax(0, 1fr) 330px !important; align-items: start; }
.war-map-frame.big { position: relative; height: calc(100vh - 150px); min-height: 520px; max-height: 1100px; border-radius: 6px; overflow: hidden; background: #1d5a60; box-shadow: inset 0 0 0 1px rgba(212,200,166,.45), 0 10px 30px rgba(0,0,0,.45); }
.war-map-frame.big > svg.wm-svg { width: 100%; height: 100%; cursor: grab; user-select: none; -webkit-user-select: none; }
.war-map-frame.big > svg.wm-svg.dragging { cursor: grabbing; }
.war-map-frame.is-full { position: fixed !important; inset: 0; z-index: 9000; height: 100vh !important; height: 100dvh !important; max-height: none !important; border-radius: 0; }
body.map-full { overflow: hidden; }
.war-map-frame .war-scale { position: absolute; left: 10px; bottom: 10px; right: auto; pointer-events: none; background: rgba(20,32,30,.72); color: #f3ead2; border: 1px solid rgba(232,218,178,.4); }
.wm-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; z-index: 2; max-width: calc(100% - 20px); }
.wm-tb { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 6px; border: 1px solid rgba(232,218,178,.65); background: rgba(16,26,40,.88); color: #f6ecd0; font-size: 1.1rem; line-height: 36px; text-align: center; cursor: pointer; text-decoration: none; font-family: 'IM Fell English SC', serif; }
.wm-tb.wide { font-size: .9rem; letter-spacing: .05em; }
.wm-tb:hover { background: rgba(40,62,92,.95); }
.wm-zl { min-width: 48px; text-align: center; font-size: .78rem; color: #f6ecd0; background: rgba(16,26,40,.75); border-radius: 4px; padding: 3px 4px; }
.mini-map { position: relative; height: 420px; border-radius: 6px; overflow: hidden; margin-top: 12px; }
.mini-map > svg { width: 100%; height: 100%; }

.wm-sea { fill: #1e5d63; }
.ww-svg .wm-sea { fill: #1f6268; }
.wm-svg { background: #1e5d63 !important; }
.wm-sea-lines path { stroke: rgba(210,236,230,.10) !important; stroke-width: 1.3; }
.wm-coast-halo { stroke: rgba(196,238,226,.30) !important; stroke-width: 14 !important; fill: none; }
.wm-coast-halo2 { stroke: rgba(160,220,210,.14) !important; stroke-width: 36 !important; fill: none; }
.wm-land, .wm-isle { fill: #e2d2a6 !important; }
.wm-isle { stroke: #6b5530; stroke-width: 1.2; }
.wm-coast { stroke: #5b4526 !important; stroke-width: 2.2 !important; stroke-opacity: .9 !important; fill: none; }
.wm-coast.thin { stroke-width: 1.4 !important; }
.wm-cell { stroke: #6b5530 !important; stroke-opacity: .55 !important; stroke-width: 1.2 !important; fill-opacity: 1 !important; cursor: pointer; transition: filter .15s; }
.wm-cell:hover { filter: brightness(1.08); }
.wm-cell.is-on { stroke: #1b2a48 !important; stroke-opacity: 1 !important; stroke-width: 3.2 !important; }
.wm-cell.besieged { stroke: #8a1f12 !important; stroke-dasharray: 7 4; stroke-width: 2.6 !important; stroke-opacity: .95 !important; }
.wm-crown-glow { fill: none; stroke: #fff2b0; stroke-width: 22; stroke-linejoin: round; opacity: .95; }
.wm-crown-edge { fill: none; stroke: #ffd34d; stroke-width: 8; stroke-linejoin: round; }
.wm-crown-inner { fill: none; stroke: #b8860b; stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .7; }
.wm-ally-edge { fill: none; stroke: #f6f1e0; stroke-width: 6; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .85; }
@keyframes wmPulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
.wm-crown-glow { animation: wmPulse 3.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .wm-crown-glow { animation: none; } }
.wm-mtn { fill: #a08d6a !important; stroke: #4a3a22 !important; stroke-width: 1.1 !important; }
.wm-mtn-shade { fill: #7d6a4a; opacity: .7; }
.wm-mtn-snow { fill: #fbfdff !important; }
.wm-hill { stroke: #7d6a44 !important; stroke-width: 1.8 !important; opacity: .75 !important; }
.wm-tree path { fill: #4f6b3a; stroke: #2b3b1f; stroke-width: .9; }
.wm-tree circle { fill: #4f6b3a !important; stroke: #2b3b1f !important; }
.wm-tree line { stroke: #4a3520 !important; stroke-width: 1.4 !important; }
.wm-reed { stroke: #5f7a4a !important; }
.wm-pool { fill: #6aa3a3 !important; stroke: #2f6b6b !important; opacity: .8; }
.wm-field { stroke: #8a7a4a !important; opacity: .5 !important; }
.wm-lake { fill: #4f9ea0 !important; stroke: #2a6266 !important; stroke-width: 1.6 !important; }
.wm-river { stroke: #3f8f97 !important; stroke-width: 4.2 !important; opacity: 1 !important; fill: none; }
.wm-water-lbl { fill: #1f4f55 !important; stroke: #efe4c4 !important; stroke-width: 3px !important; font-size: 15px !important; text-anchor: middle; paint-order: stroke; font-family: 'IM Fell English', serif; font-style: italic; }
.wm-water-lbl.riv { text-anchor: start; font-size: 13px !important; }
.wm-sea-lbl { font-family: 'IM Fell English', serif; font-style: italic; fill: #cfe9e2; opacity: .8; text-anchor: middle; letter-spacing: .12em; }
.wm-isle-lbl { font-family: 'IM Fell English', serif; font-style: italic; font-size: 13px; fill: #f4ead0; text-anchor: middle; paint-order: stroke; stroke: #1e5d63; stroke-width: 3px; }
.wm-road { stroke: #6b4f2a !important; stroke-width: 1.6 !important; stroke-dasharray: 2 6 !important; opacity: .7 !important; }
.wm-ferry { fill: none; stroke: #f4ead0; stroke-width: 2.4; stroke-dasharray: 5 5; }
.wm-route { stroke: #1b2a48 !important; stroke-width: 4 !important; stroke-dasharray: 11 7 !important; opacity: .95 !important; }
.wm-route.foe { stroke: #8a1f12 !important; }
.wm-lbl text { fill: #2a1d0c !important; stroke: #f3e8c8 !important; stroke-width: 4px !important; font-size: 17px !important; }
.wm-lbl.crown text { fill: #3a2600 !important; stroke: #fff4c8 !important; font-weight: 700; }
.wm-lbl circle { stroke: #2a1d0c !important; }
.wm-choke circle { fill: #f3e8c8 !important; stroke: #5b4526 !important; stroke-width: 2 !important; }
.wm-choke text { fill: #3a2a10 !important; font-size: 13px !important; }
.wm-choke .cn { fill: #3a2a10 !important; stroke: #f3e8c8 !important; stroke-width: 3px !important; font-size: 12px !important; }
.wm-choke.k-strait circle { fill: #d9eef0 !important; }
.wm-closed { stroke: #8a1f12 !important; stroke-width: 2.6 !important; opacity: .9 !important; }
.wm-army .disc { stroke: #f3e8c8 !important; stroke-width: 2.5 !important; }
.wm-army.is-on .disc { stroke: #ffd34d !important; stroke-width: 4 !important; }
.wm-army .flag { stroke: #2a1d0c; stroke-width: 2; }
.wm-army .banner { stroke: #2a1d0c; stroke-width: 1.2; }
.wm-army .tag { fill: #1b1206 !important; stroke: #f3e8c8 !important; stroke-width: 3.5px !important; font-size: 13px !important; }
.wm-army.foe .disc { stroke: #8a1f12 !important; }
.wm-siege { stroke: #8a1f12 !important; }
.wm-svg.small .wm-army .tag { display: none; }
/* labels fade in as you zoom (keeps the overview clean) */
.wm-svg:not(.zoomed) .wm-choke .cn { opacity: 0; }
.wm-svg:not(.zoomed) .wm-water-lbl.riv, .wm-svg:not(.zoomed) .wm-isle-lbl { opacity: .0; }
.wm-legend .lg-crown i { border-top: 4px solid #ffd34d !important; box-shadow: 0 0 6px #fff2b0; }
.wm-legend .lg-ally i { border-top: 3px dotted #f6f1e0 !important; }
.wm-legend i.riv { border-top-color: #3f8f97 !important; } .wm-legend i.road { border-top: 2px dashed #b89a68 !important; } .wm-legend i.march { border-top: 3px dashed #c9d6f0 !important; }
/* world */
.ww-king { stroke: #5b4526; stroke-width: 2; stroke-opacity: .6; cursor: pointer; }
.ww-king:hover { filter: brightness(1.08); }
.ww-king.is-on { stroke: #1b2a48; stroke-width: 6; stroke-opacity: 1; }
.ww-cont { font-family: 'IM Fell English SC', serif; fill: #3a2a10; opacity: .35; text-anchor: middle; letter-spacing: .3em; }
.ww-klbl { cursor: pointer; }
.ww-klbl text { font-family: 'IM Fell English SC', serif; font-size: 40px; text-anchor: middle; fill: #23170a; paint-order: stroke; stroke: #f3e8c8; stroke-width: 7px; stroke-linejoin: round; }
.ww-klbl text.sub { font-family: 'IM Fell English', serif; font-style: italic; font-size: 24px; stroke-width: 5px; }
.ww-realm text { font-family: 'IM Fell English SC', serif; font-size: 50px; text-anchor: middle; fill: #3a2600; paint-order: stroke; stroke: #fff4c8; stroke-width: 9px; font-weight: 700; }
.ww-svg .ww-home .wm-lbl text { font-size: 22px !important; }
.ww-svg .wm-sea-lbl { opacity: .7; }
/* diplomacy */
.dip-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.dip-top .btn[disabled], .war-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }
.dip-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dip-list { padding: 12px 10px !important; max-height: calc(100vh - 160px); overflow: auto; }
.dip-list h4 { margin: 10px 6px 6px; font-family: 'IM Fell English SC', serif; letter-spacing: .08em; color: var(--goldb, #d4c8a6); font-size: .85rem; }
.dip-list ul { list-style: none; margin: 0; padding: 0; }
.dip-row { width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 24px; gap: 8px; align-items: center; padding: 8px 8px; background: transparent; border: 1px solid transparent; border-radius: 5px; color: inherit; text-align: left; cursor: pointer; }
.dip-row:hover { background: rgba(212,200,166,.08); }
.dip-row.is-on { border-color: rgba(212,200,166,.6); background: rgba(212,200,166,.12); }
.dip-row .nm { display: flex; flex-direction: column; min-width: 0; } .dip-row .nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dip-row .nm small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dip-emb { width: 14px; height: 18px; border-radius: 2px 2px 7px 7px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); display: block; }
.dip-icons { display: flex; gap: 2px; } .dip-ic { font-size: .8rem; padding: 0 3px; border-radius: 3px; background: rgba(255,255,255,.07); }
.dip-ic.war { color: #e08080; } .dip-ic.ally { color: #f0c654; } .dip-ic.trade { color: #9fd0a0; }
.dip-face { font-size: 1.15rem; text-align: center; }
.dip-face.ok { color: #9fd0a0; } .dip-face.warn { color: #e0c070; } .dip-face.bad { color: #e08080; }
.dip-head { display: flex; gap: 14px; align-items: center; border-left: 5px solid var(--fc, #888); padding-left: 12px; margin-bottom: 8px; }
.dip-head img { width: 76px; height: 92px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(212,200,166,.5); }
.dip-head h2 { margin: 2px 0; font-size: 1.35rem; }
.dip-att { position: relative; height: 10px; border-radius: 5px; margin: 6px 0 10px; background: linear-gradient(90deg, #8a2a20, #b08a3a 45%, #c9c09a 50%, #6f9a5a 60%, #3f8a4a); }
.dip-att i { position: absolute; top: -4px; width: 4px; height: 18px; background: #fff; box-shadow: 0 0 4px #000; border-radius: 2px; }
.dip-lines { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.dip-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(212,200,166,.15); }
.dip-trs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.dip-tr { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid rgba(212,200,166,.5); border-radius: 12px; font-size: .8rem; }
.dip-tr.war { border-color: #c06060; color: #e08080; }
.dip-tr .x { background: none; border: 0; color: #e0a0a0; cursor: pointer; font-size: .8rem; padding: 0; }
.dip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; align-items: end; }
.dip-grid .big { font-size: 1.4rem; font-family: 'IM Fell English', serif; }
.dip-neg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dip-chk { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.dip-chk input { margin-top: 4px; width: 18px; height: 18px; accent-color: #d4b24a; }
.dip-chk span { display: flex; flex-direction: column; } .dip-chk small { color: var(--muted, #aab3c0); font-size: .75rem; }
.dip-num { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: .86rem; }
.dip-num input { width: 110px; background: rgba(10,18,36,.8); border: 1px solid rgba(212,200,166,.4); color: #f0e6c8; border-radius: 4px; padding: 6px 8px; font-size: 1rem; }
.dip-eval { margin: 12px 0 8px; padding: 10px 12px; border: 1px solid rgba(212,200,166,.3); border-radius: 6px; background: rgba(0,0,0,.18); }
.dip-react { font-size: 1.05rem; margin-bottom: 6px; } .dip-react.ok b { color: #9fd0a0; } .dip-react.warn b { color: #e0c070; } .dip-react.bad b { color: #e08080; }
.dip-offer { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(212,200,166,.15); }
.dip-offer img { width: 56px; height: 68px; object-fit: cover; border-radius: 4px; }
.dip-offer p { margin: 4px 0 6px; }
.dip-court { margin-top: 18px; }
@media (max-width: 1280px) { .dip-layout { grid-template-columns: 260px minmax(0, 1fr); } .dip-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 1000px) {
  .war-map-big { grid-template-columns: 1fr !important; }
  .war-map-frame.big { height: 72vh; height: 72dvh; min-height: 420px; }
  .war-map-frame.big.world:not(.is-full) { height: 92vw; min-height: 340px; }
}
@media (max-width: 760px) {
  .dip-layout { grid-template-columns: 1fr; } .dip-side { grid-template-columns: 1fr; }
  .dip-list { max-height: 300px; }
  .dip-neg-cols, .dip-grid { grid-template-columns: 1fr; }
  .wm-tb { min-width: 42px; height: 42px; line-height: 40px; }
  .wm-tb.wide { font-size: .8rem; padding: 0 8px; }
  .wm-zl { display: none; }
  .mini-map { height: 320px; }
}

/* r4.1 — Queen’s Residency, current seat of court */
.wm-palace { pointer-events: none; }
.wm-pal-hall, .wm-pal-t { fill: #efe6c8; stroke: #5a3e18; stroke-width: 1.05; }
.wm-pal-roof { fill: #8a2e2e; stroke: #3a1818; stroke-width: .8; }
.wm-seat-disc { fill: #f0c654; stroke: #3a2a10; stroke-width: 1.3; }
.wm-seat-crown { fill: #3a2a10; }
.wm-seat-lbl { font-family: 'IM Fell English', serif; font-style: italic; font-size: 12px; text-anchor: middle; fill: #ffe9a0; paint-order: stroke; stroke: #0b1222; stroke-width: 3.2px; stroke-linejoin: round; }
.wm-lbl.is-seat text { fill: #ffe9a0; }

/* ---------- r5: the sea — zones, lanes, ports (naval power) ---------- */
.wm-zones { display: none; }
.wm-svg.zones-on .wm-zones { display: block; }
.wm-zone { fill: rgba(255,255,255,0); stroke: rgba(236,248,244,.34); stroke-width: 1.3; stroke-dasharray: 3 6; stroke-linejoin: round; }
.wm-zone:hover { fill: rgba(240,198,84,.10); }
.wm-zone.k-strait { fill: rgba(240,198,84,.09); stroke: rgba(246,214,120,.55); stroke-dasharray: 5 4; }
.wm-zone.k-sound { fill: rgba(255,255,255,.035); }
.wm-lane { fill: none; stroke: rgba(246,236,200,.5); stroke-width: 1.6; stroke-dasharray: 1.5 7; stroke-linecap: round; }
.wm-lane.narrow { stroke: rgba(246,214,120,.8); stroke-width: 2.2; }
.wm-zone-lbl { font-family: 'IM Fell English', serif; font-style: italic; text-anchor: middle; fill: #eaf6f2; paint-order: stroke; stroke: #14484f; stroke-width: 3px; stroke-linejoin: round; opacity: .92; }
.wm-zone-lbl.k-deep { font-size: 25px; letter-spacing: 5px; opacity: .8; }
.wm-zone-lbl.k-open { font-size: 19px; letter-spacing: 3px; }
.wm-zone-lbl.k-sound { font-size: 13.5px; letter-spacing: 1px; }
.wm-zone-lbl.k-strait { font-size: 11.5px; fill: #fbe9ad; }
.wm-svg:not(.zoomed) .wm-zone-lbl.k-strait, .wm-svg:not(.zoomed) .wm-zone-lbl.k-sound { opacity: 0; }
.wm-svg.small .wm-zone-lbl { display: none; }
.wm-port circle { fill: #173a58; stroke: #f4ead0; stroke-width: 1.6; }
.wm-port.great circle { fill: #1b3a7a; stroke: #f0c654; stroke-width: 2; }
.wm-port text { font-size: 10px; fill: #f4ead0; text-anchor: middle; }
.wm-port.great text { font-size: 11.5px; fill: #fff3c4; }
.wm-svg:not(.zoomed) .wm-port.haven { opacity: 0; }
.wm-tb.wide.is-on { background: #1b3a7a; color: #fff3c4; border-color: #f0c654; }
.war-sea-panel .sea-routes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.war-sea-panel .sea-routes li { padding: 3px 0; border-bottom: 1px dotted rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 8px; }
.sea-note { font-size: 12.5px; color: #9fb4c4; margin: 6px 0 0; }
.sea-note b { color: #f0c654; }
.wm-legend .lg-sea i { display: inline-block; width: 18px; border-top: 2px dotted #f6d678; vertical-align: middle; margin-right: 4px; }
.wm-choke.k-strait .cn { display: none; }   /* the zone names label the crossings; the tooltip names the crossing */

/* =================== Valcourt r6: fortresses, battle day overlay, trebuchet =================== */
.wm-fort path { stroke: #1b2333; stroke-width: 1.4; }
.wm-fort .wm-fort-flag { fill: #c9d3e0; stroke: #1b2333; stroke-width: 1; }
.wm-fort.lost path:first-of-type { stroke: #b3261e; stroke-width: 2; }
.wm-fort-ring { fill: none; stroke: #c0392b; stroke-width: 2.4; stroke-dasharray: 4 3; animation: fortRing 3s linear infinite; }
@keyframes fortRing { to { stroke-dashoffset: -28; } }
.wm-fort-lbl { font-family: 'IM Fell English SC', serif; font-size: 10px; text-anchor: middle; fill: #2a1d0c; paint-order: stroke; stroke: #f3e8c8; stroke-width: 3px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.wm-svg.zoomed .wm-fort-lbl { opacity: 1; }
.wm-fort { cursor: pointer; }
.wm-fort:hover path { filter: brightness(1.25); }
.ws-bat { color: #ffb4a8; text-decoration: none; border-bottom: 1px dashed currentColor; animation: wsPulse 1.6s ease-in-out infinite; }
@keyframes wsPulse { 50% { opacity: .55; } }

.forts { margin-top: 12px; display: grid; gap: 8px; }
.forts .mk-k { margin-bottom: 2px; }
.fort-card { border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 10px; background: linear-gradient(180deg, rgba(20,32,56,.55), rgba(8,14,28,.55)); }
.fort-card.mine { border-color: rgba(240,198,84,.35); }
.fort-card.sieged { border-color: #c0392b; box-shadow: 0 0 12px rgba(192,57,43,.25); }
.fc-top { display: flex; gap: 8px; align-items: center; }
.fc-top small { display: block; color: var(--muted); font-size: .76rem; }
.fort-ic { width: 26px; height: 26px; flex: none; }
.fc-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; font-size: .84rem; margin-top: 5px; }
.fc-row > span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.fc-row small { grid-column: 2 / -1; }
.forts.compact .fc-row small { display: none; }
.fc-acts { margin-top: 8px; flex-wrap: wrap; }
.war-sel { background: #0d1626; color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: .8rem; max-width: 100%; }
.siege-forts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.siege-forts .sf { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--border-soft); border-radius: 6px; background: rgba(0,0,0,.25); color: var(--text); cursor: pointer; font: inherit; font-size: .82rem; }
.siege-forts .sf small { color: var(--muted); }
.siege-forts .sf.on { border-color: var(--goldb); box-shadow: 0 0 10px rgba(240,198,84,.25); }
.siege-forts .sf.fallen { opacity: .55; text-decoration: line-through; cursor: default; }
.pend-bat { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; border-color: #c0392b !important; background: linear-gradient(90deg, rgba(120,24,20,.25), rgba(10,18,34,.6)) !important; }
.pend-bat h3 { margin: 2px 0 4px; }
.watch { margin-left: 6px; padding: 2px 8px !important; }

/* overlay */
body.vb-open { overflow: hidden; }
#vb { position: fixed; inset: 0; z-index: 900; display: none; align-items: center; justify-content: center; background: rgba(3,7,16,.78); backdrop-filter: blur(3px); padding: 16px; }
#vb.show { display: flex; animation: vbIn .25s ease; }
@keyframes vbIn { from { opacity: 0; } }
.vb-box { width: min(980px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(180deg, #13203a, #0a1222); border: 1px solid #8e9bb0; border-radius: 10px; box-shadow: 0 0 0 4px rgba(10,18,34,.8), 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08); color: #e6e9ef; }
.vb-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 18px 10px; border-bottom: 1px solid rgba(201,211,224,.2); background: linear-gradient(180deg, rgba(201,211,224,.08), transparent); }
.vb-kicker { font-family: 'IM Fell English SC', serif; letter-spacing: .14em; text-transform: uppercase; color: #c9d3e0; font-size: .72rem; }
.vb-title { margin: 2px 0 0; font-family: 'IM Fell English SC', serif; color: #f4e3a8; font-size: 1.5rem; }
.vb-x { background: none; border: 1px solid rgba(201,211,224,.3); color: #c9d3e0; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; }
.vb-body { padding: 14px 18px 18px; }
.vb-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.btn.big { font-size: 1.05rem; padding: 10px 22px; }
.btn.ghost { background: transparent; }

/* pre-battle */
.vb-pre-cols { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 12px; align-items: start; }
.vb-side-card { border: 1px solid rgba(201,211,224,.25); border-radius: 8px; padding: 10px; background: rgba(0,0,0,.25); }
.vb-side-card.r-att { border-top: 3px solid #f0c654; } .vb-side-card.r-def { border-top: 3px solid #b3261e; }
.vb-sc-top { display: flex; gap: 8px; align-items: center; }
.vb-sc-top img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #8e9bb0; }
.vb-sc-top small { display: block; color: #f0c654; font-size: .76rem; }
.vb-role { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #9aa6b8; }
.vb-men { margin: 8px 0 4px; color: #9aa6b8; font-size: .8rem; } .vb-men span { font-size: 1.5rem; color: #fff; font-family: 'IM Fell English SC', serif; }
.vb-comp { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #0b1222; }
.vb-comp i { display: block; height: 100%; }
.vb-ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: .82rem; }
.vb-ul li { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px dotted rgba(201,211,224,.12); }
.vb-ul li.tot { border-top: 1px solid rgba(201,211,224,.3); font-weight: 600; }
.vb-vs { text-align: center; }
.vb-vs-t { font-family: 'IM Fell English SC', serif; font-size: 2.2rem; color: #c9d3e0; text-shadow: 0 0 18px rgba(201,211,224,.35); }
.vb-bop-l { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #9aa6b8; margin: 6px 0; }
.vb-bop-n { display: flex; justify-content: space-between; font-size: .8rem; color: #9aa6b8; }
.vb-mlist { list-style: none; padding: 0; margin: 10px 0 0; font-size: .8rem; text-align: left; }
.vb-mlist li { padding: 3px 0 3px 14px; position: relative; } .vb-mlist li::before { content: '◆'; position: absolute; left: 0; color: #8e9bb0; font-size: .6rem; top: 6px; }
.vb-hint { text-align: center; color: #9aa6b8; font-size: .86rem; margin: 12px 0 0; }

/* balance tug */
.vb-tug { position: relative; height: 10px; border-radius: 5px; background: #7d1f1a; overflow: visible; border: 1px solid rgba(201,211,224,.3); }
.vb-tug.big { height: 14px; }
.vb-tug i { display: block; height: 100%; border-radius: 5px 0 0 5px; background: #f0c654; transition: width 1.2s cubic-bezier(.3,1.4,.5,1); }
.vb-tug em { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff; transition: left 1.2s cubic-bezier(.3,1.4,.5,1); animation: tugSway 1.4s ease-in-out infinite; }
@keyframes tugSway { 50% { transform: translateX(3px); } }

/* stage */
.vb-bars { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.vb-bar b { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-bar.r-def { text-align: right; }
.vb-track { height: 12px; background: #0b1222; border: 1px solid rgba(201,211,224,.3); border-radius: 6px; overflow: hidden; }
.vb-bar.r-def .vb-track { transform: scaleX(-1); }
.vb-track i { display: block; height: 100%; transition: width 1.4s ease; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.vb-bar span { font-size: .78rem; color: #9aa6b8; }
.vb-fieldwrap { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid #8e9bb0; box-shadow: inset 0 0 30px rgba(0,0,0,.5); }
.vb-field { display: block; width: 100%; height: auto; aspect-ratio: 800 / 270; }
.vb-sky { fill: #8fb3d9; transition: fill 1.6s ease; }
.ph0 .vb-sky { fill: #e9b98a; } .ph1 .vb-sky { fill: #9cc3e8; } .ph2 .vb-sky { fill: #c2a27a; } .ph3 .vb-sky { fill: #4a3a5c; }
.vb-sun { fill: #fff2b8; transition: cx 1.6s ease, cy 1.6s ease, fill 1.6s; filter: drop-shadow(0 0 10px #ffe9a0); }
.ph3 .vb-sun { fill: #ff9a5a; }
.vb-far { fill: #6f8b6a; opacity: .75; } .ph3 .vb-far { fill: #3a4a42; }
.vb-tree { fill: #2f4a2c; } .vb-hill { fill: #6c8558; } .vb-mtn { fill: #77808c; } .vb-snow { fill: #eef2f7; } .vb-pool { fill: #4f6f78; opacity: .8; }
.vb-stone { fill: #9aa0a8; stroke: #4b515a; stroke-width: 2; } .vb-cren { fill: none; stroke: #4b515a; stroke-width: 2; }
.vb-gate { fill: #3b2a1a; } .vb-wbar-bg { fill: #2a0e0c; } .vb-wbar { fill: #c9d3e0; transition: width 1.4s ease; }
.vb-crack { fill: none; stroke: #1b1b1b; stroke-width: 2.5; stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset 1.6s ease; }
.vb-crack.on { stroke-dashoffset: 0; }
.vb-army { transition: transform 1.6s cubic-bezier(.45,.05,.3,1); }
.vb-blk-in { animation: blkBob 1.2s ease-in-out infinite; animation-delay: var(--d); transform-box: fill-box; }
@keyframes blkBob { 50% { transform: translateY(-2px); } }
.vb-army.fight .vb-blk-in { animation: blkFight .45s ease-in-out infinite; animation-delay: var(--d); }
@keyframes blkFight { 25% { transform: translate(3px,-2px) rotate(2deg); } 75% { transform: translate(-3px,1px) rotate(-2deg); } }
.vb-hl { fill: rgba(255,255,255,.35); }
.vb-pole { stroke: #2a2a2a; stroke-width: 1.5; }
.vb-flag { stroke: #1b2333; stroke-width: .8; transform-box: fill-box; transform-origin: left center; animation: flagWave 1.1s ease-in-out infinite; animation-delay: var(--d); }
@keyframes flagWave { 50% { transform: skewY(6deg) scaleX(.9); } }
.vb-blk { transition: opacity 1s ease, transform 1s; }
.vb-blk.down { opacity: .12; }
.vb-army.rout .vb-blk-in { animation: blkRout .5s ease-in-out infinite; }
@keyframes blkRout { 50% { transform: translateY(2px) rotate(-6deg); } }
.vb-army.win .vb-flag { animation-duration: .5s; }
.vb-arrow { fill: none; stroke: #2b2b2b; stroke-width: 1.4; stroke-dasharray: 10 400; stroke-dashoffset: 0; animation: arrowFly 1.3s linear infinite; }
@keyframes arrowFly { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -400; } }
.vb-dust { fill: rgba(222,204,170,.55); animation: dustPuff 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.vb-dust.big { animation-iteration-count: 1; animation-fill-mode: forwards; }
@keyframes dustPuff { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.vb-spark { fill: #ffe27a; animation: sparkPop 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sparkPop { 0% { transform: scale(0); opacity: 1; } 40% { transform: scale(1.1); } 100% { transform: scale(.4); opacity: 0; } }
.vb-time { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 10px 0 0; counter-reset: ph; }
.vb-time li { text-align: center; padding: 6px 4px; border-radius: 6px; border: 1px solid rgba(201,211,224,.2); background: rgba(0,0,0,.2); transition: all .4s; }
.vb-time li b { display: block; font-family: 'IM Fell English SC', serif; font-size: .9rem; color: #c9d3e0; }
.vb-time li small { color: #8693a6; font-size: .72rem; }
.vb-time li.on { border-color: #f0c654; background: rgba(240,198,84,.12); box-shadow: 0 0 12px rgba(240,198,84,.25); } .vb-time li.on b { color: #f4e3a8; }
.vb-time li.done { opacity: .6; }
.vb-cap { text-align: center; min-height: 2.6em; margin: 10px 0 0; font-style: italic; color: #dfe4ec; }

/* noon decision */
.vb-decide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,10,22,.72); animation: vbIn .3s ease; }
.vb-decide[hidden] { display: none; }
.vb-dec-in { text-align: center; padding: 10px; }
.vb-dec-t { font-family: 'IM Fell English SC', serif; color: #f4e3a8; font-size: 1.3rem; margin-bottom: 8px; }
.vb-dec-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 130px)); gap: 8px; justify-content: center; }
.vb-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 8px; border: 1px solid #8e9bb0; background: linear-gradient(180deg, #1d2d4d, #0e1830); color: #e6e9ef; cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s; }
.vb-card:hover, .vb-card:focus-visible { transform: translateY(-4px); border-color: #f0c654; box-shadow: 0 6px 18px rgba(240,198,84,.25); }
.vb-card .i { font-size: 1.6rem; } .vb-card small { font-size: .7rem; color: #9aa6b8; line-height: 1.25; }
.vb-dec-n { font-size: .72rem; color: #9aa6b8; margin: 8px 0 0; }

/* result */
.vb-verdict { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(201,211,224,.2); animation: verdictIn .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes verdictIn { from { transform: scale(.85); opacity: 0; } }
.vb-verdict h3 { margin: 0 0 4px; font-family: 'IM Fell English SC', serif; font-size: 1.4rem; }
.vb-verdict p { margin: 0; font-size: .88rem; color: #c3cad6; }
.vb-seal { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: radial-gradient(circle at 35% 30%, #d9dfe8, #7b8798); color: #0e1830; box-shadow: 0 0 0 3px #0a1222, 0 0 0 4px #8e9bb0; }
.vb-result.win .vb-seal { background: radial-gradient(circle at 35% 30%, #fff1b8, #c2932c); } .vb-result.win h3 { color: #f4e3a8; }
.vb-result.loss .vb-seal { background: radial-gradient(circle at 35% 30%, #f3a59a, #8f2a20); } .vb-result.loss h3 { color: #ffb4a8; }
.vb-res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.vb-res-side { padding: 10px; border-radius: 8px; background: rgba(0,0,0,.2); border: 1px solid rgba(201,211,224,.15); }
.vb-notes { margin: 12px 0 0; padding-left: 18px; font-size: .86rem; }
.vb-notes li { margin: 3px 0; }
.vb-mods { margin-top: 10px; font-size: .84rem; } .vb-mods summary { cursor: pointer; color: #c9d3e0; }

/* trebuchet */
.tb-svg { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid #8e9bb0; }
.tb-frame { fill: none; stroke: #5a3f22; stroke-width: 7; stroke-linecap: round; }
.tb-arm { transform-origin: 0 0; transform: rotate(-28deg); transition: transform .45s cubic-bezier(.6,-.3,.4,1.4); }
.tb-arm line { stroke: #6e4c2a; stroke-width: 6; stroke-linecap: round; }
.tb-arm.swing { transform: rotate(62deg); }
.tb-cw { fill: #4b515a; } .tb-sling { fill: #9aa0a8; } .tb-stone { fill: #6d6f73; stroke: #333; }
.tb-name { font-family: 'IM Fell English SC', serif; font-size: 14px; fill: #f4f1e6; paint-order: stroke; stroke: #0b1222; stroke-width: 3px; }
.tb-meter { position: relative; height: 22px; margin: 12px auto 0; max-width: 520px; border-radius: 11px; background: linear-gradient(90deg, #3a1714, #263450 50%, #3a1714); border: 1px solid #8e9bb0; overflow: hidden; }
.tb-zone { position: absolute; top: 0; bottom: 0; }
.tb-zone.silver { left: 34%; width: 32%; background: rgba(201,211,224,.35); }
.tb-zone.gold { left: 45%; width: 10%; background: rgba(240,198,84,.85); box-shadow: 0 0 10px #f0c654; }
#tbNeedle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 8px #fff; left: 0; }
.tb-shots { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.tb-shots span { width: 14px; height: 14px; border-radius: 50%; background: #2a3550; border: 1px solid #8e9bb0; }
.tb-shots span.gold { background: #f0c654; } .tb-shots span.silver { background: #c9d3e0; } .tb-shots span.miss { background: #7d1f1a; }

@media (max-width: 720px) {
  #vb { padding: 0; }
  .vb-box { border-radius: 0; height: 100%; max-height: none; }
  .vb-body { padding: 10px; }
  .vb-pre-cols { grid-template-columns: 1fr 1fr; }
  .vb-vs { grid-column: 1 / -1; order: -1; }
  .vb-vs-t { font-size: 1.4rem; }
  .vb-bars { grid-template-columns: 1fr 1fr; } .vb-bars .vb-tug { grid-column: 1 / -1; order: 3; }
  .vb-field { aspect-ratio: 800 / 330; }
  .vb-dec-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .vb-card { padding: 6px 3px; } .vb-card small { display: none; } .vb-card .i { font-size: 1.3rem; } .vb-card b { font-size: .8rem; }
  .vb-dec-t { font-size: 1rem; margin-bottom: 4px; } .vb-dec-n { display: none; }
  .vb-time li small { display: none; }
  .vb-res-cols { grid-template-columns: 1fr; }
  .pend-bat { flex-direction: column; align-items: stretch; }
  .fc-row { grid-template-columns: 60px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { .vb-blk-in, .vb-flag, .vb-arrow, .vb-dust, .vb-spark, .vb-tug em { animation: none !important; } }
