/* Carved bronze, embossed leather and inset enamel surfaces. */
.retreat-timing { margin-top:8px; padding:9px 14px; gap:10px 20px; align-items:center; flex-wrap:wrap; color:#e6cca0; background:#251d24; border:1px solid #977343; font-size:13px; }
.retreat-timing:not([hidden]) { display:flex; }
.retreat-timing label { display:flex; align-items:center; gap:8px; }
.retreat-timing input { width:64px; padding:5px; color:#f2d491; background:#161a22; border:1px solid #9a794b; font:inherit; }
.retreat-timing > span { color:#bfad8f; font-size:11px; }
#order-cards[data-group="retreat"] strong { display:block; line-height:1.45; }
.order-card .card-variant { display:block; font-size:14px; color:#d4bc90; letter-spacing:2px; }
@media (max-width:700px) { .retreat-timing { padding:6px 9px; gap:4px; font-size:12px; } .order-card .card-variant { font-size:12px; } }
:root {
  --accent: #f0cf81;
  --muted: #b9aa8c;
  --line: #b6955159;
  --blue: #91c5de;
  --red: #e5a081;
  --panel: #261e26;
  --sidebar: 254px;
  --leather: url("/art/frame/leather-tile.png");
  color: #f0e1be;
  background: #151211;
}
body {
  background:
    radial-gradient(ellipse at 50% 0, #49352b80, transparent 75%),
    repeating-linear-gradient(135deg, #ffffff03 0 1px, transparent 1px 5px),
    #171415;
}
.app {
  padding: 10px 14px 12px;
  background: none;
}
.topbar,
.army-dock,
.scoreboard,
.field-toolbar,
.board-shell,
.timing-panel,
.dock-heading,
.pause-curtain,
dialog,
.toast,
.order-card {
  border: 12px solid transparent;
  --frame-width: 12px;
  --frame-corner: calc(var(--frame-width) * 1.5);
  --frame-band: calc(var(--frame-corner) * 0.47368421);
  --frame-tile: calc(var(--frame-corner) * 1.15789474);
  --frame-surface:
    url("/art/frame/top-left.png") left top / var(--frame-corner)
      var(--frame-corner) no-repeat,
    url("/art/frame/top-right.png") right top / var(--frame-corner)
      var(--frame-corner) no-repeat,
    url("/art/frame/bottom-left.png") left bottom / var(--frame-corner)
      var(--frame-corner) no-repeat,
    url("/art/frame/bottom-right.png") right bottom / var(--frame-corner)
      var(--frame-corner) no-repeat,
    url("/art/frame/top.png") left top / var(--frame-tile) var(--frame-band)
      repeat-x,
    url("/art/frame/bottom.png") left bottom / var(--frame-tile)
      var(--frame-band) repeat-x,
    url("/art/frame/left.png") left top / var(--frame-band) var(--frame-tile)
      repeat-y,
    url("/art/frame/right.png") right top / var(--frame-band) var(--frame-tile)
      repeat-y,
    var(--leather) center / 256px 256px repeat;
  border-image: none;
  border-radius: 0;
  background: var(--frame-surface);
  background-origin: border-box;
  box-shadow:
    0 3px 9px #000a,
    inset 0 0 20px #0005;
}
.topbar {
  height: 72px;
  padding: 0 15px;
  gap: 28px;
}
.brand {
  gap: 10px;
  filter: drop-shadow(0 2px 1px #000);
}
.brand > svg {
  stroke: #ebc87e;
  fill: #432f21;
}
.brand strong {
  color: #f0d492;
  text-shadow:
    0 2px #3b1d14,
    0 -1px #ffffb43b;
}
.brand span {
  color: #bfa575;
  font-size: 9px;
}
.scenario h1 {
  font-family: Georgia, "SimSun", serif;
  font-weight: 700;
  color: #e9d5ad;
}
.scenario i {
  width: 7px;
  height: 7px;
  background: #ad3f3b;
  border: 1px solid #d3a363;
  box-shadow: 0 0 0 2px #241412;
}
.scenario > span {
  color: #af9774;
}
.game-layout {
  padding-top: 10px;
  gap: 10px;
}
.scoreboard {
  height: 66px;
  padding: 3px 8px 0;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.army-score {
  min-width: 168px;
  gap: 7px;
  padding-bottom: 7px;
  text-shadow: 0 2px #000;
}
.army-score strong {
  font-family: Georgia, serif;
  font-size: 29px;
  color: #d6eaf4;
}
.army-score.enemy strong {
  color: #f0baa1;
}
.team-mark {
  font-weight: 700;
}
.army-total,
.squad-total {
  color: #b4a48c;
}
.strength {
  height: 4px;
  background: #0d0c0d;
  border: 1px solid #80623a;
  bottom: -1px;
}
.strength i {
  background: linear-gradient(#a1d8f6, #467899);
}
.enemy .strength i {
  background: linear-gradient(#e8ad8c, #a44935);
}
.clock {
  gap: 0;
  text-shadow: 0 2px #000;
}
.clock span {
  color: #c9ad77;
  font-size: 11px;
}
.clock b {
  font-family: Georgia, serif;
  color: #f4ddb0;
  font-size: 22px;
}
.board-shell {
  border-width: 14px;
  --frame-width: 14px;
  isolation: isolate;
}
.board-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow:
    inset 0 0 2px 1px #0e0b08,
    inset 0 0 20px #17130777;
}
.field-toolbar {
  height: 65px;
  margin-top: 8px;
  padding: 0 4px;
  gap: 6px;
}
.field-toolbar > span {
  color: #b5a486;
  font-size: 11px;
}
.field-actions {
  gap: 5px;
}
button,
.icon-button,
input {
  border-radius: 1px;
  border-color: #a58750 #473123 #37271f #9c7b48;
  background:
    linear-gradient(#574352d9, #302332dc 55%, #211823ed),
    var(--leather) center / 256px 256px;
  box-shadow:
    inset 1px 1px #d4b77b4d,
    inset -1px -1px #09080baa,
    0 2px 3px #0005;
  text-shadow: 0 1px 2px #000;
}
button:hover:not(:disabled) {
  background:
    linear-gradient(#76546bd9, #4b324ae3 55%, #352137ed),
    var(--leather) center / 256px 256px;
  border-color: #e2c287 #80613d #684929 #c49b56;
}
button:active:not(:disabled) {
  box-shadow: inset 1px 2px 5px #000a;
}
button:disabled {
  opacity: 0.48;
  filter: saturate(0.4);
}
.primary-button {
  background: linear-gradient(#538d9a, #245263 48%, #152d44) !important;
  border-color: #e4c687 #765336 #493125 #c49f64 !important;
  color: #f6e2b8 !important;
  box-shadow:
    inset 0 1px #b9eff575,
    inset 0 -2px #0a1b2c,
    0 2px 5px #0007;
}
.primary-button:hover:not(:disabled) {
  background: linear-gradient(#70a4ac, #346f80 48%, #234359) !important;
}
#start {
  min-width: 148px;
  font-family: Georgia, "SimSun", serif;
  font-size: 17px;
  letter-spacing: 1px;
}
.icon-button,
.top-actions .icon-button {
  color: #e1c184;
}
.view-controls {
  z-index: 3;
  padding: 4px;
  background: #221b22f5;
  border: 2px solid #9d7c43;
  outline: 1px solid #241911;
  border-radius: 0;
  box-shadow:
    inset 0 0 0 1px #c9a56770,
    0 3px 8px #0008;
}
.view-controls button {
  border: 1px solid #765d3b;
  border-radius: 0;
  color: #e8d0a0;
}
.view-controls #pan-toggle[aria-pressed="true"] {
  background: #234d66;
  color: #f4deac;
}
.army-dock {
  padding: 5px 5px 6px;
}
.roster-label {
  padding: 3px 3px 12px;
  font-family: Georgia, "SimSun", serif;
  color: #ead29b;
  font-weight: 700;
}
.roster-label b {
  background: #161014;
  box-shadow: inset 0 2px 3px #000a;
  color: #ddbf80;
}
.roster {
  gap: 4px;
  padding: 0 2px 3px;
  scrollbar-color: #ae8d51 #1b141b;
}
.squad-card {
  padding: 4px 6px;
  gap: 9px;
  background:
    linear-gradient(105deg, #4c4b55cc, #292634dd),
    var(--leather) center / 256px 256px;
  border: 1px solid;
  border-color: #8b795f #332725 #241a1b #807056;
  border-radius: 0;
  box-shadow:
    inset 0 1px #cabd9440,
    inset 0 -1px #0007;
}
.squad-card:hover:not(:disabled) {
  background:
    linear-gradient(100deg, #66586bcc, #352b3cdd),
    var(--leather) center / 256px 256px;
}
.squad-card[aria-pressed="true"] {
  background:
    linear-gradient(105deg, #375d80df, #182b44e8),
    var(--leather) center / 256px 256px;
  border-color: #e5c17a;
  box-shadow:
    inset 0 0 0 1px #17263a,
    inset 3px 0 #e5c078,
    0 0 5px #dfbd5b25;
}
.squad-symbol {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  background: radial-gradient(circle at 40% 28%, #687683, #24313f 65%, #101820);
  border: 1px solid #b59761;
  box-shadow:
    inset 0 0 0 1px #1b1613,
    0 1px 3px #0008;
}
.squad-symbol :is(svg,img.unit-illustration) {
  width: 30px;
  height: 30px;
}
.squad-copy strong {
  color: #ecdabc;
  font-weight: 600;
  font-size: 13px;
}
.squad-order {
  color: #b0a18f;
  font-size: 10px;
}
.squad-count b {
  color: #efdba9;
  font-family: Georgia, serif;
  font-size: 17px;
}
.sidebar-command {
  border-top: 1px solid #b9965866;
  box-shadow: 0 -1px #09080ca8;
  margin-top: 11px;
  padding: 11px 2px 0;
}
.sidebar-selection strong {
  font-family: Georgia, "SimSun", serif;
  color: #ead3a2;
}
.sidebar-command p {
  color: #bda988;
}
#orders-open {
  height: 43px;
  font-family: Georgia, "SimSun", serif;
}
#pursuit-toggle {
  background: linear-gradient(#382937, #241b28);
  color: #d8c19a;
  border-color: #8d7046;
}
#pursuit-toggle[aria-pressed="true"] {
  background: linear-gradient(#7c4239, #45282b);
  border-color: #d4a569;
}
#avoid-melee-toggle { background:linear-gradient(#382937,#241b28); color:#d8c19a; border-color:#8d7046; }
#avoid-melee-toggle[aria-pressed="true"] { background:linear-gradient(#3c503d,#24352a); border-color:#a0ac78; }
#weapon-summary { height:auto; margin:7px 0 0; font-size:11px; line-height:1.5; white-space:normal; }
#morale-summary,
.battle-order {
  color: #d5c09a;
}
.cards-backdrop,
.cards-backdrop:hover:not(:disabled) {
  box-shadow: none;
  background: linear-gradient(#0c090c28, #110c16bf 35%, #100d14f7 90%);
}
.dock-heading {
  height: 61px;
  padding: 0 9px;
  gap: 20px;
}
.selection-label strong,
.card-navigation {
  color: #ecd39f;
  font-family: Georgia, "SimSun", serif;
}
.card-navigation button {
  padding: 3px 8px;
  border: 1px solid #8a6d41;
}
.close-cards {
  padding: 4px 9px;
  border: 1px solid #8c6e43;
  color: #efd9a9;
}
.timing-panel {
  margin-top: 8px;
  padding: 6px 10px;
}
.timing-panel.has-delay {
  background: var(--frame-surface);
  background-origin: border-box;
  border-color: transparent;
  filter: brightness(1.1);
}
.timing-title strong {
  color: #edd7ac;
}
.delay-control input {
  background: #161a22;
  color: #f2d491;
  border: 2px solid #9a794b;
  border-radius: 0;
  box-shadow: inset 1px 2px 4px #000b;
}
.delay-presets button {
  border-radius: 0;
}
.delay-presets button[aria-pressed="true"] {
  background: linear-gradient(#557887, #264153);
  color: #fff0cc;
  border-color: #e4c689;
}
.order-card,
.order-card:hover:not(:disabled),
.order-card[aria-pressed="true"] {
  border: 15px solid transparent;
  --frame-width: 15px;
  border-radius: 0;
  background: var(--frame-surface);
  background-origin: border-box;
  color: #edce87;
  padding: 17px 5px 15px;
  gap: 15px;
  box-shadow:
    0 8px 16px #000a,
    0 0 0 1px #160e12;
}
.order-card:before {
  inset: 0;
  border: 1px solid #aa814e55;
  border-radius: 0;
  background: radial-gradient(ellipse at 50% 26%, #9659934a, transparent 72%);
  z-index: 0;
}
.order-card:after {
  content: "";
  top: -5px;
  width: 9px;
  height: 9px;
  border: 1px solid #a7854d;
  background: linear-gradient(135deg, #b88eb5, #582f59 48%, #20142d);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 1px 3px #000b;
}
.order-card[aria-pressed="true"]:after {
  content: "";
  background: linear-gradient(135deg, #d0f7ff, #4d9da6 48%, #153f56);
}
.order-card[data-group="attack"]:before {
  background: radial-gradient(ellipse at 50% 24%, #963b374d, transparent 72%);
}
.order-card[data-group="defend"]:before {
  background: radial-gradient(ellipse at 50% 24%, #437c9b4d, transparent 72%);
}
.order-card[data-group="guard"]:before {
  background: radial-gradient(ellipse at 50% 24%, #5685564d, transparent 72%);
}
.order-card strong,
#order-cards strong {
  color: #f4dda9;
  text-shadow: 0 2px #140d0c;
}
.order-card small {
  color: #beab8c;
}
.order-card svg {
  width: 78px;
  height: 78px;
  filter: drop-shadow(0 3px 2px #000b);
}
.order-card:hover:not(:disabled) {
  filter: brightness(1.22);
}
.order-card[aria-pressed="true"] {
  box-shadow:
    0 0 0 1px #ddbb75,
    0 8px 22px #000a,
    0 0 15px #e6bc5530;
}
.pause-curtain {
  padding: 12px 16px;
}
.pause-curtain > span {
  font-family: Georgia, "SimSun", serif;
  color: #edd6a5;
}
.pause-curtain button {
  padding: 8px 12px;
  border: 1px solid #a18453;
}
dialog {
  padding: 20px;
}
.dialog-heading h2,
#result-title,
.unit-intel h3 {
  font-family: Georgia, "SimSun", serif;
  color: #efd598;
  text-shadow: 0 2px #000;
}
.toast {
  padding: 5px 12px;
}
@media (max-width: 1000px) and (min-width: 701px) {
  :root {
    --sidebar: 214px;
  }
  .squad-symbol {
    width: 29px;
    height: 29px;
  }
  .squad-symbol :is(svg,img.unit-illustration) {
    width: 26px;
    height: 26px;
  }
  .squad-card {
    gap: 6px;
  }
  .field-toolbar > span {
    display: none;
  }
  .field-actions {
    margin-left: auto;
  }
}
@media (max-width: 700px) {
  :root {
    --sidebar: 132px;
  }
  .app {
    padding: 5px 5px 7px;
  }
  .topbar,
  .army-dock,
  .scoreboard,
  .field-toolbar,
  .board-shell,
  .timing-panel,
  .dock-heading,
  .pause-curtain,
  dialog,
  .toast {
    border-width: 7px;
    --frame-width: 7px;
  }
  .topbar {
    height: 59px;
    padding: 0 3px;
    gap: 7px;
  }
  .brand {
    gap: 4px;
  }
  .brand strong {
    font-size: 21px;
    letter-spacing: 2px;
  }
  .brand > svg {
    width: 22px;
    height: 27px;
  }
  .scenario {
    gap: 4px;
  }
  .scenario i {
    width: 4px;
    height: 4px;
  }
  .scenario h1 {
    font-size: 10px;
  }
  .top-actions {
    gap: 3px;
  }
  .top-actions .icon-button {
    width: 27px;
    height: 29px;
  }
  .game-layout {
    gap: 5px;
    padding-top: 6px;
  }
  .scoreboard {
    height: 61px;
    padding: 2px 2px 0;
    margin-bottom: 5px;
    gap: 3px;
    align-items: flex-start;
  }
  .army-score {
    min-width: 0;
    gap: 2px;
    padding-bottom: 6px;
  }
  .army-score strong {
    font-size: 19px;
  }
  .team-mark {
    font-size: 10px;
  }
  .clock b {
    font-size: 15px;
  }
  .clock span {
    font-size: 9px;
  }
  .army-dock {
    padding: 3px;
  }
  .roster-label {
    font-size: 12px;
    padding: 3px 1px 8px;
    letter-spacing: 0;
  }
  .roster {
    padding: 0;
    gap: 4px;
  }
  .squad-card {
    padding: 3px;
    gap: 4px;
    min-height: 40px;
  }
  .squad-symbol {
    width: 23px;
    height: 26px;
  }
  .squad-symbol :is(svg,img.unit-illustration) {
    width: 21px;
    height: 23px;
  }
  .squad-copy strong {
    font-size: 11px;
  }
  .squad-count b {
    font-size: 13px;
  }
  .sidebar-command {
    margin-top: 8px;
    padding: 8px 0 0;
  }
  .sidebar-selection strong {
    font-size: 11px;
  }
  #orders-open {
    height: 37px;
    font-size: 14px;
    gap: 4px;
  }
  .field-toolbar {
    height: 94px;
    margin-top: 5px;
    padding: 0;
  }
  .field-toolbar > span {
    display: none;
  }
  .field-actions {
    gap: 4px;
  }
  .field-actions > button:not(.icon-button) {
    height: 31px;
  }
  #start {
    min-width: 0;
    font-size: 13px;
    letter-spacing: 0;
  }
  .view-controls {
    padding: 2px;
    right: 5px;
    bottom: 6px;
  }
  .view-controls button {
    min-width: 22px;
  }
  .view-controls #zoom-fit {
    min-width: 36px;
  }
  .command-dock {
    padding: 0 4px;
  }
  .dock-heading {
    height: 84px;
    gap: 6px;
    padding: 4px;
  }
  .selection-label strong {
    font-size: 13px;
  }
  .close-cards {
    padding: 4px 6px;
  }
  .timing-panel {
    padding: 5px;
    gap: 7px;
  }
  .order-card,
  .order-card:hover:not(:disabled),
  .order-card[aria-pressed="true"] {
    border-width: 8px;
    --frame-width: 8px;
    padding: 13px 2px 8px;
    gap: 9px;
  }
  .order-card svg {
    width: 44px;
    height: 44px;
  }
  .order-card strong {
    font-size: 16px;
  }
  .order-card small {
    font-size: 10px;
  }
  #order-cards strong {
    font-size: 13px;
  }
  .pause-curtain {
    padding: 8px;
    gap: 8px;
  }
  .pause-curtain button {
    padding: 6px;
    font-size: 12px;
  }
}

@media (max-height: 600px) and (min-width: 701px) {
  .app {
    min-height: 360px;
    padding: 5px 8px 6px;
  }
  .topbar {
    height: 51px;
    border-width: 7px;
    --frame-width: 7px;
  }
  .brand strong {
    font-size: 23px;
  }
  .brand span {
    display: none;
  }
  .brand > svg {
    width: 26px;
    height: 29px;
  }
  .game-layout {
    padding-top: 6px;
    gap: 7px;
  }
  .scoreboard,
  .field-toolbar {
    height: 48px;
    border-width: 7px;
    --frame-width: 7px;
  }
  .scoreboard {
    margin-bottom: 5px;
  }
  .field-toolbar {
    margin-top: 5px;
  }
  .field-toolbar > span {
    display: none;
  }
  .field-actions {
    margin-left: auto;
  }
  .field-actions > button:not(.icon-button),
  .field-actions .icon-button {
    height: 29px;
  }
  .army-dock {
    padding: 2px;
    border-width: 8px;
    --frame-width: 8px;
  }
  .roster-label {
    padding-bottom: 6px;
  }
  .squad-symbol {
    height: 27px;
    width: 27px;
  }
  .squad-symbol :is(svg,img.unit-illustration) {
    height: 24px;
    width: 24px;
  }
  .sidebar-command {
    margin-top: 5px;
    padding-top: 5px;
  }
  .dock-heading {
    height: 46px;
    border-width: 7px;
    --frame-width: 7px;
  }
  .timing-panel {
    border-width: 7px;
    --frame-width: 7px;
  }
}

.toast.error {
  border-color: transparent;
}

.scenario select {
  min-width: 126px;
  min-height: 32px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  color: #edd5a5;
  background: #29202b;
  border: 1px solid #a58a54;
  border-radius: 1px;
  box-shadow: inset 1px 1px 4px #0008;
  cursor: var(--game-cursor);
}
.scenario select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 700px) {
  .topbar {
    height: 94px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 36px 30px;
    gap: 4px 8px;
    padding: 4px 7px;
  }
  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
  }
  .topbar .top-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .topbar .scenario {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }
  .scenario i {
    display: none;
  }
  .scenario h1 {
    font-size: 12px;
  }
  .scenario select {
    min-height: 28px;
    min-width: 126px;
    font-size: 12px;
    padding: 3px 7px;
  }
}
