:root {
  --ink: #26362a;
  --forest: #24392b;
  --soft: #64705e;
  --gold: #d8ab5c;
  --line: #c8c4af;
  --paper: #f1eddf;
  --card: #f7f3e8;
  --serif: 'Spectral', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  font:
    15px/1.42 'DM Sans',
    'Avenir Next',
    'Trebuchet MS',
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 280px;
  background:
    radial-gradient(ellipse at 14% 0, #fffbee70, transparent 65%),
    repeating-linear-gradient(95deg, #8e7f5421 0, transparent 1px, transparent 5px), var(--paper);
  background-size:
    auto,
    6px 5px,
    auto;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible {
  outline: 3px solid #b2742c;
  outline-offset: 3px;
}
button:active:enabled {
  transform: translateY(1px);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand,
.era-info strong,
.portal strong,
.card-foot > strong,
.route-choice strong {
  font-family: var(--serif);
  line-height: 1.08;
}
.icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  flex: none;
}
i[data-icon],
span[data-icon] {
  display: inline-flex;
  align-items: center;
}
.mast {
  background: #23352a;
  color: #f6f0de;
  border-bottom: 3px solid #bf9550;
  box-shadow: 0 1px 0 #3f493b;
}
.mast-inner {
  max-width: 1300px;
  padding: 0 clamp(20px, 4.5vw, 70px);
  height: 68px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 66px);
  margin: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: 0;
  color: #fff3d6;
  padding: 0;
  white-space: nowrap;
  font-size: clamp(23px, 2.2vw, 33px);
  font-weight: 700;
  letter-spacing: -1.3px;
}
.brand-mark {
  color: #dcb770;
  justify-content: center;
  width: 32px;
  height: 38px;
  border-top: 2px solid;
  border-bottom: 2px solid;
}
.brand-mark svg {
  width: 27px;
  height: 29px;
}
nav {
  display: flex;
  align-self: stretch;
  gap: clamp(10px, 2.3vw, 36px);
}
nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  border: 0;
  background: none;
  color: #d4d8c9;
  font-weight: 650;
  font-size: 13px;
  padding: 0;
}
nav button:hover,
nav button[aria-current] {
  color: #fff1cb;
}
nav button[aria-current]:after {
  content: '';
  position: absolute;
  height: 3px;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gold);
}
nav .icon {
  width: 16px;
  height: 16px;
}
.utility {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.wallet,
.battle-wallet {
  border: 1px solid #65725a;
  border-radius: 5px;
  background: #19291fc2;
  color: #f5d395;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.wallet .icon,
.battle-wallet .icon {
  color: #e2b355;
  fill: #ba883e50;
}
#sound,
.round {
  border: 1px solid #79816a77;
  width: 35px;
  height: 35px;
  background: transparent;
  color: inherit;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
}
#sound:hover {
  background: #344737;
}
#content,
footer {
  max-width: 1300px;
  margin: auto;
  padding-left: clamp(20px, 4.5vw, 70px);
  padding-right: clamp(20px, 4.5vw, 70px);
}
#content {
  padding-top: clamp(22px, 3.1vw, 45px);
  outline: none;
  min-height: 64vh;
}
.eyebrow,
.hero-label,
.hero-folio,
.era-info small,
.card-top,
.card-foot > small,
.count-note,
.progress-label > span {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.145em;
  text-transform: uppercase;
  font-weight: 800;
}
.eyebrow {
  color: #797046;
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 23px;
}
h1 {
  font-size: clamp(41px, 4.4vw, 66px);
  letter-spacing: -0.048em;
  font-weight: 700;
}
.page-title h1 {
  margin-top: 4px;
}
.progress-label {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px 12px;
  min-width: 180px;
  margin-bottom: 5px;
  font-size: 12px;
}
.progress-label > span {
  font-size: 9px;
  color: var(--soft);
  letter-spacing: 0.1em;
}
.progress-label strong {
  text-align: right;
  font-size: 11px;
}
progress {
  grid-column: 1/-1;
  appearance: none;
  width: 100%;
  height: 4px;
  border: 0;
  background: #d7d3c1;
  color: #65784c;
}
progress::-webkit-progress-bar {
  background: #d7d3c1;
}
progress::-webkit-progress-value {
  background: #697f53;
}
progress::-moz-progress-bar {
  background: #697f53;
}
.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(255px, 1fr);
  gap: 20px;
}
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: clamp(305px, 29vw, 408px);
  border-radius: 8px;
  border: 1px solid #4d513a;
  background: #314b39 var(--cover) 57% 48% / cover;
  box-shadow: 0 5px 12px #283e211c;
}
.hero:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(88deg, #132b20ed 0%, #152c20b5 30%, #17322121 64%, transparent 80%),
    linear-gradient(0deg, #18261ccb, transparent 32%);
}
.hero:after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid #e2cea680;
  border-radius: 3px;
  pointer-events: none;
  z-index: -1;
}
.hero-copy {
  padding: clamp(24px, 3vw, 46px);
  color: #fff5dd;
  max-width: 85%;
}
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f3d298;
  margin-bottom: 12px;
}
.hero-label em {
  font-style: normal;
}
.hero-copy h2 {
  font-size: clamp(39px, 4.9vw, 74px);
  max-width: 7.9em;
  letter-spacing: -0.045em;
  line-height: 0.99;
  text-wrap: balance;
  text-shadow: 0 2px 14px #26362555;
}
.hero-copy > p:not(.hero-label) {
  max-width: 29em;
  margin: 13px 0 21px;
  font-size: 14px;
  color: #f5f0d9;
  line-height: 1.5;
  text-shadow: 0 1px 6px #162419;
}
.primary,
.buy,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 43px;
  padding: 10px 17px;
  border-radius: 4px;
  border: 1px solid #895e24;
  font-weight: 750;
  font-size: 14px;
}
.primary {
  color: #302b1f;
  background: #efbe69;
  box-shadow:
    inset 0 1px 0 #ffdb9c,
    0 2px 1px #1d281f33;
}
.primary:hover {
  background: #ffd080;
}
.primary .icon:last-child:not(:first-child) {
  margin-left: 9px;
}
.hero-folio {
  position: absolute;
  right: 17px;
  bottom: 13px;
  color: #f3e2bb;
  letter-spacing: 0.12em;
  font-size: 9px;
}
.timeline,
.portal,
.store-card,
.unit-card,
.camp-card {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 2px 3px #51493013;
}
.timeline {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 17px 20px 13px;
  border-bottom: 1px solid var(--line);
  color: #364934;
}
.panel-heading .icon {
  color: #7b7653;
}
.panel-heading h2,
.section-heading h2 {
  font-size: clamp(22px, 2.15vw, 30px);
  letter-spacing: -0.04em;
}
.era-rows {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  flex: 1;
  padding: 0 14px;
}
.era-row {
  display: flex;
  align-items: center;
  text-align: left;
  position: relative;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid #cdc9b8;
  background: transparent;
  padding: 8px 5px;
}
.era-row:last-child {
  border: 0;
}
.era-row:hover {
  background: #e9e6d6;
}
.era-row > .icon {
  margin-left: auto;
  width: 14px;
  color: #7b806d;
}
.era-row.selected .era-state {
  color: #476339;
}
.era-row:not(.selected) > .plate {
  filter: saturate(0.52);
  opacity: 0.84;
}
.plate {
  display: block;
  flex: none;
  aspect-ratio: 1;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  mix-blend-mode: multiply;
}
.object {
  background-image: url(art/objects.webp);
}
.warrior {
  background-image: url(art/warriors.webp);
}
.era-row > .plate {
  width: clamp(45px, 4.8vw, 69px);
  border-radius: 50%;
}
.era-info {
  display: grid;
  gap: 2px;
}
.era-info small {
  font-size: 8px;
  color: #746e51;
}
.era-info strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}
.era-state {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--soft);
}
.era-state .icon {
  width: 10px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 13px;
}
.rule {
  height: 1px;
  background: var(--line);
  flex: 1;
}
.rule-diamond {
  width: 7px;
  height: 7px;
  background: #a17d40;
  transform: rotate(45deg);
}
.portals,
.catalogue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.portal {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 13px 15px 13px 8px;
  gap: 12px;
  min-height: 112px;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.portal:hover,
.unit-card:hover {
  border-color: #909779;
  background: #fffbed;
}
.portal .plate {
  width: clamp(60px, 7.1vw, 100px);
  border-radius: 10px;
}
.portal strong {
  display: block;
  font-size: clamp(20px, 2vw, 29px);
  letter-spacing: -0.04em;
}
.portal small {
  display: block;
  margin-top: 5px;
  color: #646956;
  font-size: 12px;
  line-height: 1.4;
  max-width: 19ch;
}
.portal b {
  align-self: flex-start;
  margin-left: auto;
  color: #7f826a;
}
.portal b .icon {
  width: 15px;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: #626b58;
  margin-top: 26px;
  margin-bottom: 20px;
}
footer > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.count-note {
  color: var(--soft);
  margin-bottom: 5px;
}
.intro {
  max-width: 50em;
  margin: -7px 0 20px;
  color: var(--soft);
}
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tabs button,
.secondary {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
}
.tabs button {
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 15px;
}
.tabs button[aria-pressed='true'],
.buy {
  background: var(--forest);
  color: var(--card);
  border-color: var(--forest);
}
.catalogue {
  gap: 20px;
}
.unit-card,
.store-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  text-align: left;
  overflow: hidden;
}
.card-top {
  padding: 15px 17px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666a53;
  letter-spacing: 0.09em;
  font-size: 10px;
}
.specimen,
.guide-portrait {
  width: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #dcd5b580, transparent 68%);
}
.specimen .plate {
  width: min(70%, 195px);
  margin: 16px 0;
}
.card-foot {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 20px 19px;
  border-top: 1px solid var(--line);
}
.card-foot > small {
  color: #817446;
}
.card-foot > strong,
.card-foot h2,
.camp-card h2 {
  font-size: clamp(23px, 2.3vw, 33px);
  letter-spacing: -0.035em;
  margin: 6px 0;
}
.card-foot > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--soft);
  margin-top: 9px;
}
.card-foot > span .icon:last-child {
  margin-left: auto;
}
.card-foot > span i {
  height: 12px;
  border-left: 1px solid var(--line);
  margin: 0 4px;
}
.card-foot p,
.camp-card p {
  font-size: 14px;
  color: var(--soft);
  margin: 4px 0 16px;
}
.buy {
  justify-content: space-between;
  margin-top: auto;
}
.buy span:last-child {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #f0cf88;
}
.buy:disabled {
  background: #e6e3d6;
  color: #666958;
  border-color: #c9c6b5;
}
.buy:disabled span:last-child {
  color: inherit;
}
.camp-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.camp-card {
  display: flex;
  align-items: center;
  padding: 24px;
  gap: 16px;
}
.camp-card > .plate {
  width: 28%;
  border-radius: 12px;
}
.camp-card > div {
  flex: 1;
}
.camp-card .buy {
  width: 100%;
  margin-top: 13px;
}
.increase {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.increase b {
  color: #4e6738;
}
dialog {
  max-width: min(410px, calc(100% - 28px));
  width: 100%;
  max-height: 88dvh;
  padding: 27px;
  border-radius: 9px;
  border: 1px solid #aaa889;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 20px 85px #19251f5c;
}
dialog::backdrop {
  background: #16251fbb;
  backdrop-filter: blur(2px);
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
}
dialog h2 {
  font-size: 34px;
  letter-spacing: -0.045em;
  margin: 7px 0 10px;
  padding-right: 13px;
}
dialog p:not(.eyebrow) {
  font-size: 14px;
  color: var(--soft);
}
dialog .guide-portrait .plate {
  width: min(145px, 35vh);
}
.route-list,
.dialog-actions {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}
.route-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #fffbee;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}
.route-choice b {
  color: #93815c;
  font-family: var(--serif);
  font-size: 19px;
}
.route-choice span {
  display: grid;
  gap: 4px;
}
.route-choice strong {
  font-size: 18px;
}
.route-choice small {
  font-size: 11px;
  color: var(--soft);
}
.route-choice .icon {
  margin-left: auto;
}
.route-choice:disabled {
  background: #ebe7d9;
  color: #737565;
}
.facts {
  padding: 0;
  margin: 13px 0 0;
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.facts dt {
  color: var(--soft);
}
.facts dd {
  font-weight: 700;
  margin: 0;
}
.result-emblem {
  font-size: 30px;
  color: #ac7a27;
  margin-bottom: 12px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  background: #24392b;
  color: #fff7df;
  border-radius: 5px;
  box-shadow: 0 4px 16px #25372333;
  padding: 9px 15px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: 0.18s;
  z-index: 3;
  text-align: center;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* The map stays between the header and the orders panel on short or narrow screens. */
#arena {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 270px;
  display: grid;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  color: #fff4df;
  background: #23392c;
}
#battle-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px
    max(18px, env(safe-area-inset-left));
  border-bottom: 2px solid var(--gold);
}
#battle-head h1 {
  font-size: clamp(23px, 3vw, 37px);
  margin-top: 2px;
}
#battle-head .eyebrow {
  color: #d5bd89;
}
.battle-wallet {
  margin-left: auto;
}
.field-wrap {
  min-height: 0;
  position: relative;
  background: #9da979;
  overflow: hidden;
}
#field {
  display: block;
  width: 100%;
  height: 100%;
}
.battle-controls {
  display: grid;
  gap: 10px;
  justify-items: center;
  background: var(--paper);
  color: var(--ink);
  border-top: 2px solid #938358;
  padding: 10px max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom));
}
.battle-squad,
#squad,
#belt {
  display: flex;
  align-items: stretch;
  gap: 8px;
  justify-content: center;
}
#food-readout {
  padding: 5px 14px 3px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  text-align: center;
}
#food-readout span,
#food-readout small {
  font-size: 10px;
  font-weight: 700;
}
#food-readout b {
  font: 700 29px/1 var(--serif);
}
#squad button {
  border: 1px solid #8a9379;
  background: #fffaec;
  border-radius: 5px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 8px;
  padding: 5px 12px 5px 4px;
  min-width: 125px;
}
#squad button:disabled,
#belt button:disabled {
  opacity: 0.58;
  filter: saturate(0.45);
}
#squad .plate {
  width: 45px;
}
#squad small {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
}
#squad strong {
  font-size: 13px;
}
#belt {
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
#belt > b {
  font-size: 11px;
  margin-right: 5px;
}
#belt button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  font-size: 11px;
}
#belt .plate {
  width: 21px;
}
#rally {
  font-size: 11px;
  color: #80551d;
}
#battle-notice {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
  background: #23352be6;
  color: #fff4d8;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  pointer-events: none;
}
#battle-notice:empty {
  display: none;
}
@media (max-width: 860px) {
  .mast-inner {
    gap: 20px;
  }
  nav {
    gap: 16px;
  }
  nav .icon {
    display: none;
  }
  .command-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(215px, 1fr);
    gap: 13px;
  }
  .hero-copy {
    max-width: 95%;
  }
  .portal {
    gap: 6px;
    padding: 10px;
  }
  .portal .plate {
    width: 56px;
  }
  .portal b {
    display: none;
  }
  .portals,
  .catalogue {
    gap: 10px;
  }
  .camp-card {
    padding: 16px;
    gap: 10px;
  }
  .camp-card > .plate {
    width: 22%;
  }
}
@media (max-width: 650px) {
  .mast-inner {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    padding: 0 max(15px, env(safe-area-inset-right)) 0 max(15px, env(safe-area-inset-left));
  }
  .brand {
    height: 51px;
    justify-self: start;
  }
  .brand-mark {
    height: 29px;
    width: 25px;
  }
  .brand-mark svg {
    height: 23px;
  }
  .utility {
    grid-column: 2;
    grid-row: 1;
  }
  nav {
    grid-row: 2;
    grid-column: 1/-1;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #52614c;
  }
  nav button {
    height: 39px;
    font-size: 12px;
  }
  nav .icon {
    display: block;
    width: 13px;
  }
  #content,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  #content {
    padding-top: 20px;
  }
  .page-title {
    margin-bottom: 15px;
    align-items: center;
  }
  .page-title h1 {
    font-size: 38px;
  }
  .progress-label {
    min-width: 0;
    grid-template-columns: auto;
    gap: 3px;
  }
  .progress-label > span {
    display: none;
  }
  .progress-label strong {
    font-size: 10px;
  }
  .command-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    min-height: 282px;
    background-position: 57% 45%;
  }
  .hero-copy {
    padding: 24px;
    max-width: 86%;
  }
  .hero-copy h2 {
    font-size: 43px;
  }
  .hero-copy > p:not(.hero-label) {
    font-size: 12px;
    max-width: 22ch;
    margin: 9px 0 15px;
  }
  .hero-folio {
    font-size: 8px;
  }
  .hero-label {
    font-size: 9px;
  }
  .panel-heading {
    padding: 11px 12px 8px;
  }
  .panel-heading h2 {
    font-size: 20px;
  }
  .era-rows {
    display: flex;
    padding: 0 5px;
  }
  .era-row {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    border: 0;
    padding: 7px 0 11px;
    text-align: center;
  }
  .era-row:after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    border-right: 1px solid var(--line);
  }
  .era-row:last-child:after {
    display: none;
  }
  .era-info strong {
    font-size: 16px;
  }
  .era-info small {
    font-size: 7px;
  }
  .era-state {
    justify-content: center;
    font-size: 9px;
  }
  .era-row > .plate {
    width: 41px;
  }
  .era-row > .icon {
    display: none;
  }
  .section-heading {
    margin: 20px 0 10px;
  }
  .portals {
    grid-template-columns: 1fr;
  }
  .portal {
    min-height: 72px;
    padding: 6px 12px;
    gap: 12px;
  }
  .portal .plate {
    width: 57px;
  }
  .portal b {
    display: block;
    align-self: center;
  }
  .portal strong {
    font-size: 22px;
  }
  .portal small {
    max-width: none;
    margin-top: 3px;
  }
  .catalogue,
  .camp-list {
    grid-template-columns: 1fr;
  }
  .unit-card,
  .store-card {
    display: grid;
    grid-template-columns: 31% 1fr;
    grid-template-rows: auto 1fr;
  }
  .card-top {
    grid-row: 1;
    grid-column: 1/-1;
    padding: 10px 12px 2px;
  }
  .card-foot {
    border: 0;
    padding: 10px 13px 13px;
  }
  .specimen .plate {
    width: 90%;
    margin: 3px;
  }
  .card-foot p {
    font-size: 13px;
  }
  .camp-card > .plate {
    width: 25%;
  }
  .count-note {
    max-width: 80px;
    text-align: right;
    font-size: 8px;
  }
  .tabs {
    margin-bottom: 13px;
  }
  .tabs button {
    font-size: 12px;
  }
  #battle-head h1 {
    font-size: 24px;
  }
  #squad button {
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0;
    padding: 4px;
    text-align: center;
  }
  #squad strong {
    font-size: 11px;
  }
  #squad small {
    justify-content: center;
  }
  #squad .plate {
    width: 38px;
  }
  .battle-squad {
    width: 100%;
    max-width: 480px;
  }
  #squad {
    flex: 1;
    gap: 4px;
  }
  #food-readout {
    padding: 2px 7px 2px 0;
  }
  #belt > b {
    display: none;
  }
  #belt button {
    gap: 3px;
    font-size: 10px;
    padding: 3px 5px;
  }
  #belt .plate {
    width: 17px;
  }
  .wallet {
    padding: 4px 8px;
  }
  #sound {
    width: 30px;
    height: 30px;
  }
}
@media (max-height: 460px) and (orientation: landscape) {
  #battle-head {
    padding: 3px 12px;
  }
  #battle-head h1 {
    font-size: 20px;
  }
  #battle-head .eyebrow {
    font-size: 8px;
  }
  .battle-controls {
    padding: 4px 8px;
    gap: 4px;
  }
  #squad .plate {
    width: 31px;
  }
  #food-readout b {
    font-size: 19px;
  }
  #belt .plate {
    width: 15px;
  }
  #battle-notice {
    top: 48px;
  }
  dialog {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 450px) {
  .page-title h1 {
    font-size: clamp(30px, 8.8vw, 39px);
  }
  .progress-label {
    flex: none;
  }
  .progress-label strong {
    white-space: nowrap;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  #belt {
    width: 100%;
    max-width: 480px;
  }
  #belt button {
    flex: 1;
    min-height: 42px;
    justify-content: center;
    font-size: 11px;
  }
  #belt button span:not(.plate) {
    line-height: 1.1;
  }
  #belt .plate {
    width: 20px;
  }
  #rally:empty {
    display: none;
  }
}

#food-readout {
  background: linear-gradient(90deg, #79914c var(--readiness, 0%), #d9cfb5 0) left bottom / 100% 3px no-repeat;
}
#squad button:enabled {
  border-color: #64804b;
  box-shadow: inset 0 -3px 0 #85995e;
}
#dialog[open] { max-height: calc(100dvh - 20px); overflow-y: auto; }

@media (max-width: 620px) {
  #squad:has(> button:only-child) {
    flex: 0 1 145px;
  }
  #squad > button:only-child {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    text-align: left;
    min-height: 46px;
  }
  #squad > button:only-child small { justify-content: flex-start; }
}

.map-tabs {display:flex;gap:4px;margin:10px 0 6px;padding:3px;background:#e8e1d1;border-radius:6px}
.map-tabs button {flex:1;background:transparent;border:0;border-radius:4px;padding:7px;color:#524b3b;font-weight:700}
.map-tabs [aria-pressed=true] {background:#2d4539;color:#fff5da}
.expedition-row {width:100%;display:flex;align-items:center;gap:9px;text-align:left;border:1px solid #887143;border-radius:5px;background:#354437;color:#fff0cf;padding:8px 12px;margin-top:8px}
.expedition-row span {flex:1}
.expedition-row small {display:block;color:#e7d5a7;font-size:11px}
#hazard {position:absolute;z-index:1;top:10px;left:50%;transform:translateX(-50%);border:1px solid #bba781;background:#28362be8;color:#ffeac2;border-radius:5px;padding:5px 10px;font-size:12px;text-align:center;white-space:nowrap;pointer-events:none}
#hazard.active {background:#6d3229;color:#ffead5}
#belt button strong {font-size:10px;color:#634725;white-space:nowrap}
@media(max-width:480px){#hazard{font-size:11px;max-width:96%;white-space:normal}#belt button{min-height:35px}}
@media(max-width:480px) and (orientation:portrait) {
  #belt {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  #belt button {display:grid;grid-template-columns:18px 1fr;column-gap:3px;row-gap:0;align-content:center;text-align:left;min-height:44px;padding:4px}
  #belt button .plate {grid-row:span 2;width:18px}
  #belt button strong {grid-column:2}
  #rally:not(:empty) {grid-column:1/-1;text-align:center}
  #hazard {width:max-content;max-width:94%}
}
