/* Marches of the Crown — shared landing-page palette, modern game interface. */
:root {
  --parchment: #efe3c8;
  --parchment-2: #e6d5af;
  --surface: #fbf8ef;
  --ink: #2b2016;
  --ink-soft: #4a3a29;
  --muted: #7c705e;
  --gold: #c9a23f;
  --gold-deep: #a9832a;
  --garnet: #8f2c22;
  --wood: #3a2a1c;
  --wood-dark: #2a1d13;
  --green: #3f6b3a;
  --blue: #46606f;
  --line: #ded3bd;
  --radius: 10px;
  --shadow: 0 3px 12px rgb(43 32 22 / 4%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); background: #f2ecde; font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--garnet); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 4px; }
svg { display: block; flex-shrink: 0; }
h1, h2, h3, p { margin-top: 0; }
button { transition: background-color .16s, border-color .16s, box-shadow .16s; }
::selection { background: #e6d5af; color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: #baad94 transparent; }
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
/* The brand and heraldry are shared with the public website. */
.topbar { display: flex; align-items: center; gap: 24px; min-height: 88px; padding: 0 28px 0 22px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 5; }
.topbar__brand { width: 184px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; color: var(--wood-dark); font: 600 22px/1.05 var(--serif); letter-spacing: -.5px; }
.topbar__brand:hover { text-decoration: none; color: var(--garnet); }
.topbar__brand > span > span { display: block; font-size: 16px; margin-top: 4px; letter-spacing: .4px; }
.res-pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; flex: 1; min-width: 420px; max-width: 640px; }
.res-pill { display: flex; align-items: center; gap: 9px; min-width: 0; font-variant-numeric: tabular-nums; }
.res-pill__badge { display: grid; place-items: center; width: 36px; height: 40px; border-radius: 8px; background: #eee8d9; flex-shrink: 0; }
.res-pill__detail { display: flex; flex-direction: column; line-height: 1.4; }
.res-pill__label { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .4px; }
.res-pill strong { font-size: 18px; font-weight: 650; letter-spacing: -.5px; }
.res-pill__rate { color: var(--green); font-size: 10px; white-space: nowrap; align-self: flex-end; padding-bottom: 3px; }
.topbar__world { display: grid; grid-template-columns: 6px auto; column-gap: 9px; align-items: center; font-size: 12px; font-weight: 650; white-space: nowrap; }
.topbar__world small { grid-column: 2; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.topbar__day { color: var(--muted); font-weight: 400; }
.world-indicator { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #7c945c; }
.topbar__lord { display: flex; gap: 10px; align-items: center; color: var(--ink); background: none; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 20px; text-align: left; font-size: 12px; font-weight: 600; max-width: 205px; }
.topbar__lord > span:not(.profile-chevron) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__lord small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.profile-chevron { margin-left: 8px; color: var(--muted); }
.body { display: flex; flex: 1; min-height: 0; }
.rail { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; color: var(--parchment); background: linear-gradient(160deg, var(--wood), var(--wood-dark)); border-right: 1px solid #4b3826; padding: 32px 16px 24px; overflow-y: auto; }
.rail__intro { padding: 0 14px 30px; border-bottom: 1px solid #54412e; margin-bottom: 25px; }
.eyebrow { margin: 0 0 9px; font-size: 10px; font-weight: 650; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); }
.rail__intro .eyebrow { font-size: 9px; color: #ab997e; }
.rail__kingdom { display: block; font: 26px var(--serif); color: var(--parchment); }
.rail__nav { display: flex; flex-direction: column; gap: 7px; }
.rail__label { padding: 0 14px 8px; color: #ad9b83; text-transform: uppercase; letter-spacing: 1.6px; font-size: 9px; font-weight: 600; }
.nav-item { position: relative; width: 100%; display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 11px 14px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #ccbea8; text-align: left; }
.nav-item__icon { opacity: .8; }
.nav-item__label { font-size: 13px; font-weight: 500; }
.nav-item:hover { color: #fff8e9; background: #ffffff08; }
.nav-item.is-active { background: #8f2c22; border-color: #a34b37; color: #fff8e9; box-shadow: 0 3px 8px #00000010; }
.nav-item.is-active .nav-item__icon { opacity: 1; }
.nav-item__badge { margin-left: auto; border-radius: 5px; background: #bd985b29; color: #ead19e; min-width: 20px; text-align: center; font-size: 10px; padding: 2px 4px; }
.rail__footer { margin-top: auto; padding: 40px 14px 0; }
.rail__footer > svg { width: 26px; height: 26px; opacity: .65; margin-bottom: 13px; }
.rail__footer p { font: 14px/1.7 var(--serif); color: #d4c5a9; margin-bottom: 20px; }
.rail__footer p span { color: #a49277; }
.rail__footer a { color: #bca98b; font-size: 10px; display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid #54412e; }
.main { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 32px 36px 42px; background: radial-gradient(ellipse at 90% 0, #e9d9b73d, transparent 55%), #f2ecde; }
.screen { max-width: 1390px; margin: 0 auto; }
.screen--narrow { max-width: 900px; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.screen-head .eyebrow span { margin: 0 8px; color: #b7a88f; }
.title { font: 500 clamp(26px, 2.6vw, 36px)/1.2 var(--serif); color: var(--ink); margin: 0; letter-spacing: -.6px; }
.screen-description { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.screen-head__extra { flex-shrink: 0; }
.subtitle { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.7; margin: 12px 0 26px; }
.tag-parchment { padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; font-weight: 500; color: var(--muted); background: #fbf8ef80; }
/* Estate overview */
.estate-banner { display: flex; position: relative; min-height: 220px; overflow: hidden; border: 1px solid #675034; border-radius: var(--radius); background: radial-gradient(ellipse at 80% 60%, #5c5035, transparent 65%), linear-gradient(110deg, #30241a, #443624); color: var(--parchment); margin-bottom: 22px; }
.estate-banner__copy { padding: 28px 32px; z-index: 1; position: relative; }
.estate-banner .eyebrow { color: #c9ae76; font-size: 9px; letter-spacing: 2px; }
.estate-banner h2 { font: 400 30px/1.15 var(--serif); color: #f6eddb; letter-spacing: -.3px; margin: 12px 0; }
.estate-banner p { font-size: 11px; color: #c4b69c; margin: 0 0 18px; }
.estate-banner__region { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .6px; color: #c8b99b; }
.estate-art { position: absolute; right: 0; bottom: 0; height: 100%; width: 52%; }
.estate-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fbf8ef99; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 0; margin-bottom: 30px; }
.estate-stats > div { display: flex; gap: 13px; align-items: center; padding: 0 23px; border-right: 1px solid var(--line); }
.estate-stats > div:last-child { border: 0; }
.estate-stats > div > span { font-size: 10px; color: var(--muted); }
.estate-stats strong { display: block; font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 3px; }
.estate-stats small { font-size: 11px; color: var(--muted); font-weight: 400; }
.estate-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-heading h2 { font: 500 23px var(--serif); margin: 0; letter-spacing: -.3px; }
.section-heading > span { color: var(--muted); font-size: 10px; }
.buildings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card, .unit-card, .panel, .report { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 14px; }
.building-card { min-height: 175px; transition: border-color .16s, box-shadow .16s; }
.building-card:hover { border-color: #c5af85; box-shadow: 0 5px 16px #2b20160a; }
.building-card > .flex { gap: 10px; }
.icon-well { display: grid; place-items: center; padding: 7px; background: #efe8d9; border-radius: 8px; flex-shrink: 0; }
.card__title { font: 600 16px/1.25 var(--serif); }
.card__desc { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.6; margin: 4px 0 0; }
.lvl-badge { padding: 3px 6px; font-size: 9px; white-space: nowrap; color: #76684f; background: #eee7d8; border-radius: 4px; }
.building-cost { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.building-cost > span { display: flex; align-items: center; gap: 3px; }
.side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.estate-grid > .side-col { padding-top: 46px; }
.panel { overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 10px; font-weight: 650; letter-spacing: 1.2px; background: #f5f0e5; }
.panel__head--red { background: var(--garnet); color: var(--surface); }
.panel__body, .panel--pad { display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.panel__body--pad { padding: 20px; }
.panel .card__desc { margin: 0; }
.kv, .stat-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; }
.kv--dashed { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.stat-row { color: var(--muted); font-size: 10px; letter-spacing: .3px; }
.bar { height: 6px; border-radius: 99px; background: #e9e2d3; overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; max-width: 100%; }
.fill-green { background: #71885a; }
.fill-gold { background: var(--gold); }
.fill-blue { background: #78909a; }
.fill-store { background: #b79b69; }
.fill-red { background: var(--garnet); }
.progress-caption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; font-size: 10px; color: var(--green); }
.recruit-row { display: flex; align-items: center; gap: 10px; }
.recruit-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--garnet); text-align: left; font-size: 10px; font-weight: 650; }
/* Actions: red for the primary action, quiet surfaces for secondary choices. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; color: #fff9ee; background: var(--garnet); font: 550 11px/1.4 var(--sans); text-align: center; }
.btn:hover { background: #a33729; }
.btn--primary, .btn--red { background: var(--garnet); }
.btn--green { background: var(--green); }
.btn--green:hover { background: #345b30; }
.btn--blue { background: var(--blue); }
.btn--blue:hover { background: #344e5b; }
.btn--gold { color: #493712; background: #d5b15c; border-color: #c5a04c; }
.btn--gold:hover { background: #dfbe73; }
.btn--outline, .btn--queue { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.btn--outline:hover, .btn--queue:hover { background: #ece2cc; border-color: #c5af85; }
.btn:disabled, .btn--disabled { background: #f0ece2; border-color: #e5dece; color: #918674; cursor: not-allowed; }
.btn--block { width: 100%; }
.upgrade-btn { display: flex; justify-content: space-between; width: 100%; min-height: 34px; padding: 8px 11px; margin-top: auto; font-size: 10px; }
.upgrade-btn:disabled { justify-content: center; }
/* World map: preserve the illustrated world and its pan / zoom controls. */
.screen--map { max-width: 1600px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.map-view { position: relative; height: clamp(440px, calc(100dvh - 235px), 940px); border: 1px solid #b5a17a; border-radius: var(--radius); overflow: hidden; background: #5e8a34; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.map-view.is-panning { cursor: grabbing; }
.map-view::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px #140e043b; border-radius: inherit; }
.map-svg { display: block; width: 100%; height: 100%; }
.map-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 9px; color: var(--muted); letter-spacing: .4px; }
.legend-chip { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.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 #ffecaa8c); }
.sel-ring { display: none; fill: #f2c94c24; 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; }
.map-label.is-hidden { opacity: 0; }
.map-label__name { font: 600 13px var(--serif); fill: #f6e7c1; }
.map-label__sub { font: 500 10px var(--sans); letter-spacing: .4px; }
.march { pointer-events: none; }
.march__line { animation: march-dash 1.2s linear infinite; }
@keyframes march-dash { to { stroke-dashoffset: -18; } }
.march__time { font: 600 11px var(--sans); fill: #f6e7c1; font-variant-numeric: tabular-nums; }
.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: 1px solid #b5a17a; background: var(--surface); box-shadow: 0 3px 12px #0004; display: grid; place-items: center; pointer-events: auto; padding: 0; opacity: 0; transform: rotate(var(--a)) translate(0) rotate(calc(-1 * var(--a))) scale(.4); transition: transform .18s, opacity .12s; }
.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 { background: #e6d5af; }
.radial-btn--attack, .radial-btn--besiege, .radial-btn--capture { background: #e2b29f; }
.radial-btn--scout { background: #c7d9dd; }
.radial-btn__label { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); white-space: nowrap; color: #f6e7c1; background: #2a1d13e6; font-size: 9px; border-radius: 4px; padding: 3px 6px; opacity: 0; 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: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.map-controls button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #b5a17a; border-radius: 6px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 20px; padding: 0; }
.map-controls button:hover { background: var(--parchment); }
.map-hint { position: absolute; left: 14px; bottom: 14px; z-index: 3; font-size: 9px; color: #f6e7c1; background: #2a1d13bf; border-radius: 5px; padding: 6px 10px; pointer-events: none; }
.holding-list { display: flex; flex-direction: column; padding: 6px; 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 solid var(--line); background: none; padding: 12px 10px; color: var(--ink); font-size: 11px; border-radius: 4px; }
.holding-row:last-child { border-bottom: 0; }
.holding-row:hover, .holding-row.is-active { background: #eee3cd; }
.holding-row__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.holding-row__dist { font-size: 10px; color: var(--muted); }
.sel-panel { position: sticky; top: 0; }
.sel-panel__head { display: flex; align-items: center; gap: 10px; padding: 17px 18px; color: #fff; font: 500 18px var(--serif); }
.sel-desc { font-size: 12px; color: var(--muted); line-height: 1.7; }
.sel-panel.is-flash { animation: panel-flash .7s ease; }
@keyframes panel-flash { 30% { box-shadow: 0 0 0 3px var(--gold); } }
/* Army, reports, Houses and Crown */
.army-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.label-caps { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.2px; }
.mission-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mission-chip { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; }
.mission-chip:hover { background: #eee3cd; }
.mission-chip.is-active { background: var(--garnet); border-color: var(--garnet); color: #fff8ed; }
.target-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 13px; margin-top: 18px; background: #f1ebdd; border: 1px solid var(--line); border-radius: 6px; }
.units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-card { display: flex; align-items: center; gap: 10px; padding: 17px 14px; }
.stepper { display: flex; gap: 4px; align-items: center; }
.step-btn { display: grid; place-items: center; width: 28px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: #f1ebdd; color: var(--ink); padding: 0; font-size: 16px; }
.step-btn:hover { background: #e4d5b8; }
.step-btn:disabled { opacity: .4; background: #f1ebdd; }
.step-count { font-size: 12px; font-weight: 600; width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.supply-pill { border-radius: 5px; padding: 3px 8px; font-size: 10px; }
.supply-note { font-size: 11px; color: var(--muted); background: #f1ebdd; border-radius: 6px; padding: 12px; line-height: 1.7; }
.march-btn { display: block; width: 100%; background: var(--garnet); color: #fff; border: 0; border-radius: 6px; font-size: 12px; font-weight: 600; padding: 13px; text-align: center; margin-top: 8px; }
.march-btn:hover { background: #a33729; }
.reports { display: flex; flex-direction: column; gap: 16px; }
.report { overflow: hidden; }
.report__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.report__title { display: flex; align-items: center; gap: 10px; color: #fff; font: 500 19px var(--serif); }
.pill-mini { padding: 4px 8px; border-radius: 5px; background: #0002; color: #fff; font-size: 9px; white-space: nowrap; }
.report__body { padding: 20px; font-size: 13px; line-height: 1.8; }
.report__lesson { padding: 14px 20px; border-top: 1px solid var(--line); color: var(--garnet); font-size: 11px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 24px; background: #fbf8ef80; border: 1px dashed #c9b995; border-radius: var(--radius); text-align: center; }
.empty-state__icon { padding: 16px; background: #e9dfca; border-radius: 50%; }
.empty-state h2 { font: 500 26px var(--serif); margin: 4px 0 0; }
.empty-state p { max-width: 360px; color: var(--muted); font-size: 12px; margin: 0 0 6px; line-height: 1.8; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.member:last-child { border-bottom: 0; }
.member > span { font-size: 9px; color: var(--muted); }
.live-form { display: grid; gap: 20px; }
.live-form label { display: grid; gap: 8px; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.live-form input, .live-form select { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid #cfc2a9; border-radius: 6px; background: #fffdf7; color: var(--ink); font-size: 14px; }
.live-form input:focus, .live-form select:focus { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.live-form button:disabled { opacity: .6; cursor: wait; }
.live-notice { margin: 0 auto 22px; max-width: 1390px; padding: 13px 18px; border: 1px solid #d5bc82; border-left: 3px solid var(--gold-deep); border-radius: 6px; background: #fff5d9; color: #624c2b; font-size: 12px; }
.profile-screen { max-width: 800px; }
.profile-welcome { position: relative; overflow: hidden; background: var(--wood-dark); color: var(--parchment); border-radius: var(--radius); padding: 35px; margin-bottom: 24px; }
.profile-welcome .eyebrow { color: var(--gold); }
.profile-welcome h2 { position: relative; z-index: 1; font: 400 34px/1.2 var(--serif); margin-bottom: 10px; }
.profile-welcome p { position: relative; z-index: 1; max-width: 340px; color: #cdbd9e; font-size: 12px; line-height: 1.8; margin: 0; }
.profile-welcome .estate-art { opacity: .4; }
.profile-form { padding: 28px; }
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 100dvh; color: var(--ink); }
.loading-state h1 { font: 28px var(--serif); margin: 0; }
.loading-state p { font-size: 12px; color: var(--muted); max-width: 350px; text-align: center; }
.flex { display: flex; }
.between { display: flex; justify-content: space-between; align-items: center; }
.gap9 { gap: 9px; }
.grow, .spacer { flex: 1; min-width: 0; }
.cinzel { font-family: var(--serif); }
/* Responsive navigation becomes a compact, persistent bottom bar. */
@media (min-width: 1700px) { .main { padding-top: 42px; } .estate-banner { min-height: 250px; } .estate-banner__copy { padding: 34px 38px; } .estate-banner h2 { font-size: 36px; } }
@media (max-width: 1390px) {
  .topbar { gap: 18px; padding-right: 22px; }
  .res-pills { gap: 12px; }
  .res-pill { gap: 6px; }
  .res-pill__rate { font-size: 9px; }
  .topbar__world { display: none; }
  .main { padding: 28px; }
  .buildings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estate-stats > div { padding: 0 16px; gap: 9px; }
  .estate-stats > div > span { font-size: 9px; }
}
@media (max-width: 1100px) {
  .rail { width: 180px; padding-left: 10px; padding-right: 10px; }
  .topbar__brand { width: 144px; font-size: 20px; }
  .topbar__brand > span > span { font-size: 14px; }
  .main { padding: 24px; }
  .estate-grid, .army-grid { grid-template-columns: minmax(0, 1fr); }
  .estate-grid > .side-col { padding-top: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .buildings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .estate-stats > div { padding: 0 12px; }
  .estate-stats > div > svg { display: none; }
  .estate-art { opacity: .65; }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-layout > .side-col { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .sel-panel { position: static; }
  .map-view { height: 60dvh; min-height: 360px; }
  .units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .res-pills { min-width: 320px; }
  .res-pill__rate { display: none; }
  .res-pill__badge { width: 30px; }
  .topbar__lord { width: 32px; padding-left: 0; border-left: 0; }
  .topbar__lord > span { display: none; }
  .buildings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estate-grid > .side-col { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .screen-head { align-items: flex-start; }
  .screen-head__extra .btn { font-size: 10px; padding: 9px; }
  .screen-head__extra .btn svg { display: none; }
  .estate-banner__copy { padding: 25px; }
  .estate-banner h2 { font-size: 28px; }
  .estate-banner p { max-width: 230px; }
}
@media (max-width: 720px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { position: sticky; top: 0; padding: 14px 18px 12px; gap: 14px; flex-wrap: wrap; min-height: 0; }
  .topbar__brand { width: auto; font-size: 20px; }
  .topbar__brand > span > span { display: inline; margin: 0 0 0 4px; font-size: 18px; letter-spacing: -.4px; }
  .topbar__brand > svg { width: 29px; height: 29px; }
  .topbar__lord { margin-left: auto; padding: 0; border: 0; width: 32px; }
  .topbar__lord > span { display: none; }
  .topbar > .spacer { display: none; }
  .res-pills { order: 3; min-width: 0; flex-basis: 100%; max-width: none; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .res-pill { gap: 7px; }
  .res-pill__badge { width: auto; height: auto; background: none; }
  .res-pill__badge svg { width: 20px; height: 20px; }
  .res-pill__label { font-size: 9px; }
  .res-pill strong { font-size: 15px; }
  .body { display: block; }
  .rail { position: fixed; inset: auto 0 0; width: 100%; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 10; border: 0; border-top: 1px solid #5b4730; }
  .rail__intro, .rail__label, .rail__footer { display: none; }
  .rail__nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 2px; border-radius: 6px; text-align: center; }
  .nav-item__icon svg { width: 21px; height: 21px; }
  .nav-item__label { font-size: 8px; white-space: nowrap; }
  .nav-item__badge { position: absolute; right: 5px; top: 2px; min-width: 14px; padding: 0 3px; font-size: 8px; }
  .main { overflow: visible; padding: 24px 18px calc(95px + env(safe-area-inset-bottom)); }
  .screen-head { margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
  .screen-head .eyebrow { font-size: 9px; }
  .screen-description { font-size: 11px; }
  .screen-head__extra { display: none; }
  .estate-banner { min-height: 215px; }
  .estate-banner__copy { padding: 24px; }
  .estate-banner h2 { font-size: 29px; }
  .estate-banner p { max-width: 210px; font-size: 10px; }
  .estate-art { width: 66%; right: -60px; opacity: .4; }
  .estate-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; margin-bottom: 25px; }
  .estate-stats > div { padding: 14px 18px; }
  .estate-stats > div:nth-child(2) { border-right: 0; }
  .estate-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .estate-stats > div > svg { display: block; width: 20px; height: 20px; }
  .estate-stats strong { font-size: 18px; }
  .estate-grid { gap: 22px; }
  .buildings { gap: 10px; }
  .card { padding: 14px 12px 12px; gap: 13px; }
  .building-card > .flex { flex-wrap: wrap; gap: 8px; }
  .building-card .icon-well { padding: 5px; }
  .building-card .icon-well svg { width: 20px; height: 20px; }
  .building-card .grow { flex-basis: calc(100% - 40px); }
  .card__title { font-size: 15px; }
  .card__desc { font-size: 10px; }
  .lvl-badge { margin-top: -3px; }
  .building-cost { gap: 6px; font-size: 9px; }
  .building-cost svg { width: 12px; height: 12px; }
  .upgrade-btn { font-size: 9px; padding: 7px 8px; min-height: 36px; }
  .units { grid-template-columns: 1fr; }
  .map-view { height: 55dvh; min-height: 330px; }
  .map-layout > .side-col { grid-template-columns: 1fr; }
  .profile-welcome { padding: 25px; }
  .profile-welcome h2 { font-size: 29px; }
  .profile-form { padding: 22px; }
  .target-row { gap: 8px; }
  .mission-chip { padding: 8px 11px; font-size: 10px; }
  .report__head { padding: 14px; }
  .report__title { font-size: 16px; }
}
@media (max-width: 360px) {
  .topbar__brand { font-size: 18px; gap: 5px; }
  .topbar__brand > span > span { font-size: 16px; }
  .res-pills { gap: 6px; }
  .res-pill { gap: 4px; }
  .res-pill__badge svg { width: 17px; height: 17px; }
  .main { padding-left: 12px; padding-right: 12px; }
  .estate-stats > div { padding: 12px; }
  .estate-stats > div > svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.auth-shell { width: min(480px, calc(100% - 32px)); margin: auto; padding: 44px 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #ecd9ae; font-size: 20px; font-weight: 800; margin-bottom: 24px; }
.auth-brand .tag-parchment { margin-left: auto; }
.auth-tabs { display: flex; gap: 10px; margin: 22px 0; }
.auth-tabs .btn { flex: 1; }
.auth-shell .subtitle { margin: 12px 0; }
.auth-shell .live-notice { margin: 14px 0; }
.auth-shell .live-form { margin-top: 20px; }
.auth-about { display: block; color: #ecd9ae; text-align: center; margin-top: 24px; }
.account-password { margin: 24px 0; }
.app:has(.auth-shell) { overflow: auto; }

/* Account screens share the same warm paper, heraldry and primary actions. */
.auth-shell { width: min(500px, calc(100% - 36px)); padding: 48px 0; }
.auth-brand { color: var(--ink); font: 600 24px var(--serif); letter-spacing: -.4px; }
.auth-brand .tag-parchment { font: 500 10px var(--sans); letter-spacing: .5px; }
.auth-shell > .panel { border-top: 3px solid var(--garnet); }
.auth-shell > .panel > .panel__body { padding: 30px; gap: 12px; }
.auth-shell .title { font-size: 31px; }
.auth-shell .subtitle { font-size: 12px; }
.auth-tabs { margin: 8px 0 0; padding: 4px; background: #ece5d6; border: 1px solid var(--line); border-radius: 7px; gap: 4px; }
.auth-tabs .btn { background: transparent; border: 0; color: var(--muted); font-size: 10px; }
.auth-tabs .btn--green { background: var(--surface); color: var(--garnet); box-shadow: 0 1px 5px #2b201610; }
.auth-shell .live-form { margin-top: 8px; }
.auth-shell .live-form > button { background: var(--garnet); }
.auth-about { color: var(--muted); font-size: 11px; }
.live-form input[readonly] { background: #eee8db; color: var(--muted); }
.building-progress { margin-top: auto; }
@media (max-width: 720px) {
  .auth-shell { padding: 30px 0; }
  .auth-brand { font-size: 21px; }
  .auth-shell > .panel > .panel__body { padding: 24px; }
  .auth-shell .title { font-size: 28px; }
}

.admin-tools{display:grid;gap:20px;margin:24px 0}.admin-tools select{width:100%;font:inherit;padding:10px}.admin-history{list-style:none;padding:0;margin:0}.admin-history li{padding:12px 0;border-bottom:1px solid #b6a681}.admin-history time{display:block;font-size:.85rem;opacity:.7}.admin-history p{margin:4px 0;overflow-wrap:anywhere}
