/* =========================================================================
   Marches of the Crown - Game client
   Weathered parchment + struck-gold heraldic theme, ported from
   "Game Interface v4". Reusable "material" classes; dynamic values
   (bar widths, tile colours, active states) are set inline from game.js.
   ========================================================================= */

:root {
  --umber-1: #4e3218;
  --umber-2: #2e2010;
  --ink: #1c0f04;
  --oak-head-1: #6e4a24;
  --oak-head-2: #4a2f14;
  --parchment: #f2e3c0;
  --parchment-card-1: #f4e7c6;
  --parchment-card-2: #ecdab0;
  --parchment-line: #b99a5c;
  --parchment-border: #8a7048;
  --gold: #e6c06a;
  --gold-deep: #b07d20;
  --garnet: #8e3b2c;
  --brown-text: #2e2010;
  --muted: #8a5a28;
  --green: #6a8a3e;
  --blue: #46606f;
  --bar-track: #cbb187;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #241505;
  color: var(--brown-text);
  font-family: 'Alegreya Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: var(--garnet); text-decoration: none; font-weight: 800; }
a:hover { color: #c8992e; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #8a5a28; border-radius: 99px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .15); }

svg { display: block; }

/* ---- App frame -------------------------------------------------------- */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .13) 0 3px, transparent 3px 9px),
    radial-gradient(ellipse 110% 85% at 50% -5%, #513a1c, #2f2110 68%, #211508);
}

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 7px),
    linear-gradient(var(--umber-1), var(--umber-2));
  border-bottom: 2px solid var(--ink);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  flex-shrink: 0;
}

.topbar__brand { display: flex; align-items: center; gap: 9px; }

.res-pills { display: flex; gap: 8px; }

.res-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 7px),
    linear-gradient(var(--umber-1), var(--umber-2));
  border: 1.5px solid #5c4522;
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  color: #ecd9ae;
  font-weight: 900;
  font-size: 13.5px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45);
  white-space: nowrap;
}
.res-pill__badge {
  display: flex;
  border: 1.5px solid #33220f;
  border-radius: 999px;
  padding: 2px;
}
.res-pill__rate { font-size: 10.5px; color: #b0c38a; font-weight: 900; }

.spacer { flex: 1; }

.topbar__tag {
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: 'Alegreya Sans SC', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gold);
  white-space: nowrap;
}

.topbar__lord {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
}
.topbar__lord span { font-weight: 900; font-size: 13px; color: #ecd9ae; }

/* ---- Body split: nav rail + main ------------------------------------- */
.body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.rail {
  width: 92px;
  background: linear-gradient(#3d2712, #28180a);
  border-right: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 8px;
  flex-shrink: 0;
}

.nav-item {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 7px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background: rgba(0, 0, 0, .22);
  border: 1.5px solid transparent;
  color: #b99a5c;
  transition: filter .1s ease;
}
.nav-item:hover { filter: brightness(1.1); }
.nav-item__label { font-size: 10.5px; font-weight: 900; letter-spacing: .06em; }
.nav-item.is-active {
  background: linear-gradient(#f0cf7a, #d9a33c 50%, #b07d20);
  border-color: #241505;
  box-shadow: inset 0 1px 0 rgba(255, 242, 192, .6), 0 2px 4px rgba(0, 0, 0, .45);
  color: #3a2005;
}
.nav-item__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--garnet);
  border: 1.5px solid #33220f;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 24px 30px;
}
.screen { max-width: 1180px; margin: 0 auto; }
.screen--narrow { max-width: 860px; }

/* ---- Headings --------------------------------------------------------- */
.screen-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .75), 0 2px 3px rgba(0, 0, 0, .55);
  line-height: 1.1;
}
.subtitle { font-size: 13px; font-weight: 900; color: var(--gold); }

.tag-parchment {
  background: var(--parchment);
  border: 1.5px solid #33220f;
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  box-shadow: 0 2px 2px rgba(58, 36, 18, .3);
}

/* ---- Panels ----------------------------------------------------------- */
.panel {
  background: var(--parchment);
  border: 1.5px solid #33220f;
  border-radius: 5px;
  box-shadow: 0 0 0 2px #6e4a24, 0 0 0 3px #241505, 0 5px 13px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.panel__head {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 2px, transparent 2px 7px),
    linear-gradient(var(--oak-head-1), var(--oak-head-2));
  padding: 9px 16px;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
  border-bottom: 1.5px solid #33220f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.panel__head--tall { padding: 10px 17px; font-size: 16px; }
.panel__head--red { background: linear-gradient(#a44a37, #8e3b2c); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.panel__body { padding: 13px 16px; display: flex; flex-direction: column; gap: 11px; }
.panel__body--pad { padding: 15px 17px; }
.panel--pad { padding: 15px 17px; display: flex; flex-direction: column; gap: 12px; }

.pill-mini {
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 2px 11px;
  font-family: 'Alegreya Sans', sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

/* ---- Cards (parchment tiles) ----------------------------------------- */
.card {
  background: linear-gradient(var(--parchment-card-1), var(--parchment-card-2));
  border: 1.5px solid var(--parchment-border);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, .8), 0 2px 4px rgba(0, 0, 0, .28);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.icon-well {
  display: flex;
  background: linear-gradient(#e9d6ac, #f2e3c0);
  border: 1.5px solid var(--parchment-border);
  border-radius: 3px;
  box-shadow: inset 0 2px 4px rgba(58, 38, 18, .35), 0 1px 0 rgba(255, 248, 224, .7);
  padding: 6px;
}
.card__title { font-family: 'Cinzel', serif; font-size: 15px; }
.card__desc { font-size: 11.5px; font-weight: 800; color: var(--muted); }

.lvl-badge {
  background: linear-gradient(#7d95a8, #46606f);
  border: 1.5px solid #26363f;
  border-radius: 3px;
  padding: 3px 8px;
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}

/* ---- Progress bars ---------------------------------------------------- */
.bar {
  height: 12px;
  background: var(--bar-track);
  border: 1.5px solid var(--parchment-border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(58, 38, 18, .45);
}
.bar__fill {
  height: 100%;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(230, 245, 190, .5);
}
.fill-green { background: linear-gradient(#93ac62, #6a8a3e); }
.fill-gold { background: linear-gradient(#e6c06a, #b07d20); box-shadow: inset 0 1px 0 rgba(255, 245, 205, .55); }
.fill-blue { background: linear-gradient(#7d95a8, #46606f); box-shadow: inset 0 1px 0 rgba(255, 245, 205, .55); }
.fill-store { background: linear-gradient(#b98a4a, #b57a3a); box-shadow: inset 0 1px 0 rgba(255, 245, 205, .55); }
.fill-red { background: linear-gradient(#a44a37, #6f2a1c); box-shadow: inset 0 1px 0 rgba(255, 245, 205, .55); }

.stat-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Alegreya Sans SC', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
}
.kv {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 900;
}
.kv > span:first-child { color: var(--muted); }
.kv--dashed { border-bottom: 2px dashed #d9c294; padding-bottom: 6px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  font-family: 'Cinzel', serif;
  text-align: center;
  border-radius: 3px;
  cursor: pointer;
  color: #fff;
  transition: filter .1s ease;
  border: 1.5px solid transparent;
  user-select: none;
}
.btn:hover { filter: brightness(1.07); }
.btn--green { background: linear-gradient(#93ac62, #6a8a3e); border-color: #33481c; box-shadow: 0 2px 2px #33481c; text-shadow: 0 2px 0 rgba(45, 80, 10, .55); }
.btn--red { background: linear-gradient(#a44a37, #8e3b2c); border-color: #3a1209; box-shadow: 0 2px 2px #3a1209; }
.btn--blue { background: linear-gradient(#7d95a8, #46606f); border-color: #26363f; box-shadow: 0 2px 2px #26363f; }
.btn--gold {
  background: linear-gradient(#f0cf7a, #d9a33c 50%, #b07d20);
  color: #3a2005;
  border-color: #241505;
  box-shadow: inset 0 1px 0 rgba(255, 242, 192, .7), inset 0 -2px 3px rgba(90, 60, 10, .45), 0 2px 3px rgba(0, 0, 0, .4);
}
.btn--disabled {
  background: #d9c294;
  color: #8a7048;
  border-color: #9c855c;
  box-shadow: 0 2px 2px #9c855c;
  cursor: not-allowed;
}
.btn--disabled:hover { filter: none; }
.btn--block { display: block; }

.upgrade-btn {
  font-size: 12.5px;
  padding: 7px;
  display: flex;
  justify-content: center;
  gap: 9px;
  align-items: center;
}
.upgrade-btn__cost { font-family: 'Alegreya Sans', sans-serif; font-size: 10.5px; font-weight: 900; opacity: .85; }

/* ---- Estate: incoming attack ----------------------------------------- */
.alert-attack {
  background: linear-gradient(#a44a37, #8e3b2c);
  border: 1.5px solid #3a1209;
  border-radius: 4px;
  box-shadow: 0 2px 3px #3a1209;
  padding: 9px 16px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
}
.alert-attack__cta {
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11.5px;
}

.progress-caption {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 900;
  color: #5c7a34;
  margin-bottom: 3px;
}

/* ---- Estate layout ---------------------------------------------------- */
.estate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.buildings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 13px;
}
.side-col { display: flex; flex-direction: column; gap: 14px; }

.recruit-row { display: flex; align-items: center; gap: 9px; }
.recruit-link { font-size: 12px; font-weight: 900; color: var(--garnet); cursor: pointer; text-align: right; }

/* ---- Map -------------------------------------------------------------- */
.map-legend { display: flex; gap: 8px; font-size: 11px; font-weight: 900; color: #ecd9ae; flex-wrap: wrap; }
.legend-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 4px 11px;
}
.legend-dot { width: 11px; height: 11px; border-radius: 4px; }

.screen--map { max-width: 1560px; }
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

/* Illustrated map viewport (drawn by map.js) */
.map-view {
  position: relative;
  height: clamp(440px, calc(100vh - 170px), 940px);
  overflow: hidden;
  border: 2px solid #33220f;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #6e4a24, 0 0 0 3px #241505, 0 6px 16px rgba(0, 0, 0, .5);
  background: #5e8a34;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.map-view:focus-visible { box-shadow: 0 0 0 2px #6e4a24, 0 0 0 3px #241505, 0 0 0 6px #d9a33c; }
.map-view.is-panning { cursor: grabbing; }
.map-view::after { /* soft vignette so the edges read as a framed map */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(20, 14, 4, .45), inset 0 0 0 1px rgba(255, 240, 200, .12);
}
.map-svg { display: block; width: 100%; height: 100%; }

.holding { cursor: pointer; }
.holding__hit { fill: transparent; }
.holding__art { transition: filter .12s ease; }
.holding:hover .holding__art { filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 236, 170, .55)); }
.sel-ring {
  display: none;
  fill: rgba(242, 201, 76, .14);
  stroke: #f2c94c;
  stroke-width: 3.5;
  stroke-dasharray: 14 8;
  animation: sel-spin 18s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.holding.is-selected .sel-ring { display: block; }
@keyframes sel-spin { to { stroke-dashoffset: -220; } }

.map-label { pointer-events: none; transition: opacity .12s ease; }
.map-label.is-hidden { opacity: 0; }
.map-label__name { font-family: 'Cinzel', serif; font-size: 12.5px; font-weight: 700; fill: #f6e7c1; letter-spacing: .02em; }
.map-label__sub { font-family: 'Alegreya Sans', sans-serif; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }

.march { pointer-events: none; }
.march__line { animation: march-dash 1.2s linear infinite; }
@keyframes march-dash { to { stroke-dashoffset: -18; } }
.march__time { font-family: 'Alegreya Sans', sans-serif; font-size: 11.5px; font-weight: 800; fill: #f6e7c1; font-variant-numeric: tabular-nums; }

/* Radial action menu around the selected holding */
.map-radial {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}
.radial-btn {
  position: absolute;
  left: -23px;
  top: -23px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #33220f;
  background: radial-gradient(circle at 38% 32%, #f7e7bf, #d9b56a 62%, #a67a32);
  box-shadow: 0 0 0 2px #e9c870, 0 0 0 3.5px #33220f, 0 4px 10px rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  opacity: 0;
  transform: rotate(var(--a)) translate(0) rotate(calc(-1 * var(--a))) scale(.4);
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), opacity .12s ease;
}
.map-radial.is-open .radial-btn {
  opacity: 1;
  transform: rotate(var(--a)) translate(var(--r, 78px)) rotate(calc(-1 * var(--a))) scale(1);
}
.map-radial:not(.is-open) .radial-btn { pointer-events: none; }
.radial-btn:hover, .radial-btn:focus-visible { background: radial-gradient(circle at 38% 32%, #fff4d6, #e9c56f 62%, #b8873a); outline: none; }
.radial-btn--attack, .radial-btn--besiege, .radial-btn--capture { background: radial-gradient(circle at 38% 32%, #f0a58f, #b8442f 62%, #7a2618); }
.radial-btn--scout { background: radial-gradient(circle at 38% 32%, #c9def0, #6f97ba 62%, #3f6382); }
.radial-btn__label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f6e7c1;
  background: rgba(30, 20, 8, .85);
  border: 1px solid #6e4a24;
  border-radius: 4px;
  padding: 1px 6px;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.radial-btn:hover .radial-btn__label, .radial-btn:focus-visible .radial-btn__label { opacity: 1; }
@media (hover: none) { .radial-btn__label { opacity: 1; } }

.map-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}
.map-controls button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid #33220f;
  background: linear-gradient(#f3e3bd, #d6b97c);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
  font: 900 21px/1 'Alegreya Sans', sans-serif;
  color: #33220f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.map-controls button:hover { background: linear-gradient(#fff2d2, #e2c78c); }
.map-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  font-size: 11px;
  font-weight: 800;
  color: #f6e7c1;
  background: rgba(30, 20, 8, .7);
  border-radius: 999px;
  padding: 4px 11px;
  pointer-events: none;
}

.holding-list { display: flex; flex-direction: column; padding: 6px 8px 10px; max-height: 300px; overflow-y: auto; }
.holding-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px dashed rgba(110, 84, 51, .35);
  background: none;
  padding: 7px 8px;
  font: 800 13.5px 'Alegreya Sans', sans-serif;
  color: #2e2010;
  cursor: pointer;
  border-radius: 4px;
}
.holding-row:last-child { border-bottom: 0; }
.holding-row:hover { background: rgba(217, 163, 60, .16); }
.holding-row.is-active { background: rgba(217, 163, 60, .3); }
.holding-row__dot { width: 11px; height: 11px; border-radius: 3px; border: 1.5px solid #33220f; flex: none; }
.holding-row__dist { font-size: 11.5px; color: #8a5a28; }
.sel-panel.is-flash { animation: panel-flash .7s ease; }
@keyframes panel-flash { 30% { box-shadow: 0 0 0 4px #f2c94c; } }

@media (prefers-reduced-motion: reduce) {
  .sel-ring, .march__line { animation: none; }
  .radial-btn { transition: none; }
}

.sel-panel { position: sticky; top: 0; }
.sel-panel__head {
  padding: 11px 16px;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  border-bottom: 1.5px solid #33220f;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sel-desc { font-size: 13px; font-weight: 800; color: #6e5433; line-height: 1.5; }

/* ---- Army ------------------------------------------------------------- */
.army-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}
.label-caps { font-size: 12px; font-weight: 900; letter-spacing: .1em; color: var(--muted); }
.mission-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mission-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid var(--parchment-line);
  background: var(--parchment);
  color: var(--muted);
  box-shadow: 0 2px 2px var(--parchment-line);
  transition: filter .1s ease;
}
.mission-chip:hover { filter: brightness(1.07); }
.mission-chip.is-active {
  background: linear-gradient(#f0cf7a, #d9a33c 50%, #b07d20);
  color: #3a2005;
  border-color: #241505;
  box-shadow: 0 2px 2px #241505;
}
.target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  flex-wrap: wrap;
  background: #ecd9ae;
  border: 1.5px solid var(--parchment-line);
  border-radius: 4px;
  padding: 9px 13px;
}
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.unit-card {
  background: linear-gradient(var(--parchment-card-1), var(--parchment-card-2));
  border: 1.5px solid var(--parchment-border);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, .8), 0 2px 4px rgba(0, 0, 0, .28);
  padding: 11px 13px;
  display: flex;
  gap: 11px;
  align-items: center;
}
.stepper { display: flex; gap: 5px; align-items: center; }
.step-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
  user-select: none;
  border-radius: 3px;
}
.step-btn--minus { background: linear-gradient(#a44a37, #8e3b2c); border: 1.5px solid #3a1209; box-shadow: 0 1px 2px #3a1209; }
.step-btn--plus { background: linear-gradient(#93ac62, #6a8a3e); border: 1.5px solid #33481c; box-shadow: 0 1px 2px #33481c; }
.step-count { font-weight: 900; font-size: 15px; width: 36px; text-align: center; }

.supply-pill { border: 1.5px solid #33220f; border-radius: 999px; padding: 2px 11px; }
.supply-note {
  font-size: 12px;
  font-weight: 700;
  color: #6e5433;
  background: #ecd9ae;
  border: 2px dashed var(--parchment-line);
  border-radius: 3px;
  padding: 8px 11px;
  line-height: 1.45;
}
.march-btn {
  background: linear-gradient(#a44a37, #8e3b2c 55%, #6f2a1c);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 19px;
  padding: 13px;
  text-align: center;
  border: 1.5px solid #3a1209;
  border-radius: 4px;
  box-shadow: 0 2px 4px #3a1209, inset 0 1px 0 rgba(255, 200, 160, .25);
  text-shadow: 0 2px 0 rgba(90, 15, 5, .5);
  cursor: pointer;
  margin-top: 5px;
  transition: filter .1s ease;
}
.march-btn:hover { filter: brightness(1.07); }
.marched-note {
  background: #eef0dc;
  border: 1.5px solid #6a8a3e;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 900;
  color: #5c7a34;
  text-align: center;
}

/* ---- Reports ---------------------------------------------------------- */
.reports { display: flex; flex-direction: column; gap: 13px; }
.report {
  background: linear-gradient(var(--parchment-card-1), var(--parchment-card-2));
  border: 1.5px solid var(--parchment-border);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, .8), 0 2px 4px rgba(0, 0, 0, .28);
  overflow: hidden;
}
.report__head {
  padding: 9px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #33220f;
}
.report__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.report__body { padding: 12px 16px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.report__lesson {
  padding: 8px 16px;
  border-top: 2px dashed var(--parchment-line);
  font-size: 12px;
  font-weight: 800;
  color: var(--garnet);
}

/* ---- House ------------------------------------------------------------ */
.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.member {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 2px dashed #d9c294;
}
.member__dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1.5px solid #33220f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  flex-shrink: 0;
}
.diplo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 2px dashed #d9c294;
}
.state-pill { border: 1.5px solid #33220f; border-radius: 999px; padding: 2px 11px; font-size: 10.5px; font-weight: 900; }

/* ---- Crown ------------------------------------------------------------ */
.claimants { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.claimant {
  background: var(--parchment);
  border: 1.5px solid #33220f;
  border-radius: 5px;
  box-shadow: 0 0 0 2px #6e4a24, 0 0 0 3px #241505, 0 5px 13px rgba(0, 0, 0, .45);
  padding: 17px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
}
.claimant--backed { border-color: #241505; }
.claimant__flag {
  position: absolute;
  top: -11px;
  right: 12px;
  background: linear-gradient(#e6c06a, #b07d20);
  border: 1.5px solid #241505;
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 10.5px;
  font-weight: 900;
  color: #3a2005;
}
.objective { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 2px dashed #d9c294; }
.objective__check {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  border: 1.5px solid #33220f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.coronation {
  background: linear-gradient(#7d95a8, #46606f);
  border: 1.5px solid #26363f;
  border-radius: 5px;
  box-shadow: 0 0 0 2px #6e4a24, 0 0 0 3px #241505, 0 5px 13px rgba(0, 0, 0, .45);
  padding: 20px 22px;
  color: #fff;
}
.coronation h3 { font-family: 'Cinzel', serif; font-size: 19px; text-shadow: 0 2px 0 rgba(29, 78, 128, .6); margin: 0; }
.coronation p { font-size: 13.5px; font-weight: 700; line-height: 1.55; margin: 9px 0 13px; }
.coronation__bar { height: 15px; background: rgba(0, 0, 0, .3); border: 1.5px solid #26363f; border-radius: 999px; overflow: hidden; }

/* ---- Utility ---------------------------------------------------------- */
.flex { display: flex; }
.between { display: flex; justify-content: space-between; align-items: center; }
.gap9 { gap: 9px; }
.grow { flex: 1; min-width: 0; }
.cinzel { font-family: 'Cinzel', serif; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 1080px) {
  .estate-grid, .map-layout, .army-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .map-view { height: clamp(380px, 68vh, 720px); }
  .claimants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sel-panel { position: static; }
}
@media (max-width: 720px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; }
  .main { overflow-y: visible; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .res-pills { order: 3; width: 100%; overflow-x: auto; }
  .topbar__tag { display: none; }
  .rail {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    border-right: none;
    border-bottom: 2px solid var(--ink);
    padding: 8px 10px;
    gap: 4px;
    overflow-x: auto;
  }
  .nav-item { width: auto; flex: 1; min-width: 58px; padding: 7px 4px; }
  .body { flex-direction: column; }
  .claimants { grid-template-columns: minmax(0, 1fr); }
}
