:root {
  color-scheme: light;
  --paper: #f3ead5;
  --paper-deep: #e8dabd;
  --graphite: #302f2d;
  --muted: #766f63;
  --blue: #214f8f;
  --blue-dark: #173c70;
  --red: #a03531;
  --shadow: rgba(53, 42, 22, 0.22);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, sans-serif;
  touch-action: manipulation;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.38), transparent 30%),
    #cabb9c;
  color: var(--graphite);
}

body {
  min-height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; }
button:focus-visible { outline: 3px solid #e1a92f; outline-offset: 3px; }

.app-shell {
  width: min(100%, 820px);
  min-width: 0;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  background: var(--paper);
  box-shadow: 0 0 44px rgba(42, 35, 22, .28);
  overflow: hidden;
}

.masthead, .battle-stage, .command-deck { min-width: 0; }

.masthead {
  min-height: 72px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(72, 107, 145, .26);
  background:
    linear-gradient(90deg, transparent 52px, rgba(186, 66, 61, .22) 53px, transparent 54px),
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(60, 112, 159, .11) 26px 27px),
    var(--paper);
}

.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }

.orientation-button {
  min-width: 66px;
  padding: 6px 8px 5px;
  color: var(--graphite);
  background: rgba(248, 241, 222, .82);
  border: 2px solid currentColor;
  border-radius: 3px 7px 4px 5px;
  line-height: 1;
  transform: rotate(-1deg);
}
.orientation-button small { display: block; margin-bottom: 2px; color: var(--red); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.orientation-button b { display: block; font-size: 8px; letter-spacing: .04em; }

.title-lockup { min-width: 0; overflow: hidden; transform: rotate(-.6deg); }
.eyebrow {
  display: block;
  margin-bottom: -2px;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}
.rank-label { color: var(--blue); }

h1 {
  margin: 0;
  color: var(--graphite);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(25px, 7vw, 42px);
  font-weight: 900;
  letter-spacing: .035em;
  line-height: .98;
  white-space: nowrap;
}

h1 i {
  display: inline-block;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: .48em;
  font-weight: 700;
  transform: rotate(-8deg) translateY(-3px);
}

.ink-card {
  min-width: 74px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: var(--blue);
  border: 2px solid var(--blue-dark);
  border-radius: 45% 55% 48% 52% / 56% 42% 58% 44%;
  box-shadow: 2px 3px 0 rgba(25, 54, 96, .2);
  transform: rotate(1.4deg);
}

.ink-card strong { display: block; font-size: 20px; line-height: 18px; }
.ink-card small { display: block; font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.ink-drop {
  width: 13px;
  height: 17px;
  display: block;
  background: white;
  border-radius: 65% 35% 55% 45% / 75% 40% 60% 25%;
  transform: rotate(42deg);
}

.battle-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.phase-stamp {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 4px 8px 3px;
  color: var(--blue);
  border: 2px solid currentColor;
  font-family: "Arial Narrow", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  transform: rotate(-2deg);
  pointer-events: none;
}

/* The battle readout is two lines rather than the setup stamp's one, so the
   objective chips move down out from under it instead of overlapping. */
html[data-game-phase="battle"] .objective-tracker { top: 62px; }

.phase-stamp.live {
  left: 12px;
  right: 84px;
  max-width: none;
  padding: 5px 8px 4px;
  color: var(--graphite);
  background: rgba(246, 239, 221, .9);
  box-shadow: 1px 2px 0 rgba(40, 36, 29, .14);
  transform: rotate(-.6deg);
}
@media (max-width: 430px) {
  .phase-stamp.live { font-size: 9px; right: 74px; }
  .phase-stamp .hud-intent { font-size: 9.5px; }
}
.phase-stamp .hud-line { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.phase-stamp .hud-line em { font-style: normal; opacity: .92; }
.phase-stamp .hud-line .blue, .phase-stamp b.blue { color: var(--blue); }
.phase-stamp .hud-line .red, .phase-stamp b.red { color: var(--red); }
.phase-stamp .hud-intent {
  display: block;
  margin-top: 3px;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--red);
}

.objective-tracker {
  position: absolute;
  z-index: 5;
  top: 39px;
  left: 11px;
  max-width: min(74%, 430px);
  display: flex;
  gap: 5px;
  pointer-events: none;
}
.objective-tracker[hidden] { display: none; }
.objective-chip {
  min-width: 116px;
  padding: 4px 6px;
  display: grid;
  grid-template-columns: 16px 1fr;
  grid-template-rows: auto 4px auto;
  column-gap: 4px;
  color: var(--graphite);
  background: rgba(246,239,221,.9);
  border: 1px solid currentColor;
  box-shadow: 1px 2px 0 rgba(40,36,29,.14);
}
.objective-chip.blue { color: var(--blue); }
.objective-chip.red { color: var(--red); }
.objective-chip > span { grid-row: 1 / 4; align-self: center; font-family: Georgia, serif; font-size: 15px; font-weight: 900; }
.objective-chip b { overflow: hidden; font-size: 7px; letter-spacing: .06em; text-overflow: ellipsis; white-space: nowrap; }
.objective-chip i { position: relative; display: block; overflow: hidden; background: rgba(52,50,47,.15); }
.objective-chip em { position: absolute; inset: 0 auto 0 0; display: block; background: currentColor; }
.objective-chip small { margin-top: 2px; font-size: 6px; font-weight: 900; letter-spacing: .05em; }

.round-button {
  width: 43px;
  height: 43px;
  padding: 0;
  color: var(--graphite);
  background: rgba(246, 239, 221, .88);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 2px 2px 0 rgba(40, 36, 29, .18);
}

.sound-button { position: absolute; top: 8px; right: 10px; }
.menu-stage-button { position: absolute; top: 57px; right: 10px; color: var(--blue); }
.tools-toggle { display: none; }
.tools-toggle[hidden] { display: none; }
.zoom-reset-button { position: absolute; z-index: 4; left: 10px; bottom: 10px; color: var(--blue); background: rgba(246,239,221,.94); }
.zoom-reset-button[hidden] { display: none; }
.sound-button[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; opacity: .72; }

.orientation-nudge {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  padding: 7px 11px;
  color: white;
  background: rgba(48, 47, 45, .88);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  transform: translateX(-50%) rotate(-1deg);
  pointer-events: none;
}

html[data-front-screen="open"] .app-shell { grid-template-rows: minmax(0, 1fr); }
html[data-front-screen="open"] .masthead,
html[data-front-screen="open"] .command-deck,
html[data-front-screen="open"] .phase-stamp,
html[data-front-screen="open"] .sound-button,
html[data-front-screen="open"] .menu-stage-button,
html[data-front-screen="open"] .tools-toggle { display: none !important; }
html[data-front-screen="open"] .battle-stage { min-height: 100dvh; }
html[data-front-screen="open"] #gameCanvas { opacity: .16; filter: sepia(.25); }

.front-screen {
  position: absolute;
  z-index: 14;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.5), transparent 26%),
    linear-gradient(90deg, transparent 42px, rgba(174,54,50,.18) 43px, transparent 44px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(57,109,153,.1) 28px 29px),
    #eee2c7;
}
.front-screen[hidden] { display: none; }
.desk-paper {
  width: min(100% - 22px, 680px);
  min-height: calc(100dvh - 24px);
  margin: 12px auto;
  padding: clamp(20px, 5vw, 38px);
  color: var(--graphite);
  background: rgba(248,241,222,.88);
  border: 1px solid rgba(74,62,40,.23);
  box-shadow: 5px 8px 22px rgba(66,51,26,.18);
}
.home-paper { text-align: center; }
.home-logo {
  margin: 0;
  color: var(--graphite);
  font: 900 clamp(38px, 12vw, 72px)/.92 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: .035em;
  transform: rotate(-.7deg);
}
.home-logo i { color: var(--red); font: 700 .42em Georgia, serif; }
.home-promise { margin: 9px auto 18px; max-width: 430px; color: var(--muted); font: italic 14px/1.4 Georgia, serif; }
.service-strip {
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  color: white;
  background: var(--blue);
  border: 2px solid var(--blue-dark);
  box-shadow: 3px 4px 0 rgba(23,60,112,.22);
  transform: rotate(.35deg);
}
.service-strip span { min-width: 0; padding: 8px 5px; border-right: 1px dashed rgba(255,255,255,.44); }
.service-strip span:last-child { border: 0; }
.service-strip small, .service-strip b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-strip small { font-size: 6px; letter-spacing: .14em; }
.service-strip b { margin-top: 2px; font-size: 11px; }
.campaign-folder {
  position: relative;
  width: 100%;
  min-height: 112px;
  padding: 30px 22px 16px;
  display: grid;
  align-content: center;
  color: var(--graphite);
  background: #e6c985;
  border: 2px solid #8a7139;
  border-radius: 3px 5px 2px 4px;
  box-shadow: 4px 6px 0 rgba(100,77,28,.2);
  text-align: left;
  transform: rotate(-.35deg);
}
.campaign-folder .folder-tab { position: absolute; top: -14px; left: 12px; padding: 7px 18px 5px; background: #e6c985; border: 2px solid #8a7139; border-bottom: 0; border-radius: 7px 7px 0 0; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.folder-stars {
  position: absolute;
  top: -14px;
  right: 12px;
  padding: 7px 12px 5px;
  color: var(--blue-dark);
  background: #e6c985;
  border: 2px solid #8a7139;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  font: 900 8px/1 system-ui, sans-serif;
  font-style: normal;
  letter-spacing: .1em;
}
.campaign-folder b { color: var(--blue-dark); font: 900 20px Georgia, serif; }
.campaign-folder small { margin: 5px 0 8px; font: italic 12px/1.35 Georgia, serif; }
.campaign-folder i { color: var(--red); font-size: 8px; font-style: normal; font-weight: 900; letter-spacing: .12em; }
.desk-modes { margin: 15px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.desk-mode { min-width: 0; min-height: 112px; padding: 12px 8px; color: var(--graphite); background: rgba(255,252,242,.78); border: 2px solid currentColor; border-radius: 3px 8px 4px 6px; box-shadow: 2px 3px 0 rgba(45,40,32,.13); }
.desk-mode:nth-child(2) { transform: rotate(.7deg); }
.desk-mode:nth-child(3) { transform: rotate(-.5deg); }
.desk-mode span, .desk-mode b, .desk-mode small { display: block; }
.desk-mode span { margin-bottom: 5px; color: var(--red); font: 900 24px Georgia, serif; }
.desk-mode b { color: var(--blue); font-size: 10px; letter-spacing: .06em; }
.desk-mode small { margin-top: 5px; color: var(--muted); font: 10px/1.3 Georgia, serif; }
.desk-mode.allout { color: var(--red); background: rgba(160,53,49,.06); }
.desk-mode.allout b { color: var(--red); }
.desk-mode.passplay { color: #674f86; background: linear-gradient(135deg, rgba(33,79,143,.07) 0 49%, rgba(160,53,49,.07) 51% 100%); }
.desk-mode.passplay b { color: #674f86; }
/* The daily sheet is one page for everybody, so it reads as a banner across the
   top of the desk rather than a fifth option competing with the modes. */
.desk-mode.daily {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 11px;
  color: var(--blue);
  background: rgba(33,79,143,.09);
  text-align: left;
}
.desk-mode.daily span { margin: 0; color: var(--blue); font-size: 20px; }
.desk-mode.daily small { margin: 2px 0 0; }
.desk-mode.daily i {
  padding: 4px 8px;
  color: var(--paper);
  background: var(--blue);
  border-radius: 2px 7px 3px 6px;
  font: 900 8px/1 system-ui, sans-serif;
  font-style: normal;
  letter-spacing: .09em;
}
.desk-mode.daily.played { color: var(--muted); background: rgba(48,47,45,.06); }
.desk-mode.daily.played i { background: var(--muted); }

/* A code is only useful if it can be read off the screen and typed into another
   phone, so the value itself is the largest thing in the row. */
.challenge-row {
  margin: 0 0 11px;
  padding: 7px 9px;
  display: grid;
  gap: 6px;
  color: var(--graphite);
  border: 1px dashed rgba(52,48,42,.5);
  border-radius: 3px 9px 4px 8px;
  background: rgba(255,252,242,.5);
  text-align: left;
}
.challenge-row[hidden] { display: none; }
.challenge-line { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; }
.challenge-line small { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.challenge-line b { min-width: 0; overflow: hidden; color: var(--blue); font: 900 14px/1 Georgia, serif; letter-spacing: .12em; text-overflow: ellipsis; white-space: nowrap; }
.challenge-line button, .challenge-entry button {
  padding: 5px 9px;
  color: var(--blue);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px 6px 3px 5px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .08em;
}
.challenge-line button:disabled { opacity: .35; }
.challenge-entry { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; }
.challenge-entry[hidden] { display: none; }
.challenge-entry input {
  width: 100%;
  padding: 5px 7px;
  color: var(--graphite);
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(52,48,42,.4);
  border-radius: 2px;
  font: 900 13px/1.2 Georgia, serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.challenge-entry input::placeholder { color: rgba(118,111,99,.6); }
.challenge-message { color: var(--muted); font: 9px/1.35 Georgia, serif; }
.challenge-message:empty { display: none; }

/* A locked page has no code to copy and nothing to type into, so the row keeps
   only the sentence that says why. */
.challenge-row.locked { color: var(--blue); border-style: solid; background: rgba(33,79,143,.06); }
.challenge-row.locked .challenge-line, .challenge-row.locked .challenge-entry { display: none; }
.challenge-row.locked .challenge-message { color: var(--blue); font-weight: 700; }

.result-challenge {
  position: relative;
  z-index: 1;
  margin: 0 0 13px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 9px;
  color: var(--blue);
  border: 1px dashed currentColor;
  border-radius: 3px 9px 4px 8px;
  background: rgba(33,79,143,.05);
  text-align: left;
}
.result-challenge[hidden] { display: none; }
.result-challenge span { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.result-challenge b { grid-column: 1; font: 900 16px/1 Georgia, serif; letter-spacing: .14em; }
.result-challenge button {
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 7px 11px;
  color: var(--blue);
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 2px 7px 3px 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.field-desk-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
#homeTutorialButton { color: var(--blue); border-style: solid; background: rgba(33,79,143,.07); }
#homeTutorialButton.start-here { background: rgba(33,79,143,.15); box-shadow: 2px 3px 0 rgba(33,79,143,.3); }
#homeTutorialButton.start-here small { color: var(--blue); }
/* The mobile desk hides these captions to save room, but START HERE is the one
   caption a first-time player most needs to see. */
@media (max-width: 470px) {
  #homeTutorialButton.start-here small { display: block; font-size: 6px; }
}
.field-desk-nav button { min-width: 0; padding: 10px 5px; color: var(--graphite); background: transparent; border: 1px dashed currentColor; }
.field-desk-nav span, .field-desk-nav b, .field-desk-nav small { display: block; }
.field-desk-nav span { color: var(--blue); font-size: 18px; }
.field-desk-nav b { margin-top: 2px; font-size: 8px; letter-spacing: .07em; }
.field-desk-nav small { margin-top: 2px; color: var(--muted); font-size: 6px; font-weight: 900; }
.build-stamp { display: block; margin-top: 18px; color: rgba(70,65,56,.58); font-size: 7px; font-weight: 900; letter-spacing: .14em; }

.paper-back { position: relative; z-index: 2; margin: 0 auto 12px 0; min-height: 44px; display: inline-flex; align-items: center; padding: 7px 9px; color: var(--blue); background: transparent; border: 1px dashed currentColor; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.setup-screen { width: min(90%, 480px); }
.ledger-paper { text-align: left; }
.ledger-paper h2, .settings-paper h2 { margin: 0 0 8px; font: 900 clamp(30px, 8vw, 48px)/1 Georgia, serif; }
.ledger-paper > p:not(.modal-kicker), .settings-paper > p:not(.modal-kicker) { margin: 0 0 16px; max-width: 560px; color: var(--muted); font: 13px/1.45 Georgia, serif; }
.armory-balance, .active-roster { margin: 8px 0 10px; padding: 8px 11px; display: flex; justify-content: space-between; color: white; background: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.armory-balance i, .active-roster i { font-style: normal; }
.armory-paper { position: relative; }
.armory-tabs { margin: 5px 0 10px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.armory-tab { min-width: 0; padding: 7px 2px 6px; color: var(--muted); background: rgba(248,241,222,.7); border: 1px solid rgba(52,50,47,.35); }
.armory-tab span, .armory-tab b { display: block; }
.armory-tab span { color: var(--blue); font: 900 18px/1 Georgia, serif; }
.armory-tab b { margin-top: 4px; overflow: hidden; font-size: 6px; letter-spacing: .03em; text-overflow: ellipsis; }
.armory-tab.selected { color: white; background: var(--blue); border: 2px solid var(--blue-dark); box-shadow: 2px 2px 0 rgba(23,60,112,.2); transform: translateY(-2px); }
.armory-tab.selected span { color: white; }
.ledger-paper .upgrade-grid { margin: 8px 0 0; }
.ledger-paper .upgrade-button { padding: 9px 5px; }
.armory-list { display: grid; gap: 12px; }
.armory-unit { padding: 12px; background: rgba(255,253,246,.72); border: 1px solid rgba(58,53,45,.32); box-shadow: 2px 3px 0 rgba(54,47,35,.08); }
.armory-unit-head { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 9px; }
.armory-unit-mark { display: grid; width: 42px; height: 42px; place-items: center; color: var(--blue); border: 2px solid currentColor; border-radius: 50%; font: 900 21px Georgia, serif; }
.armory-unit-head b, .armory-unit-head small { display: block; }
.armory-unit-head b { font: 900 17px Georgia, serif; }
.armory-unit-head small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.equipped-tag { color: var(--red); font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.charm-grid { margin-top: 9px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.charm-button { min-width: 0; min-height: 76px; padding: 8px 6px; color: var(--graphite); background: rgba(245,236,214,.74); border: 1px dashed rgba(52,50,47,.52); text-align: left; }
.charm-button b, .charm-button small { display: block; }
.charm-button b { font-size: 8px; }
.charm-button small { margin-top: 4px; color: var(--muted); font: 8px/1.28 Georgia, serif; }
.charm-button.selected { color: var(--blue); background: white; border: 2px solid currentColor; box-shadow: 2px 2px 0 rgba(33,79,143,.15); }
.field-upgrade-drawer { margin-top: 11px; color: var(--blue); border: 1px solid currentColor; background: rgba(33,79,143,.055); }
.field-upgrade-drawer summary { min-height: 44px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 8px; font-weight: 900; letter-spacing: .1em; list-style: none; }
.field-upgrade-drawer summary::-webkit-details-marker { display: none; }
.field-upgrade-drawer summary::after { content: "+"; order: 3; margin-left: 8px; font-size: 16px; }
.field-upgrade-drawer[open] summary::after { content: "−"; }
.field-upgrade-drawer summary i { font-style: normal; }
.field-upgrade-drawer .upgrade-grid { padding: 0 8px 8px; }

.empty-field-book { padding: 28px 20px; color: var(--muted); border: 2px dashed rgba(52,50,47,.35); text-align: center; }
.empty-field-book[hidden] { display: none; }
.empty-field-book b, .empty-field-book span { display: block; }
.empty-field-book b { color: var(--graphite); font-size: 10px; letter-spacing: .08em; }
.empty-field-book span { margin-top: 6px; font: italic 11px/1.4 Georgia, serif; }
.medal-track { margin: 0 0 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.medal-track span { padding: 6px 4px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; color: #8b661d; background: rgba(230,201,133,.25); border: 1px solid rgba(139,102,29,.36); }
.medal-track b { font: 900 14px Georgia, serif; }
.medal-track small { font-size: 6px; font-weight: 900; line-height: 1.25; letter-spacing: .04em; }
.veteran-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.veteran-card { min-width: 0; padding: 12px; color: var(--graphite); background: rgba(255,253,246,.78); border: 1px solid rgba(58,53,45,.34); box-shadow: 2px 3px 0 rgba(54,47,35,.09); }
.veteran-card.active { border: 2px solid var(--blue); }
.veteran-card.wounded { opacity: .62; background: rgba(160,53,49,.06); }
.veteran-card-head { display: flex; align-items: center; gap: 8px; }
.veteran-mark { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; color: var(--blue); border: 2px solid currentColor; border-radius: 50%; font: 900 17px Georgia, serif; }
.veteran-card b, .veteran-card small, .veteran-card em { display: block; }
.veteran-card b { overflow: hidden; font: 900 13px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.veteran-card small { margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .06em; }
.veteran-buff { margin: 8px 0 5px; color: var(--blue); font-size: 7px; font-weight: 900; line-height: 1.35; }
.veteran-medals { min-height: 22px; margin: 5px 0 8px; display: flex; flex-wrap: wrap; gap: 3px; color: #8b661d; font: italic 8px/1.3 Georgia, serif; }
.veteran-medals span { padding: 2px 4px; background: rgba(230,201,133,.22); border-radius: 2px; }
.veteran-card button { width: 100%; padding: 7px; color: var(--blue); background: transparent; border: 1px dashed currentColor; font-size: 7px; font-weight: 900; }
.veteran-card button:disabled { color: var(--muted); opacity: .6; }
.front-settings-grid { margin-top: 24px; }
.fullscreen-note { margin-top: 10px !important; font-size: 10px !important; }
.android-note { margin-top: 18px; padding: 15px; color: var(--blue); background: rgba(33,79,143,.07); border: 1px dashed currentColor; }
.android-note span, .android-note b, .android-note small { display: block; }
.android-note span { font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.android-note b { margin: 4px 0; font-size: 13px; }
.android-note small { color: var(--muted); font: 10px/1.4 Georgia, serif; }

.paper-modal {
  position: absolute;
  z-index: 5;
  width: min(86%, 420px);
  left: 50%;
  top: 50%;
  padding: 27px 26px 24px;
  color: var(--graphite);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(69, 113, 151, .11) 28px 29px),
    #f8f0dc;
  border: 1px solid rgba(82, 69, 43, .22);
  /* The drawn frame used to be an absolutely positioned ::after inset 5px. In a
     scrolling box that anchors to the scroll origin, so on any card long enough
     to scroll the frame rode up and its bottom edge cut straight across the
     text. Inset shadows are painted on the border box and never scroll, so the
     frame now stays around the card at every scroll position. */
  border-radius: 48% 52% 49% 51% / 2% 3% 2% 3%;
  box-shadow:
    7px 10px 24px var(--shadow),
    inset 0 0 0 5px #f8f0dc,
    inset 0 0 0 7px rgba(54, 51, 44, .76);
  transform: translate(-50%, -50%) rotate(-.7deg);
  text-align: center;
  max-height: calc(100% - 20px);
  overflow-y: auto;
}

.paper-modal[hidden] { display: none; }

.tape {
  position: absolute;
  top: -12px;
  width: 75px;
  height: 27px;
  background: rgba(224, 207, 158, .67);
  box-shadow: inset 0 0 7px rgba(126, 105, 61, .16);
}
.tape-left { left: 20px; transform: rotate(-7deg); }
.tape-right { right: 20px; transform: rotate(6deg); }
.modal-kicker { margin: 0 0 5px; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.paper-modal h2 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(27px, 8vw, 38px);
  line-height: 1;
  transform: rotate(-.7deg);
}
.paper-modal > p:not(.modal-kicker):not(.choice-label) { margin: 0 auto 17px; max-width: 350px; font-family: Georgia, serif; font-size: 14px; line-height: 1.42; }
.briefing-steps { margin: 15px 0 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.briefing-steps span { font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.briefing-steps b { display: inline-grid; width: 22px; height: 22px; margin-right: 2px; place-items: center; color: white; background: var(--blue); border-radius: 50%; }
.briefing-steps i { width: 17px; border-top: 2px dashed var(--muted); }

.battle-options { margin: 8px 0 10px; border: 1px dashed rgba(52,50,47,.42); background: rgba(246,239,221,.48); }
.battle-options > summary { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; color: var(--blue); cursor: pointer; list-style: none; }
.battle-options > summary::-webkit-details-marker { display: none; }
.battle-options > summary::after { content: "+"; margin-left: 8px; font-size: 17px; font-weight: 900; }
.battle-options[open] > summary::after { content: "−"; }
.battle-options > summary b { font-size: 9px; letter-spacing: .1em; }
.battle-options > summary small { color: var(--muted); font-size: 6px; font-weight: 900; letter-spacing: .06em; }
.battle-options[open] { padding: 0 8px 9px; }
.battle-options[open] > summary { margin: 0 -8px 2px; }

.choice-label { position: relative; z-index: 1; margin: 8px 0 4px; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .13em; text-align: left; }
.compact-choice { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.compact-choice.mode-choice { grid-template-columns: repeat(3, 1fr); }
.compact-choice.three-choice { grid-template-columns: repeat(3, 1fr); }
.compact-choice.map-choice { grid-template-columns: repeat(3, 1fr); }
.compact-choice.map-choice .naval-option { grid-column: span 2; }
.compact-choice.map-choice .custom-option { grid-column: 1 / -1; }
.compact-choice.map-choice .wild-option { grid-column: 1 / -1; }
.compact-choice.four-choice { grid-template-columns: repeat(4, 1fr); }
.commander-explainer {
  margin: 5px 0 9px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  color: var(--blue);
  background: rgba(33,79,143,.06);
  border-left: 3px solid currentColor;
  font-size: 8px;
  line-height: 1.3;
}
.commander-explainer[hidden] { display: none; }
.commander-explainer b { font-size: 7px; letter-spacing: .06em; }
.commander-explainer span { color: var(--muted); font-family: Georgia, serif; }
.option-button { min-width: 0; padding: 6px 4px 5px; color: var(--graphite); background: rgba(246,239,221,.7); border: 1px solid rgba(58,53,45,.4); border-radius: 3px; }
.option-button b, .option-button small { display: block; }
.option-button b { font-size: 8px; }
.option-button small { margin-top: 2px; color: var(--muted); font-size: 6px; font-weight: 900; letter-spacing: .04em; }
.option-button.selected { color: var(--blue); background: white; border: 2px solid currentColor; box-shadow: 1px 2px 0 rgba(33,79,143,.15); }
.option-button:disabled { opacity: .38; }
.passplay-ink-options { padding: 1px 7px 7px; background: linear-gradient(90deg, rgba(33,79,143,.06), rgba(160,53,49,.06)); border: 1px dashed rgba(71,57,87,.35); }
.ink-budget-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ink-budget-row label { padding: 5px 7px; display: grid; grid-template-columns: 1fr 64px; align-items: center; gap: 6px; color: var(--graphite); background: rgba(246,239,221,.75); border: 1px solid rgba(58,53,45,.4); }
.ink-budget-row label span { font-size: 6px; font-weight: 900; letter-spacing: .07em; text-align: left; }
.ink-budget-row input { width: 100%; min-width: 0; padding: 5px 3px; color: var(--blue); background: white; border: 1px solid rgba(33,79,143,.5); font: 900 12px Arial, sans-serif; text-align: center; user-select: text; -webkit-user-select: text; }
.passplay-presets { margin-top: 5px; }
.passplay-budget-note { display: block; margin-top: 5px; color: var(--muted); font: italic 8px/1.3 Georgia, serif; text-align: left; }

.passplay-curtain {
  position: fixed;
  z-index: 40;
  inset: 0;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(23,60,112,.96) 0 49.5%, rgba(118,35,31,.96) 50.5% 100%),
    var(--graphite);
}
.passplay-curtain[hidden] { display: none; }
.passplay-card { position: relative; width: min(100%, 430px); padding: 30px 24px 24px; color: var(--graphite); background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(57,109,153,.1) 28px 29px), #f4ead3; border: 2px solid #403a31; box-shadow: 8px 10px 0 rgba(0,0,0,.28); text-align: center; transform: rotate(-.5deg); }
.passplay-card::before, .passplay-card::after { content: ""; position: absolute; top: -9px; width: 74px; height: 20px; background: rgba(214,193,147,.83); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.passplay-card::before { left: 14px; transform: rotate(-7deg); }
.passplay-card::after { right: 14px; transform: rotate(6deg); }
.passplay-seal { display: inline-block; margin-bottom: 11px; padding: 6px 10px 5px; color: var(--red); border: 3px double currentColor; font-size: 9px; font-weight: 900; letter-spacing: .16em; transform: rotate(2deg); }
.passplay-card h2 { margin: 4px 0 10px; color: var(--graphite); font: 900 clamp(30px, 9vw, 46px)/.95 Georgia, serif; }
.passplay-card > p:not(.modal-kicker) { margin: 0 auto 18px; max-width: 330px; font: 14px/1.45 Georgia, serif; }
.passplay-rules { margin: 0 0 20px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #674f86; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.passplay-rules i { width: 13px; border-top: 2px dashed currentColor; }
.passplay-card .ink-button { width: 100%; min-height: 50px; background: #674f86; box-shadow: 3px 4px 0 #46345d; }
.passplay-card > small { display: block; margin-top: 14px; color: var(--muted); font: italic 8px/1.35 Georgia, serif; }
.campaign-note { margin: 6px 0 2px; padding: 7px 9px; color: var(--blue); background: rgba(33,79,143,.07); border: 1px dashed currentColor; text-align: left; }
.campaign-note b, .campaign-note span { display: block; }
.campaign-note b { font-size: 8px; letter-spacing: .06em; }
.campaign-note span { margin-top: 2px; color: var(--graphite); font: italic 11px Georgia, serif; }
.upgrade-header { margin: 8px 0 4px; display: flex; justify-content: space-between; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.upgrade-header b { color: var(--blue); }
.upgrade-header i { font-style: normal; }
.upgrade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.upgrade-button { min-width: 0; padding: 6px 2px; color: var(--graphite); background: rgba(246,239,221,.72); border: 1px dashed rgba(52,50,47,.45); border-radius: 3px; }
.upgrade-button b, .upgrade-button span, .upgrade-button small { display: block; }
.upgrade-button b { font-size: 7px; }
.upgrade-button span { margin-top: 1px; color: var(--muted); font-size: 5px; font-weight: 900; }
.upgrade-button small { margin-top: 3px; color: var(--blue); font-size: 6px; font-weight: 900; }
.upgrade-button:disabled { opacity: .5; }

.page-choice {
  position: relative;
  z-index: 1;
  margin: 0 auto 17px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.page-choice-button {
  min-width: 0;
  padding: 8px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--graphite);
  background: rgba(246, 239, 221, .7);
  border: 1px solid rgba(58, 53, 45, .45);
  border-radius: 3px;
}
.page-choice-button.selected { color: var(--blue); border: 2px solid var(--blue); background: white; box-shadow: 2px 2px 0 rgba(33,79,143,.16); }
.page-choice-button span { min-width: 0; text-align: left; }
.page-choice-button b, .page-choice-button small { display: block; }
.page-choice-button b { font-size: 8px; white-space: nowrap; }
.page-choice-button small { margin-top: 2px; color: var(--muted); font-size: 6px; font-weight: 900; letter-spacing: .05em; }
.page-shape { display: block; flex: 0 0 auto; border: 2px solid currentColor; background: repeating-linear-gradient(0deg, transparent 0 6px, rgba(67, 108, 145, .15) 7px 8px); }
.portrait-shape { width: 18px; height: 25px; }
.landscape-shape { width: 27px; height: 18px; }

.ink-button {
  position: relative;
  z-index: 1;
  min-width: 190px;
  padding: 12px 17px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 3px 8px 4px 7px;
  box-shadow: 3px 4px 0 var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  transform: rotate(.5deg);
}
.ink-button:active { transform: translate(2px, 2px) rotate(.5deg); box-shadow: 1px 2px 0 var(--blue-dark); }

.result-card { transform: translate(-50%, -50%) rotate(.5deg); }
.resume-prompt { z-index: 20; width: min(88%, 390px); }
.resume-facts { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 5px 0 17px; }
.resume-facts span { padding: 9px 7px; background: rgba(33,79,143,.07); border: 1px dashed rgba(33,79,143,.48); }
.resume-facts small, .resume-facts b { display: block; }
.resume-facts small { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.resume-facts b { margin-top: 3px; color: var(--blue); font-size: 11px; }
.settings-card { width: min(84%, 370px); }
.settings-grid { position: relative; z-index: 1; margin: 4px 0 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setting-button { padding: 10px 8px; color: var(--graphite); background: rgba(248,241,222,.8); border: 2px solid currentColor; border-radius: 4px; }
.setting-button span, .setting-button b { display: block; }
.setting-button span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.setting-button b { margin-top: 2px; font-size: 12px; }
.danger-outline-button { position: relative; z-index: 1; width: 100%; margin-top: 14px; padding: 10px; color: var(--red); background: transparent; border: 2px solid currentColor; border-radius: 4px; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.settings-note { position: relative; z-index: 1; display: block; margin-top: 10px; color: var(--muted); font-family: Georgia, serif; font-size: 9px; line-height: 1.35; }
.result-stats { position: relative; z-index: 1; margin: 12px 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); }
.result-stats div { padding: 4px; border-right: 1px solid rgba(52, 48, 42, .25); }
.result-stats div:last-child { border: 0; }
.result-stats dt { font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.result-stats dd { margin: 2px 0 0; font-family: Georgia, serif; font-size: 22px; font-weight: 900; }

.battle-verdict {
  position: relative;
  z-index: 1;
  margin: 13px 0 -3px;
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  color: var(--graphite);
  background: rgba(48, 47, 45, .05);
  border: 1px solid rgba(52, 48, 42, .3);
  border-radius: 3px 9px 4px 8px;
  text-align: left;
}
.battle-verdict[hidden] { display: none; }
.battle-verdict b { font-family: Impact, sans-serif; font-size: 15px; letter-spacing: .04em; line-height: 1.05; }
.battle-verdict small { font-family: Georgia, serif; font-size: 10px; line-height: 1.35; }
.battle-verdict i { margin-top: 1px; color: var(--red); font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .1em; }

.war-stats {
  position: relative;
  z-index: 1;
  width: calc(100% - 14px);
  margin: 0 7px 10px;
  border-collapse: collapse;
  color: var(--graphite);
  text-align: left;
}
.war-stats th, .war-stats td { padding: 4px 5px; border-bottom: 1px solid rgba(52, 48, 42, .16); }
.war-stats thead th { color: var(--muted); font-size: 6px; font-weight: 900; letter-spacing: .1em; }
.war-stats thead th + th { text-align: right; }
.war-stats thead th:nth-child(2) { color: var(--blue); }
.war-stats thead th:nth-child(3) { color: var(--red); }
.war-stats tbody th { font-size: 7px; font-weight: 900; letter-spacing: .05em; }
.war-stats td { width: 23%; font-family: Georgia, serif; font-size: 12px; font-weight: 900; text-align: right; }
.war-stats td.ahead { background: rgba(52, 48, 42, .05); }
.war-stats td.ahead.blue { color: var(--blue); }
.war-stats td.ahead.red { color: var(--red); }
.war-stats tbody tr:last-child th, .war-stats tbody tr:last-child td { border-bottom: 0; }

/* Everything the table has no column for. Plain text on purpose: boxing these
   made one battle report look like four separate reports. */
.report-footnote { margin: 0 7px 10px; display: grid; gap: 3px; color: var(--muted); font: 9px/1.4 Georgia, serif; text-align: left; }
.report-footnote span:empty { display: none; }

.full-battle-report {
  position: relative;
  z-index: 1;
  margin: -7px 0 14px;
  color: var(--blue);
  border: 1px dashed currentColor;
  background: rgba(33,79,143,.035);
}
.full-battle-report[hidden] { display: none; }
.full-battle-report > summary {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .09em;
}
.full-battle-report > summary::-webkit-details-marker { display: none; }
.full-battle-report > summary::after { content: "+"; font-size: 15px; }
.full-battle-report[open] > summary::after { content: "−"; }

.progress-report {
  position: relative;
  z-index: 1;
  margin: -8px auto 17px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--blue);
  background: rgba(33, 79, 143, .08);
  border: 1px dashed currentColor;
  text-align: left;
}
.progress-report span { font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.progress-report b { font-size: 15px; }
.progress-report small { grid-column: 1 / -1; margin-top: 2px; color: var(--muted); font-family: Georgia, serif; font-size: 10px; }

.command-deck {
  position: relative;
  z-index: 3;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 2px solid rgba(57, 51, 43, .45);
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(60, 112, 159, .09) 26px 27px),
    var(--paper-deep);
  box-shadow: 0 -5px 16px rgba(48, 38, 20, .11);
}

.tool-hint {
  /* One nowrap line lost the tail of the longer hints — the Select hint, which a
     player reads while learning to give orders, dropped a third of its sentence.
     Two lines fit every hint where there is vertical room; short landscape below
     keeps a single line, where there genuinely is not. */
  /* A fixed two-line box, never min-height. Letting this grow from one line to
     two when the player switched tools resized the stage, and a stage resize
     reassigns canvas.width, which wipes the canvas — so changing tool flashed
     the whole battlefield black for one frame. The space is reserved instead. */
  height: 2.5em;
  margin: 0 4px 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--graphite);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
}

.team-switch {
  margin: 0 4px 5px;
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 4px;
}
.team-switch[hidden] { display: none; }
.team-switch span { padding-right: 4px; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.team-switch button { padding: 5px; background: rgba(248,241,222,.75); border: 1px solid currentColor; border-radius: 3px; font-size: 8px; font-weight: 900; }
.team-switch .blue { color: var(--blue); }
.team-switch .red { color: var(--red); }
.team-switch button.selected { color: white; background: var(--blue); border-width: 2px; }
.team-switch button.red.selected { background: var(--red); }

.field-library {
  margin: 0 4px 5px;
  display: grid;
  grid-template-columns: .8fr repeat(4, 1fr);
  gap: 3px;
}
.field-library[hidden] { display: none; }
.field-library button {
  min-width: 0;
  min-height: 24px;
  padding: 5px 2px;
  overflow: hidden;
  color: var(--blue);
  background: rgba(248, 241, 222, .78);
  border: 1px dashed currentColor;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-library button:first-child { color: var(--graphite); border-style: solid; }
.field-library button:disabled { opacity: .35; }

.commander-panel {
  margin: 0 4px 5px;
  padding: 5px;
  color: var(--blue);
  background: rgba(33,79,143,.055);
  border: 1px dashed currentColor;
}
.commander-panel[hidden] { display: none; }
.commander-panel.over-extended { color: var(--red); background: rgba(160,53,49,.07); }

.tutorial-coach {
  margin: 0 4px 6px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 10px;
  color: var(--blue);
  background: rgba(33,79,143,.07);
  border: 2px solid currentColor;
  border-radius: 3px 9px 4px 7px;
}
.tutorial-coach[hidden] { display: none; }
.coach-count { display: grid; justify-items: center; line-height: 1; }
.coach-count b { font: 900 18px Georgia, serif; }
.coach-count small { color: var(--muted); font-size: 7px; font-weight: 900; }
.coach-text { min-width: 0; }
.coach-text b { display: block; font-size: 11px; letter-spacing: .03em; }
.coach-text small { display: block; margin-top: 2px; color: var(--graphite); font: 9px/1.35 Georgia, serif; }
.coach-actions { display: grid; gap: 4px; }
.coach-next {
  padding: 7px 12px;
  color: #f7f1e2;
  background: var(--blue);
  border: 2px solid #16305a;
  border-radius: 3px 8px 4px 7px;
  box-shadow: 2px 3px 0 #16305a;
  font-size: 9px;
  letter-spacing: .07em;
}
.coach-next[hidden] { display: none; }
.coach-skip { padding: 3px; color: var(--muted); background: none; border: none; font-size: 7px; letter-spacing: .09em; text-decoration: underline; }
.commander-readout {
  margin-bottom: 4px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 1px 7px;
}
.commander-readout span { font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.commander-readout b { overflow: hidden; font-size: 9px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.commander-readout small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-family: Georgia, serif; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.command-buttons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.command-buttons button {
  min-width: 0;
  height: 39px;
  padding: 2px 1px;
  display: grid;
  grid-template-rows: 15px 9px 7px;
  place-items: center;
  color: var(--graphite);
  background: rgba(248,241,222,.88);
  border: 1px solid rgba(52,50,47,.45);
  border-radius: 2px;
}
.command-buttons button:active { color: white; background: var(--blue); }
.command-buttons button:disabled { opacity: .34; }
.command-buttons span { font-family: Georgia, serif; font-size: 14px; font-weight: 900; }
.command-buttons b { max-width: 100%; overflow: hidden; font-size: 6px; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.command-buttons small { color: var(--muted); font-size: 5px; font-weight: 900; }

.tool-category-bar {
  margin: 0 4px 5px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.tool-category-bar button {
  /* These are tapped constantly while an army is being built, and at 22px tall
     they were half the 44px a fingertip needs. Where the deck has the room they
     are simply bigger; short landscape keeps the small look and grows only the
     hit area, below. */
  min-height: 44px;
  min-width: 0;
  padding: 6px 2px;
  color: var(--muted);
  background: rgba(248,241,222,.7);
  border: 1px solid currentColor;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .03em;
}
.tool-category-bar button.selected { color: white; background: var(--blue); border-color: var(--blue); }
.tool-category-bar button[hidden] { display: none; }
.tool-category-bar .advanced-tools-button { color: var(--red); border-style: dashed; }
.tool-category-bar .advanced-tools-button.selected { color: white; background: var(--red); border-color: var(--red); }

.tool-scroll {
  width: 100%;
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.tool-scroll::-webkit-scrollbar { display: none; }

.tool-button {
  min-width: 68px;
  flex: 1 0 68px;
  height: 57px;
  padding: 3px 2px;
  display: grid;
  grid-template-rows: 25px 12px 10px;
  place-items: center;
  color: var(--graphite);
  background: rgba(248, 241, 222, .76);
  border: 1px solid rgba(61, 55, 47, .38);
  border-radius: 3px;
  box-shadow: 1px 2px 0 rgba(54, 47, 35, .12);
  scroll-snap-align: start;
}
.tool-button[hidden] { display: none !important; }

.tool-button.selected {
  color: var(--blue);
  border: 2px solid var(--blue);
  background: rgba(255, 253, 245, .96);
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 2px 3px 0 rgba(33, 79, 143, .19);
}
html[data-placing-team="enemy"] .tool-button.selected {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 2px 3px 0 rgba(160, 53, 49, .19);
}
.tool-button:disabled { opacity: .42; filter: grayscale(.7); }
.tool-button b { overflow: hidden; max-width: 100%; font-size: 8px; letter-spacing: .04em; text-overflow: ellipsis; }
.tool-button small { color: var(--muted); font-size: 7px; font-weight: 900; }
.tool-icon { font-family: Georgia, serif; font-size: 21px; font-weight: 900; line-height: 1; }
.tank-icon { letter-spacing: -.15em; }

.action-row {
  margin-top: 7px;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(150px, 2.15fr) minmax(72px, 1fr);
  align-items: stretch;
  gap: 7px;
}

.pencil-button {
  min-width: 0;
  color: var(--graphite);
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 3px 7px 2px 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
}

.fight-button {
  min-height: 48px;
  padding: 4px 18px 3px;
  color: white;
  background: var(--red);
  border: 2px solid #76231f;
  border-radius: 7px 3px 8px 4px;
  box-shadow: 3px 4px 0 #76231f;
  transform: rotate(-.6deg);
}
.fight-button span { display: block; font-size: 7px; font-weight: 900; letter-spacing: .15em; line-height: 8px; }
.fight-button b { display: block; font-family: Impact, sans-serif; font-size: 20px; letter-spacing: .05em; line-height: 21px; }
.fight-button:disabled { opacity: .5; filter: grayscale(.7); }
.fight-button.end-fight { background: var(--graphite); border-color: #181715; box-shadow: 3px 4px 0 #181715; }

html[data-game-phase="setup"] .action-row:has(#speedButton[hidden]) { grid-template-columns: minmax(72px, 1fr) minmax(170px, 2.4fr); }
html[data-game-phase="battle"] .tool-hint,
html[data-game-phase="battle"] .team-switch,
html[data-game-phase="battle"] .field-library,
html[data-game-phase="battle"] .tool-category-bar { display: none !important; }
html[data-game-phase="battle"] .command-deck { padding-top: 5px; }
html[data-game-phase="battle"] .tool-scroll { justify-content: center; overflow: visible; }
html[data-game-phase="battle"] .tool-button { max-width: 118px; height: 44px; flex-basis: 94px; grid-template-rows: 19px 10px 8px; }
html[data-game-phase="battle"] .tool-icon { font-size: 16px; }
html[data-game-phase="battle"] .action-row { margin-top: 5px; grid-template-columns: minmax(150px, 2fr) minmax(72px, 1fr); }
html[data-game-phase="battle"] .action-row #fightButton { grid-column: 1; }
html[data-game-phase="battle"] .action-row #speedButton { grid-column: 2; }
html[data-game-phase="resolved"] .command-deck { display: none; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(154px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(88vw, 480px);
  padding: 9px 13px;
  color: white;
  background: rgba(42, 39, 34, .93);
  border-radius: 3px;
  box-shadow: 2px 4px 10px rgba(0,0,0,.24);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 470px) {
  .app-shell { grid-template-rows: auto minmax(320px, 1fr) auto; }
  .masthead { min-height: 65px; padding-left: 9px; padding-right: 8px; gap: 6px; }
  .header-actions { gap: 4px; }
  h1 { font-size: clamp(22px, 6.2vw, 27px); }
  .eyebrow { font-size: 7px; }
  .orientation-button { min-width: 59px; padding-left: 5px; padding-right: 5px; }
  .ink-card { min-width: 62px; padding: 5px 7px; gap: 6px; }
  .ink-card strong { font-size: 17px; }
  .command-deck { padding-left: 5px; padding-right: 5px; }
  .objective-tracker { max-width: calc(100% - 68px); gap: 3px; }
  .objective-chip { min-width: 96px; padding: 3px 4px; }
  .commander-panel { margin-left: 0; margin-right: 0; padding: 4px; }
  .commander-readout { margin-bottom: 3px; }
  .command-buttons { grid-template-columns: repeat(3, 1fr); }
  .command-buttons button { height: 31px; grid-template-columns: 16px 1fr auto; grid-template-rows: 1fr; }
  .command-buttons span { font-size: 12px; }
  .command-buttons b { font-size: 6px; }
  .command-buttons small { padding-right: 2px; }
  html[data-game-phase="battle"] .command-buttons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html[data-game-phase="battle"] .command-buttons button { height: 37px; grid-template-columns: none; grid-template-rows: 14px 9px 7px; }
  html[data-game-phase="battle"] .command-buttons b { font-size: 5px; }
  html[data-game-phase="battle"] .command-buttons small { padding: 0; font-size: 4px; }
  .tool-scroll { gap: 3px; }
  .tool-button { min-width: 65px; flex-basis: 65px; height: 53px; grid-template-rows: 23px 11px 9px; }
  .tool-icon { font-size: 18px; }
  .tool-button b { font-size: 7px; }
  .action-row { gap: 5px; }
  .pencil-button { font-size: 8px; }
  .paper-modal { padding-left: 20px; padding-right: 20px; }
  .desk-paper { width: 100%; height: 100dvh; min-height: 0; margin: 0; padding: 14px 14px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; border: 0; box-shadow: none; }
  .home-paper { display: flex; flex-direction: column; overflow: hidden; }
  .home-paper .modal-kicker { margin-bottom: 3px; font-size: 7px; }
  .home-logo { font-size: 42px; }
  .home-promise { display: none; }
  .service-strip { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .service-strip { margin-bottom: 9px; }
  .service-strip span { padding: 7px 3px; }
  .service-strip b { font-size: 9px; }
  .campaign-folder { min-height: 88px; padding: 25px 14px 11px; }
  .campaign-folder .folder-tab { top: -11px; padding: 5px 12px 4px; }
  .folder-stars { top: -11px; padding: 5px 10px 4px; }
  .campaign-folder b { font-size: 16px; }
  .campaign-folder small { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .campaign-folder i { display: none; }
  /* The compact desk used to hide every mode description on phones, which left
     four unexplained labels on the platform the game is actually built for -
     with most of the sheet sitting empty below them. There is room; use it. */
  .desk-modes { margin: 10px 0; grid-template-columns: 1fr 1fr; gap: 6px; }
  .desk-mode { min-height: 96px; padding: 9px 8px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-content: center; gap: 0 7px; text-align: left; }
  .desk-mode:last-child { grid-column: auto; min-height: 96px; }
  .desk-mode span { grid-row: 1 / 3; margin: 0; align-self: center; font-size: 21px; }
  .desk-mode b { grid-column: 2; grid-row: 1; font-size: 9px; }
  .desk-mode small { display: block; grid-column: 2; grid-row: 2; margin-top: 3px; font: 8px/1.3 Georgia, serif; }
  .field-desk-nav { margin-top: auto; }
  .field-desk-nav button { min-height: 48px; padding: 6px 4px; background: rgba(33,79,143,.05); border-style: solid; border-color: rgba(33,79,143,.28); }
  .field-desk-nav span { font-size: 16px; }
  .field-desk-nav small { display: none; }
  .build-stamp { margin-top: 7px; font-size: 6px; }
  .ledger-paper .upgrade-grid { grid-template-columns: 1fr 1fr; }
  .armory-paper { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); overflow: hidden; }
  .armory-paper .paper-back { margin-bottom: 4px; }
  .armory-paper .modal-kicker, .armory-intro { display: none; }
  .armory-paper h2 { margin-bottom: 5px; font-size: 28px; }
  .armory-tabs { margin: 0 0 7px; }
  .armory-tab { padding: 6px 1px 5px; }
  .armory-tab span { font-size: 16px; }
  .armory-list { min-height: 0; overflow: hidden; }
  .armory-unit { align-self: start; padding: 10px; display: grid; grid-template-rows: auto auto; }
  .armory-unit-head { grid-template-columns: 38px 1fr auto; }
  .armory-unit-mark { width: 36px; height: 36px; font-size: 17px; }
  .armory-unit-head b { font-size: 14px; }
  .charm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
  .charm-button { min-height: 88px; padding: 8px 7px; }
  .charm-button small { margin-top: 2px; }
  .field-upgrade-drawer { margin-top: 7px; }
  .field-upgrade-drawer[open] { position: absolute; z-index: 8; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-height: calc(100% - 20px); overflow-y: auto; background: #f5ecd7; box-shadow: 0 -8px 28px rgba(45,38,26,.25); }
  #veteransScreen .ledger-paper { display: flex; flex-direction: column; overflow: hidden; }
  #veteransScreen .paper-back { margin-bottom: 4px; }
  #veteransScreen .modal-kicker { display: none; }
  #veteransScreen h2 { margin-bottom: 4px; font-size: 27px; }
  #veteransScreen .ledger-paper > p { margin-bottom: 7px; font-size: 9px; line-height: 1.3; }
  .active-roster { margin: 3px 0 6px; }
  .medal-track { margin-bottom: 7px; }
  .veteran-list { min-height: 0; grid-template-columns: 1fr 1fr; gap: 6px; overflow-y: auto; }
  .veteran-card { padding: 8px; }
  .veteran-mark { width: 30px; height: 30px; font-size: 14px; }
  .veteran-card b { font-size: 10px; }
  .veteran-card small { font-size: 6px; }
  .front-settings-grid { margin-top: 12px; grid-template-columns: 1fr 1fr; }
}

@media (orientation: landscape) and (max-height: 620px) and (min-width: 520px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .app-shell { position: relative; width: 100%; height: 100dvh; min-height: 0; display: block; overflow: clip; }
  .masthead { display: none; }
  .battle-stage { position: absolute; inset: 0; }
  .command-deck { position: absolute; z-index: 10; width: min(300px, 46vw); top: 0; right: 0; bottom: 0; padding: 5px calc(5px + env(safe-area-inset-right)) 5px 5px; display: grid; grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto; overflow: hidden; border-top: 0; border-left: 2px solid rgba(57, 51, 43, .45); transform: translateX(102%); transition: transform .2s ease; }
  html[data-landscape-tools="open"] .command-deck { transform: translateX(0); }
  .tools-toggle { position: absolute; z-index: 12; top: 8px; right: 8px; display: block; color: var(--blue); background: rgba(246,239,221,.94); transition: right .2s ease; }
  html[data-landscape-tools="open"] .tools-toggle { right: calc(min(300px, 46vw) + 8px); }
  .sound-button { top: 8px; right: 60px; }
  .menu-stage-button { top: 58px; right: 8px; }
  .orientation-nudge { display: none; }
  .tool-hint { height: 1.25em; margin-bottom: 3px; font-size: 9px; -webkit-line-clamp: 1; line-clamp: 1; }
  .tool-hint { grid-row: 1; }
  .team-switch { grid-row: 2; }
  .field-library { grid-row: 3; grid-template-columns: repeat(3, 1fr); margin: 0 0 4px; }
  .field-library button { min-height: 22px; padding: 3px 1px; font-size: 6px; }
  .commander-panel { grid-row: 4; margin: 0 0 4px; }
  .commander-readout small { font-size: 7px; }
  .command-buttons { grid-template-columns: repeat(3, 1fr); }
  .command-buttons button { height: 31px; grid-template-columns: 15px 1fr auto; grid-template-rows: 1fr; }
  .tool-category-bar { grid-row: 5; }
  .tool-scroll { grid-row: 6; }
  .action-row { grid-row: 7; }
  .tool-category-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 4px; }
  /* An earlier attempt grew only the hit area with a pseudo-element, but the gap
     below this row is 4px, so it reached 7px into the tool buttons and would
     have stolen their taps. The landscape deck's tool list is the flexible grid
     row and scrolls, so the honest fix is real height: the tabs are properly
     tappable and the tool list simply scrolls a little sooner. */
  .tool-category-bar button { min-height: 44px; padding: 5px 2px; color: var(--muted); background: rgba(248,241,222,.7); border: 1px solid currentColor; font-size: 7px; font-weight: 900; }
  .tool-category-bar button.selected { color: white; background: var(--blue); border-color: var(--blue); }
  .tool-scroll { display: grid; grid-template-columns: repeat(3, 1fr); max-height: none; overflow: hidden; align-content: start; }
  .tool-button { min-width: 0; width: 100%; height: 44px; grid-template-rows: 18px 10px 8px; }
  .tool-button[hidden] { display: none; }
  .tool-icon { font-size: 15px; }
  .tool-button b { font-size: 6px; }
  .action-row { grid-template-columns: minmax(62px, .75fr) minmax(140px, 2.25fr); }
  .action-row #undoButton { grid-column: 1; grid-row: 1; }
  .fight-button { grid-column: 2; grid-row: 1; }
  html[data-game-phase="battle"] .action-row #fightButton { grid-column: 1; grid-row: 1; }
  html[data-game-phase="battle"] .action-row #speedButton { grid-column: 2; grid-row: 1; }
  .toast { bottom: 18px; }
  html[data-front-screen="open"] .battle-stage { height: 100%; min-height: 0; }
  html[data-front-screen="open"] .front-screen { overflow: hidden; }
  /* Short landscape is the tightest layout in the game, and hard-clipping it
     silently swallowed the tail of the Settings sheet with no way to reach
     it. Scrolling only engages when something genuinely does not fit. */
html[data-front-screen="open"] .desk-paper { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 9px 12px; overflow-y: auto; border: 0; box-shadow: none; }
  .home-paper { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 38px 31px minmax(0, 1fr) 44px; grid-template-areas: "title title" "stats stats" "campaign modes" "nav nav"; gap: 6px 9px; }
  .home-paper .modal-kicker, .home-promise, .home-paper .build-stamp { display: none; }
  .home-logo { grid-area: title; align-self: center; font-size: 37px; }
  .service-strip { grid-area: stats; height: 31px; margin: 0; }
  .service-strip span { padding: 4px 3px; }
  .service-strip b { font-size: 8px; }
  .campaign-folder { grid-area: campaign; min-height: 0; height: 100%; padding: 25px 16px 10px; }
  .campaign-folder .folder-tab { top: -10px; padding: 5px 12px 4px; }
  .folder-stars { top: -10px; padding: 5px 9px 4px; }
  .campaign-folder b { font-size: 17px; }
  .campaign-folder small { margin: 3px 0; max-height: 34px; overflow: hidden; }
  .desk-modes { grid-area: modes; height: 100%; margin: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: auto repeat(4, 1fr); gap: 4px; }
  .desk-mode, .desk-mode:last-child { min-height: 0; padding: 5px 9px; display: grid; grid-template-columns: 30px 1fr; align-items: center; text-align: left; }
  .desk-mode span { grid-row: 1 / 3; margin: 0; font-size: 18px; }
  .desk-mode b, .desk-mode small { grid-column: 2; }
  .desk-mode small { display: none; }
  .field-desk-nav { grid-area: nav; gap: 5px; }
  .field-desk-nav button { padding: 4px; display: grid; grid-template-columns: auto auto; align-content: center; justify-content: center; gap: 0 6px; }
  .field-desk-nav span { grid-row: 1 / 3; font-size: 15px; }
  .field-desk-nav b { margin: 0; font-size: 7px; }
  .field-desk-nav small { font-size: 5px; }
  #armoryScreen .armory-paper { display: grid; grid-template-columns: 205px minmax(0, 1fr); grid-template-rows: 38px 43px minmax(0, 1fr); grid-template-areas: "back tabs" "title unit" "upgrades unit"; gap: 5px 10px; }
  #armoryScreen .paper-back { grid-area: back; margin: 0; align-self: start; justify-self: start; }
  #armoryScreen .modal-kicker, #armoryScreen .armory-intro { display: none; }
  #armoryScreen h2 { grid-area: title; margin: 0; align-self: center; font-size: 27px; }
  .armory-tabs { grid-area: tabs; margin: 0; }
  .armory-tab { padding: 4px 1px; }
  .armory-tab span { font-size: 14px; }
  .armory-tab b { margin-top: 2px; font-size: 5px; }
  .armory-list { grid-area: unit; min-height: 0; overflow: hidden; }
  .armory-unit { align-self: start; padding: 8px; display: grid; grid-template-rows: auto auto; }
  .armory-unit-head { grid-template-columns: 37px 1fr auto; }
  .armory-unit-mark { width: 35px; height: 35px; font-size: 16px; }
  .armory-unit-head b { font-size: 14px; }
  .charm-grid { min-height: 0; grid-template-columns: repeat(3, 1fr); align-content: start; }
  .charm-button { min-height: 82px; padding: 6px; }
  .field-upgrade-drawer { grid-area: upgrades; min-height: 0; margin: 0; align-self: start; overflow-y: auto; }
  .field-upgrade-drawer summary { padding: 8px; }
  .field-upgrade-drawer .upgrade-grid { grid-template-columns: 1fr 1fr; }
  .ledger-paper .upgrade-button { padding: 5px 3px; }
  #veteransScreen .ledger-paper { display: grid; grid-template-columns: 205px minmax(0, 1fr); grid-template-rows: 36px 40px 42px minmax(0, 1fr); grid-template-areas: "back roster" "title roster" "active roster" "medals roster"; gap: 5px 10px; }
  #veteransScreen .paper-back { grid-area: back; margin: 0; justify-self: start; }
  #veteransScreen .modal-kicker, #veteransScreen .ledger-paper > p { display: none; }
  #veteransScreen h2 { grid-area: title; margin: 0; align-self: center; font-size: 24px; }
  #veteransScreen .active-roster { grid-area: active; margin: 0; align-self: center; }
  #veteransScreen .medal-track { grid-area: medals; margin: 0; align-self: start; grid-template-columns: 1fr; }
  #veteransScreen .medal-track span { padding: 4px; }
  #veteransScreen .veteran-list, #veteransScreen .empty-field-book { grid-area: roster; min-height: 0; overflow-y: auto; }
  #veteransScreen .veteran-list { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .veteran-card { padding: 7px; }
  .veteran-mark { width: 29px; height: 29px; font-size: 13px; }
  .veteran-card b { font-size: 9px; }
  .veteran-buff { margin: 5px 0 3px; font-size: 6px; }
  .veteran-medals { margin: 3px 0 5px; min-height: 16px; font-size: 6px; }
  #frontSettingsScreen .settings-paper { max-width: 720px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; gap: 6px 14px; align-content: center; }
  #frontSettingsScreen .paper-back { grid-column: 1 / -1; margin: 0; justify-self: start; }
  #frontSettingsScreen .modal-kicker, #frontSettingsScreen > p { display: none; }
  #frontSettingsScreen h2 { margin: 0; font-size: 25px; }
  #frontSettingsScreen .front-settings-grid { margin: 0; grid-template-columns: 1fr 1fr; }
  #frontSettingsScreen .fullscreen-note { margin: 0 !important; align-self: center; }
  #frontSettingsScreen .android-note { margin: 0; padding: 9px; }
}

/* The armed order is the one live state in the command row, so it is the one
   thing in it that looks pressed. */
.command-buttons button.armed {
  color: var(--paper);
  background: var(--blue);
  border-color: var(--blue);
}

/* --- Armory and Field Book -------------------------------------------------
   Both screens carried rich content behind a layout that broke the moment the
   viewport stopped being a phone: tabs and cards ran off the right edge, and
   veteran names printed on top of each other. The grids below size to what is
   available instead of to a fixed column. */
.armory-slots {
  margin: 6px 0 10px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--graphite);
}
.armory-slots b { color: var(--blue); }

.charm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.charm-button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  padding: 8px;
  text-align: left;
}
.charm-button em {
  margin-top: auto;
  align-self: flex-start;
  padding: 2px 6px;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  border: 1px dashed currentColor;
}
.charm-button.locked { opacity: .72; }
.charm-button.locked em { color: var(--red); }
.charm-button.equipped { color: var(--paper); background: var(--blue); border-color: var(--blue); }
.charm-button.equipped b, .charm-button.equipped small, .charm-button.equipped em { color: var(--paper); }
.charm-button.equipped small { opacity: .92; }
.charm-button.equipped em { border-style: solid; }
.charm-button.blocked { opacity: .45; }
.charm-button:disabled { cursor: not-allowed; }

.veteran-trait {
  margin-top: 5px;
  padding: 5px 7px;
  border-left: 3px solid var(--blue);
  background: rgba(33, 79, 143, .07);
}
.veteran-trait b { display: block; font-size: 11px; letter-spacing: .1em; color: var(--blue); }
.veteran-trait small { display: block; margin-top: 1px; font-size: 10.5px; line-height: 1.3; }
.veteran-trait.pending { border-left-color: rgba(52, 50, 47, .3); background: rgba(52, 50, 47, .05); }
.veteran-trait.pending b { color: var(--graphite); opacity: .7; }

/* Accolade & Medal Case */
.accolade-case {
  margin: 16px 0 20px;
  padding: 12px;
  background: rgba(33, 79, 143, .04);
  border: 1.5px dashed rgba(33, 79, 143, .3);
}
.accolade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.accolade-header h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--blue);
}
.accolade-header span {
  font-size: 11px;
  font-weight: 700;
  color: var(--graphite);
}
.accolade-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.accolade-card {
  padding: 8px;
  background: var(--paper);
  border: 1px solid rgba(52, 50, 47, .2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.accolade-card.unlocked {
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(33, 79, 143, .12);
}
.accolade-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accolade-star {
  font-size: 14px;
  color: var(--blue);
}
.accolade-card:not(.unlocked) .accolade-star {
  color: rgba(52, 50, 47, .3);
}
.accolade-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--blue);
}
.accolade-card:not(.unlocked) .accolade-tag {
  color: rgba(52, 50, 47, .4);
}
.accolade-card b {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--graphite);
}
.accolade-card:not(.unlocked) b {
  opacity: .6;
}
.accolade-card small {
  font-size: 9.5px;
  line-height: 1.25;
  color: var(--graphite);
  opacity: .8;
}

/* Expedition Screen */
.expedition-paper {
  max-width: 520px;
}
.expedition-status-bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(33, 79, 143, .08);
  border: 1px solid rgba(33, 79, 143, .2);
  margin-bottom: 14px;
}
.expedition-trail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.expedition-stage {
  padding: 10px;
  background: var(--paper);
  border: 1.5px solid rgba(52, 50, 47, .25);
}
.expedition-stage.current {
  border-color: var(--blue);
  background: rgba(33, 79, 143, .03);
}
.expedition-stage.completed {
  opacity: .6;
  border-style: dashed;
}
.expedition-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.expedition-node-card {
  padding: 8px;
  border: 1px solid rgba(52, 50, 47, .2);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.expedition-node-card.selected {
  border-color: var(--blue);
  background: rgba(33, 79, 143, .1);
}
.expedition-node-card b {
  font-size: 11px;
}
.expedition-node-card small {
  font-size: 9.5px;
  line-height: 1.2;
}
