/* Waterloo 1815 — historical art direction. Pure presentation; no rules or map geometry changed. */
:root {
  --navy: #192d46;
  --navy-deep: #111f32;
  --navy-light: #2b4761;
  --oxblood: #8c292b;
  --oxblood-light: #ac4340;
  --brass: #b58b4a;
  --brass-bright: #ddb877;
  --paper: #eadfc6;
  --paper-light: #f7eedb;
  --paper-deep: #d5c5a5;
  --ink: #293445;
  --ink-soft: #625c50;
  --gold: var(--brass);
  --gold-light: #edd6a9;
  --pine: var(--navy);
  --deep: var(--navy-deep);
  --border: rgba(197, 162, 103, .25);
  --text: #eee7d8;
  --muted: #b5b4ad;
  --red: #ab4945;
  --blue: #5e809d;
  --green: #8b9887;
  --shadow: 0 20px 65px rgba(12, 21, 30, .40);
  color-scheme: light;
}

body { background: var(--navy-deep); font-family: "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
button, select, input { letter-spacing: .015em; }
button:focus-visible, select:focus-visible, input:focus-visible, #viewport:focus-visible { outline: 3px solid var(--brass-bright); outline-offset: 2px; }
::-webkit-scrollbar-track { background: rgba(31, 37, 43, .09); }
::-webkit-scrollbar-thumb { background: #907b5b; }
::selection { background: rgba(148, 51, 44, .28); }

/* Loading screen: a regimental seal on an imperial-blue field. */
.boot {
  background: radial-gradient(ellipse at center 43%, #344961 0, #182b43 58%, #0f1c2d 100%);
  gap: 25px;
}
.boot:before, .boot:after { content: ""; position: absolute; pointer-events: none; inset: 22px; border: 1px solid rgba(205, 174, 110, .33); }
.boot:after { inset: 30px; border-color: rgba(205, 174, 110, .12); }
.boot-mark { display: flex; flex-direction: column; gap: 12px; align-items: center; color: #f5e7cd; font-size: 36px; line-height: 1.1; text-shadow: 0 2px 10px #0005; }
.boot-mark img { width: 116px; height: 116px; filter: drop-shadow(0 5px 11px #0006); }
.boot-mark small { color: var(--brass-bright); font-weight: normal; }
.boot-line { background: #526175; width: 250px; }
.boot-line span { background: linear-gradient(90deg, var(--oxblood), var(--brass-bright)); }
.boot p { color: #d3c6a9; font-size: 13px; }

/* Campaign folio / title screen. */
.welcome {
  background:
    radial-gradient(ellipse at 13% 25%, rgba(255, 250, 229, .91) 0, transparent 42%),
    radial-gradient(ellipse at 87% 78%, rgba(176, 144, 96, .14), transparent 43%),
    repeating-linear-gradient(0deg, rgba(103, 81, 54, .022) 0, rgba(103, 81, 54, .022) 1px, transparent 1px, transparent 4px),
    #e9ddc4;
  color: var(--ink);
}
.welcome-top {
  max-width: none;
  height: 92px;
  padding: 0 max(5vw, calc((100vw - 1450px)/2));
  border-bottom: 4px double #ba9256;
  background: linear-gradient(110deg, #152840, #243c56 65%, #172940);
  color: #f4e4c2;
  box-shadow: 0 3px 16px #4a39262a;
  margin: 0;
}
.wordmark { gap: 14px; letter-spacing: 3px; }
.wordmark>span { display: flex; flex-direction: column; gap: 1px; }
.wordmark strong { font: 700 26px/.95 Georgia, "Times New Roman", serif; letter-spacing: 3px; }
.wordmark small { color: #d4b77c; font: 11px Georgia, serif; letter-spacing: 3px; margin-top: 6px; }
.brand-medallion { width: 64px; height: 64px; display: block; filter: drop-shadow(0 3px 6px #0008); }
.release-tag { color: #d4c29e; font: 11px Georgia, serif; letter-spacing: 3px; text-align: right; }
.welcome-layout { grid-template-columns: minmax(385px, .9fr) minmax(440px, 1.1fr); gap: min(5vw, 86px); min-height: calc(100vh - 152px); padding: 36px 5%; }
.welcome-copy { max-width: 600px; position: relative; z-index: 1; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  padding: 9px 0;
  border-top: 1px solid #b9a37a;
  border-bottom: 1px solid #b9a37a;
  color: #743c34;
  font: 11px Georgia, serif;
  letter-spacing: 2.2px;
}
.kicker-ornament { color: #b48a49; font-size: 15px; }
.eyebrow { color: #775f42; margin-top: 31px; font-size: 12px; letter-spacing: 2.3px; }
.eyebrow-line { background: #987a52; }
.welcome-copy h1 {
  position: relative;
  font-family: Georgia, "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: clamp(66px, 7.4vw, 109px);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: 8px;
  margin: 21px 0 12px;
  color: #1a2e49;
  text-shadow: 1px 1px 0 #fff7e7, 2px 3px 0 #b8a3843b;
}
.welcome-copy h1 em { color: var(--oxblood); }
.latin { color: #8e6d3d; font-size: 15px; letter-spacing: 3.4px; margin: 0 0 24px; }
.intro { font-size: 16px; line-height: 2.05; color: #4f4b44; margin: 0 0 27px; max-width: 510px; }
.welcome-buttons { gap: 13px; }
.btn { border-radius: 2px; font-weight: 650; }
.btn.big { min-height: 54px; font-size: 15px; padding: 12px 26px; }
.btn-gold {
  background: linear-gradient(160deg, #9d3635, #7c2028);
  color: #fff1d8;
  border: 1px solid #6c2525;
  box-shadow: inset 0 1px #cb7770, 0 3px 0 #5e1d21, 0 8px 17px #4e22231f;
}
.btn-gold:hover { background: linear-gradient(160deg, #b34740, #912a30); border-color: #8b292b; }
.btn-outline { color: #233953; border: 1px solid #9b8663; background: rgba(255, 253, 241, .25); }
.btn-outline:hover { background: #e4d3b3; border-color: #80602f; }
.intro-footer { margin-top: 35px; padding-top: 15px; border-top: 1px solid #b8a88a; color: #6e6455; font-size: 11px; gap: 18px; }
.intro-footer span:before { content: "◆"; color: #a6854c; font-size: 6px; padding-right: 7px; vertical-align: 2px; }
.welcome-visual { max-width: 710px; transform: rotate(-2deg); filter: drop-shadow(8px 18px 29px #4d3f2d59); }
.welcome-visual:before { inset: -12px; border: 1px solid #a18b67; background: #ddcfb1; transform: rotate(1deg); z-index: -1; box-shadow: 0 0 0 3px #f3e8ce; }
.map-document-label { background: #e5d3b4; padding: 12px 13px 9px; color: #6b5235; font: 11px Georgia, serif; letter-spacing: 2.5px; border-bottom: 1px solid #9b8967; }
.map-preview { aspect-ratio: 1.2; border: 7px solid #e2d0ae; border-top: 0; border-bottom: 0; box-shadow: inset 0 0 0 2px #8c6c43, 0 0 0 1px #8c7453; }
.map-preview>img { transform: scale(1.12); filter: sepia(.16) saturate(.8) contrast(1.05); }
.map-shadow { background: linear-gradient(154deg, rgba(48, 34, 22, .15), transparent 44%, rgba(38, 29, 17, .44)); }
.map-inscription { left: 5.5%; bottom: 6%; color: #fff1cf; font-size: clamp(27px, 3vw, 42px); line-height: 1.12; text-shadow: 0 2px 5px #2b251a, 1px 1px #2b251a; }
.map-inscription span { font-size: 10px; }
.map-wax-seal { position: absolute; right: 2%; bottom: 3%; width: 104px; height: 104px; transform: rotate(10deg); filter: drop-shadow(2px 5px 6px #0006); }
.map-wax-seal img { display: block; width: 100%; height: 100%; }
.picture-caption { margin: 0; padding: 11px 13px 9px; font-size: 10px; color: #655134; background: #e5d3b4; border-top: 1px solid #9b8967; letter-spacing: 1.8px; }
.welcome-footer { max-width: none; min-height: 60px; padding: 10px 5%; margin: auto 0 0; background: #1a2d45; border-top: 3px double #ac8652; color: #d2c29e; font: 10px Georgia, serif; letter-spacing: 1.8px; }

/* Wargame command room: imperial-blue command bars, parchment staff sheet. */
.game-shell { background: #cfc1a5; }
.game-topbar { height: 76px; background: linear-gradient(105deg, #14263e, #233d59 65%, #14243a); border-bottom: 4px double #ba9052; padding: 0 21px; box-shadow: 0 4px 15px #1e243345; }
.game-brand { gap: 10px; min-width: 215px; }
.game-medallion { width: 55px; height: 55px; filter: drop-shadow(0 2px 5px #070b13a0); }
.game-brand strong { color: #f2dfb8; font-size: 17px; letter-spacing: 1.3px; }
.game-brand small { color: #d2ae76; font-size: 9px; letter-spacing: 1.9px; }
.game-summary { color: #e2d9c7; }
.top-pill { border: 1px solid #b38d52; background: #81532e4a; color: #f3d9a6; }
.game-top-actions { gap: 5px; }
.game-top-actions button { color: #f0e8d8; border: 1px solid #c2a16b42; border-radius: 2px; background: #ebdecb12; padding: 8px 11px; font-size: 12px; }
.game-top-actions button:hover { background: #a07d4d4d; color: #ffefd3; border-color: #c09d61; }
.game-body { grid-template-columns: 243px minmax(0, 1fr) 326px; }
.sidebar-left {
  border-right: 2px solid #9e8761;
  background: radial-gradient(ellipse at top left, #f6ecd9, #e8dcc3 54%, #d9c7a7);
  color: #273449;
  padding: 22px 16px;
}
.sidebar-left .sidebar-label { color: #795b35; font-size: 10px; }
.sidebar-left .sidebar-label span { color: #233e5a; font: 700 14px "Segoe UI",sans-serif; margin-top: 4px; }
.round-card { background: linear-gradient(135deg, #203955, #14253c); border: 1px solid #b58b51; box-shadow: inset 0 0 0 4px #d9bf8124, 0 7px 11px #2a30242d; margin: 18px 0 27px; }
.sidebar-left .round-card, .sidebar-left .sidebar-block { flex-shrink: 0; }
.round-card:before { content: ""; position: absolute; inset: 6px; border: 1px solid #ba9b6155; pointer-events: none; }
.round-card:after { color: #e5c58912; }
.round-eyebrow { color: #dfcda8; }
.round-main { color: #fff0c8; }
.round-phase { color: #f7e5be; }
.round-progress { background: #5f6472; }
.round-progress span { background: #c03d42; }
.sidebar-left .sidebar-block h3 { color: #26364b; font-size: 13px; border-bottom: 1px solid #bea989; padding-bottom: 9px; margin-bottom: 9px; }
.sidebar-left .sidebar-block h3 span { color: #887452; font-size: 8px; letter-spacing: .8px; }
.phase-item { border-bottom: 1px solid #a9977736; color: #645f57; font-size: 12px; padding: 9px 8px 9px 10px; }
.phase-item .p-index { color: #877454; }
.phase-item.current { color: #852a30; background: #8d2d3015; border-left: 3px solid #943035; }
.phase-item.past { color: #354457; }
.phase-item.past .p-index { color: #98733f; }
.frontline-line { color: #464b4b; }
.frontline-line .value { color: #293c55; font-size: 13px; font-weight: 700; }
.frontline-line .value.red { color: #982e36; }
.frontline-line .value.blue { color: #315a83; }
.tiny-meter { background: #c6b99e; }
.meta-note { color: #685d4b; font-size: 11px; }
.sidebar-stamp { border-top: 1px solid #9f855d5e; color: #a78e626b; letter-spacing: 4px; }

/* Map remains the original battle map; only the surrounding frame changes. */
.board-panel { background: #b4a481; border-left: 1px solid #766347; border-right: 1px solid #766347; }
.board-toolbar { height: 51px; background: linear-gradient(180deg, #eadcbe, #d5c09a); border-bottom: 2px solid #a78a59; padding: 0 13px; }
.board-section { color: #7f4f2c; font-size: 11px; letter-spacing: 1.4px; }
.toolbar-hint { color: #635849; font-size: 11px; }
.map-controls { gap: 3px; }
.map-controls button { color: #2b3a51; border: 1px solid #a990664f; background: #faf0d153; border-radius: 1px; }
.map-controls button:hover, .map-controls button.on { color: #7c212a; background: #e1c59e; border-color: #9a6d45; }
.toolbar-rule { border-color: #9e8967; }
.viewport { background: #c1b28f; box-shadow: inset 0 0 22px #30291e47; }
.map-legend { background: #182b43ed; border: 1px solid #bc9456; border-radius: 1px; box-shadow: inset 0 0 0 3px #b99b5d20, 2px 4px 14px #0004; }
.legend-title { color: #eed3a0; }
.map-coordinates { background: #1a2f47e8; border: 1px solid #be995a; color: #f2e1c1; }
.map-guidance { background: #182c43bd; padding: 3px 7px; color: #fff0d1; font-size: 11px; }
.board-bottom { background: #e5d3b0; color: #374254; border-top: 2px solid #ac8b59; font-size: 12px; }
#map-scale { color: #7b4e36; }
.counter.is-active { box-shadow: 0 0 0 4px #e5bb65, 0 0 0 5px #694627, 0 0 12px #e3a92e; }
.counter.is-selected { box-shadow: 0 0 0 3px #fff0a4, 0 0 0 5px #9f2930, 0 0 12px #9f2930; }
.counter .pile-count { background: #1c3652; }

/* Orders column evokes a blue cloth command ledger with red wax seals. */
.sidebar-right { border-left: 2px solid #b28c51; background: linear-gradient(135deg, #1c304a, #17263c 72%); }
.sidebar-right .sidebar-label { color: #deb875; }
.sidebar-right .sidebar-label span { color: #efe1c5; font-size: 14px; }
.right-header { height: 74px; border-bottom: 1px solid #ae92614a; }
.actor-badge { border-radius: 2px; background: #274960; color: #f7eee0; border-color: #7798ad; }
.actor-badge.french { background: #762e35; border-color: #bb7771; }
.right-tabs { height: 43px; background: #0f1e31a1; padding: 0 6px; border-bottom: 1px solid #b59b6f67; }
.right-tabs .tab { color: #c6c4bb; font-size: 12px; padding: 0 13px; }
.right-tabs .tab.active { color: #f8dfa8; border-color: #c34b45; background: #b18c4b15; }
.right-scroll>h3 { color: #f8e9cb; }
.step-description { color: #c9c8c0; font-size: 12px; }
.action-heading { color: #deb979; }
.action-btn { background: #324f6a; border: 1px solid #6d8291; color: #f1eee2; border-radius: 2px; font-size: 12px; min-height: 40px; }
.action-btn:hover { background: #436680; border-color: #c0a269; }
.action-btn.primary { background: linear-gradient(150deg, #a33a3c, #78272e); border-color: #c17666; color: #fff2da; box-shadow: inset 0 1px #d38471; }
.action-btn.primary:hover { background: #b04945; }
.action-btn.ghost { background: #f6dfb90d; border-color: #7b8191; color: #e4dfd3; }
.action-btn.ghost:hover { background: #3d5470; }
.action-btn.danger { background: #612f37; border-color: #a65a55; }
.unit-row { border-color: #64778b; background: #28445e; color: #f4ecde; border-radius: 2px; }
.unit-row:hover { border-color: #be9f67; background: #365877; }
.unit-row.active { border-color: #d9bb81; background: #3f4d63; }
.unit-row small { color: #c5c2b3; }
.unit-row .side-chip { color: #edc98b; }
.note { color: #c5c3b7; }
.action-alert { background: #5e654a45; border-left-color: #caa360; color: #efe4c8; }
.chip { border-color: #637e92; background: #344d68; color: #e9e8e0; border-radius: 1px; }
.chip.checked { background: #85473c; border-color: #d1a26c; color: #ffebc4; }
.line-item { color: #c4c6c3; }
.line-item strong { color: #f9e9c4; }
.inspector { background: #0d1a2d; border-top: 2px solid #b48c51; }
.inspector-placeholder { color: #b3b5ba; }
.inspector-placeholder span { color: #b99664; }
.inspector-placeholder strong { color: #ece1cf; }
.inspector-title { color: #f8e8ca; }
.inspector-sub { color: #bdc1c4; }
.inspector-stats>div { color: #c4bca7; }
.inspector-stats strong { color: #f8deb0; }
.log-entry { color: #d7d4c8; }
.reserve-heading { color: #f3d49b; }
.empty-label { color: #bbb9ad; }
.plan-group { background: #2b4561; border-color: #68809a; }
.plan-group.selected { border-color: #d5b77f; }
.plan-title { color: #f5d9a2; }
.plan-members { color: #d0d2ca; }
.plan-member { background: #405e7d; border-color: #6c8196; color: #fff2dc; }
.plan-member:hover { background: #86533f; }
.plan-member.defend { background: #673b42; border-color: #a76d6a; }
.game-footer { background: #112139; border-top: 1px solid #b18c55; color: #e1d7bf; }
.footer-fingerprint { color: #adb0b2; }

/* Dispatch papers for new game, help, import and hand-off. */
.modal-backdrop, .handoff-backdrop { background: #101a2ad9; }
.modal-card, .handoff-card {
  background:
    repeating-linear-gradient(0deg, #7b60330a 0, #7b60330a 1px, transparent 1px, transparent 5px),
    linear-gradient(138deg, #fff3d9, #eadcc1 83%);
  color: #28364b;
  border: 2px solid #92724c;
  box-shadow: inset 0 0 0 6px #ecdabf, inset 0 0 0 7px #9c7f51, 0 22px 70px #0008;
}
.modal-card { padding: 32px; }
.modal-card:before { inset: 12px; border: 1px solid #bca17c7d; }
.modal-eyebrow { color: #9a4334; }
.modal-card h2 { color: #1e3651; }
.modal-card p { color: #514e46; }
.modal-card label { color: #393c3c; font-size: 13px; }
.modal-card select, .modal-card input { background: #fff9e9; border: 1px solid #a48c65; color: #253c56; border-radius: 2px; font-size: 14px; }
.modal-card .btn-outline { color: #283950; }
.modal-note { color: #6a6252; }
.handoff-card { max-width: 550px; }
.handoff-medallion { display: block; width: 112px; height: 112px; margin: 0 auto 17px; filter: drop-shadow(0 4px 5px #46351a50); }
.handoff-card p:first-of-type { color: #8f6043; }
.handoff-card h2 { color: #1f3755; }
.handoff-detail { color: #555044; }

@media (max-width: 1200px) {
  .game-body { grid-template-columns: 194px minmax(0, 1fr) 291px; }
  .game-brand { min-width: 176px; }
  .game-medallion { width: 46px; height: 46px; }
  .welcome-layout { gap: 26px; }
  .welcome-copy h1 { font-size: clamp(61px, 7vw, 88px); }
}
@media (max-width: 950px) {
  .game-body { grid-template-columns: 0 minmax(0, 1fr) 285px; }
  .welcome-layout { grid-template-columns: 1fr 1fr; }
  .welcome-copy h1 { font-size: 64px; }
  .intro { font-size: 14px; line-height: 1.85; }
}
@media (max-width: 700px) {
  .welcome-top { height: 69px; padding: 0 5%; }
  .brand-medallion { width: 47px; height: 47px; }
  .wordmark strong { font-size: 19px; }
  .wordmark small { font-size: 8px; }
  .welcome-layout { display: flex; flex-direction: column-reverse; min-height: 0; gap: 22px; padding: 22px 6% 35px; }
  .welcome-visual { transform: none; }
  .welcome-visual:before { inset: -6px; }
  .map-document-label { font-size: 9px; padding: 8px 9px; }
  .map-preview { aspect-ratio: 2.15; border-width: 4px; }
  .map-preview>img { transform: scale(1.09); }
  .map-wax-seal { width: 65px; height: 65px; right: 2%; bottom: 0; }
  .map-inscription { font-size: 21px; }
  .map-inscription span { font-size: 7px; letter-spacing: 1px; }
  .hero-kicker { font-size: 9px; margin-top: 1px; }
  .eyebrow { margin-top: 16px; font-size: 10px; }
  .welcome-copy h1 { font-size: clamp(48px, 11.2vw, 70px); margin: 12px 0; }
  .welcome-copy h1 br { display: none; }
  .welcome-copy h1 em:before { content: " "; }
  .latin { font-size: 11px; margin-bottom: 16px; }
  .intro { font-size: 13px; line-height: 1.8; margin-bottom: 17px; }
  .btn.big { min-height: 47px; font-size: 13px; }
  .intro-footer { margin-top: 23px; gap: 9px; font-size: 10px; }
  .welcome-footer { font-size: 9px; min-height: 48px; }
  .game-topbar { height: 58px; padding: 0 6px; border-bottom-width: 2px; justify-content: flex-start; gap: 6px; }
  .game-brand { gap: 5px; flex: none; min-width: 0; width: 132px; }
  .game-medallion { width: 36px; height: 36px; }
  .game-brand strong { font-size: 12px; letter-spacing: .2px; }
  .game-brand small { font-size: 7px; letter-spacing: .5px; }
  .game-top-actions { flex: 1; min-width: 0; justify-content: space-between; gap: 1px; }
  .game-top-actions button { font-size: 9px; padding: 6px 4px; }
  .board-panel { height: 54%; min-height: 260px; }
  .sidebar-right { height: 46%; }
  .board-toolbar { height: 36px; }
  .board-section { display: none; }
  .map-controls { gap: 2px; }
  .map-controls button { padding: 4px 5px; }
  .board-bottom { height: 30px; }
  .right-tabs { height: 36px; }
  .right-tabs .tab { padding: 0 10px; }
  .modal-card { padding: 27px 22px; }
  .modal-card h2 { font-size: 26px; }
  .handoff-medallion { width: 83px; height: 83px; }
}
