/* Battlefield presentation: compact classic-strategy HUD over a painted space map. */
:root {
  --bg: #112a3c;
  --panel: #202a2e;
  --panel2: #303d40;
  --line: #59635d;
  --gold: #e2ce8b;
  --cyan: #b4d7d9;
  --text: #eeeedd;
  --muted: #afbdbb;
}
html,
body,
#app {
  height: 100%;
  overflow: hidden;
}
body {
  background: #102a3d;
}
button {
  border-radius: 2px;
  border-color: #6c776f;
  background: linear-gradient(#46514e, #293433);
  box-shadow:
    inset 0 1px 0 #a9b49b37,
    0 2px 4px #0006;
  text-shadow: 0 1px 2px #0008;
}
button:hover:not(:disabled) {
  background: linear-gradient(#60706b, #3b4c49);
  border-color: #c1c5a4;
}
.primary {
  background: linear-gradient(#c5b878, #918246);
  border-color: #d5c893;
  color: #182420;
  text-shadow: 0 1px 0 #fff3;
}
.primary:hover:not(:disabled) {
  background: linear-gradient(#dccc89, #ab9e5b);
}
button.ghost {
  background: linear-gradient(#273635db, #192925dd);
  border-color: #60706670;
}
h1,
h2,
h3 {
  font-family: Georgia, 'Times New Roman', serif;
}
.topbar {
  position: fixed;
  z-index: 8;
  top: 12px;
  left: 17px;
  right: 17px;
  height: 53px;
  min-height: 0;
  gap: 16px;
  padding: 0 15px;
  border: 1px solid #8b967770;
  background: linear-gradient(180deg, #202f31f5, #111f29f0);
  box-shadow:
    inset 0 1px 0 #d1d0a829,
    0 4px 12px #0006;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 14px));
}
.brand {
  min-width: 175px;
  gap: 8px;
}
.brand h1 {
  font-size: 19px;
  color: #ece2b7;
}
.brand small {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #a9b6b0;
}
.mark {
  font-size: 28px;
  color: #c7bd81;
}
.resources {
  justify-content: flex-start;
  gap: 25px;
}
.resource {
  display: flex;
  align-items: center;
  gap: 8px;
}
.resource .label {
  font-size: 0;
  letter-spacing: 0;
  display: block;
}
.resource-symbol {
  font:
    21px Georgia,
    serif;
  color: #ede9cc;
  font-style: normal;
  vertical-align: middle;
}
.resource b {
  font:
    700 17px 'Trebuchet MS',
    Arial,
    sans-serif;
  margin: 0;
  text-shadow: 0 2px 2px #000;
}
.resource b small {
  display: none;
}
.resource:last-child .label {
  font-size: 9px;
  letter-spacing: 0.4px;
}
.top-actions {
  gap: 5px;
  margin-left: auto;
}
.top-actions button {
  padding: 6px 9px;
  font-size: 12px;
}
.workbench {
  position: fixed;
  inset: 0;
  display: block;
  height: auto;
}
.theater {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  display: block;
  background: none;
}
.theater-head {
  position: absolute;
  top: 83px;
  left: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
  text-shadow: 0 2px 4px #000;
}
.theater-head h2 {
  font-size: 24px;
  color: #e1dfc6;
  margin-top: 5px;
}
.theater-head .label {
  font-size: 11px;
  color: #cad5cd !important;
  font-weight: bold;
  letter-spacing: 1.2px;
}
.objective {
  max-width: 300px;
  color: #d4dbd4;
  font-size: 12px;
  border-right: 2px solid #b6b58f7a;
  padding-right: 12px;
}
.map-wrap {
  position: absolute;
  inset: 0;
  min-height: 0;
}
.map-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-tools {
  top: 147px;
  right: 25px;
  z-index: 4;
  flex-direction: column;
}
.map-tools button {
  width: 35px;
  min-width: 35px;
  background: linear-gradient(#374c50dd, #152c39ee);
  border-color: #82969288;
  padding: 7px;
  font-size: 14px;
}
.map-legend {
  bottom: 193px;
  left: 25px;
  gap: 10px;
  font-size: 10px;
  opacity: 0.8;
}
.map-legend span:nth-child(n + 3) {
  display: none;
}
/* The map already shows selections and tactical highlights directly.
   Remove the redundant floating terrain/hover text (e.g. "Ocean"). */
.map-caption {
  display: none;
  position: absolute;
  bottom: 160px;
  left: 25px;
  right: 25px;
  z-index: 3;
  padding: 0;
  background: none;
  border: 0;
  min-height: 18px;
  color: #acbfc2;
  font-size: 11px;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.map-caption span:last-child {
  font-size: 10px;
}
.footer {
  position: fixed;
  bottom: 14px;
  left: 23px;
  right: 23px;
  z-index: 8;
  height: 43px;
  padding: 0;
  border: 0;
  background: none;
  gap: 18px;
  justify-content: flex-end;
  pointer-events: none;
}
.footer > * {
  pointer-events: auto;
}
.footer-actions {
  gap: 7px;
}
.footer .end {
  min-width: 175px;
  height: 43px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.footer .small {
  height: 39px;
  padding: 8px 15px;
  font-size: 12px;
  background: linear-gradient(#384a4be8, #192c34f5);
  border-color: #85908477;
}
.turn-status {
  font-size: 12px;
  padding: 8px 13px;
  background: #0e222bd9;
  color: #d4dbc7;
  border-left: 2px solid #c5bf7e;
}
.turn-status small {
  font-size: 10px;
  color: #a0b5b8;
  margin-left: 9px;
}
.side {
  position: fixed;
  top: 145px;
  left: 23px;
  bottom: 180px;
  z-index: 12;
  width: 310px;
  max-height: none;
  overflow-y: auto;
  padding: 25px 20px 20px;
  display: none;
  border: 1px solid #8b987d99;
  background: linear-gradient(135deg, #293636f5, #15252ff7);
  box-shadow: 0 10px 35px #000a;
  scrollbar-color: #748275 #15252f;
}
.side.open {
  display: block;
}
.side > section {
  margin: 0 0 23px;
}
.drawer-close {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  line-height: 1;
  padding: 4px 8px;
  font-size: 20px;
}
.side .label {
  font-size: 11px;
}
.side .unit-select {
  margin-top: 12px;
  margin-bottom: 19px;
}
.side-title {
  clear: both;
}
.side .description {
  color: #b7c9c9;
}
.side .unit-name {
  font-size: 27px;
  margin: 0 0 13px;
}
.side .stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.side .stat-grid .label {
  font-size: 10px;
  letter-spacing: 1px;
}
.side .stat-grid b {
  font: 18px 'Courier New';
}
.select {
  background: #192c32;
  border-color: #697f7d;
  color: #e6e7d6;
}
.bar {
  background: #162124;
  height: 5px;
  border: 1px solid #0a1518;
}
.bar > i {
  background: #9fbd65;
}
.side .admiral-card {
  min-height: 104px;
  background: #263632;
  border-color: #8c8b6a;
}
.admiral-card .portrait-art {
  float: left;
  width: 57px;
  height: 76px;
  margin-right: 12px;
  border: 1px solid #c3b67e;
}
.side .actions button {
  font-size: 13px;
}
.side .section-divider {
  border-color: #66766e70;
}
.dispatch {
  border-color: #8a977d;
  font-size: 12px;
}
.status {
  border-radius: 0;
  border-color: #77948566;
}
.status.ready {
  color: #d6dfb6;
  border-color: #b7bd8277;
}
.status-line {
  gap: 5px;
}
.chip {
  border-radius: 0;
  background: #8a9b8830;
  color: #d9e1c7;
}
.selection-dock {
  position: fixed;
  bottom: 69px;
  left: 23px;
  z-index: 7;
  min-height: 86px;
  max-width: calc(100vw - 46px);
  width: max-content;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 8px 7px;
  background: linear-gradient(120deg, #1c3038f0, #0b202dea);
  border: 1px solid #83928188;
  box-shadow:
    inset 0 1px 0 #fff1,
    0 5px 20px #0006;
}
.dock-visual {
  position: relative;
  width: 98px;
  height: 78px;
  flex-shrink: 0;
  background: radial-gradient(ellipse, #46626955, transparent 75%);
}
.dock-visual .ship-art {
  position: absolute;
  width: 110px;
  height: 110px;
  left: -6px;
  top: -16px;
}
.dock-visual .dock-portrait {
  position: absolute;
  width: 31px;
  height: 39px;
  left: 0;
  top: -8px;
  border: 1px solid #d6c185;
  z-index: 2;
  box-shadow: 0 1px 4px #000;
}
.faction-flag {
  position: absolute;
  bottom: 2px;
  left: 4px;
  width: 19px;
  height: 19px;
  border: 2px solid #e2dfc5;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: bold 11px Georgia;
  color: #fff5d0;
  box-shadow: 0 1px 3px #000;
  background: #817178;
}
.dock-unit {
  min-width: 190px;
  max-width: 245px;
}
.dock-unit .label {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #bac9c9;
  display: block;
  margin-bottom: 5px;
}
.dock-unit strong {
  display: block;
  font: 19px Georgia;
  color: #f0e4b8;
  margin-bottom: 8px;
}
.dock-health {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dock-health .bar {
  width: 100px;
  height: 5px;
  flex-shrink: 0;
}
.dock-health span {
  font: 10px 'Courier New';
  color: #c4d1c7;
}
.dock-unit p {
  font-size: 10px;
  line-height: 1.4;
  color: #a9bfbd;
  margin-top: 6px;
}
.dock-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-left: 9px;
  flex-wrap: wrap;
  max-width: 320px;
}
.dock-actions button {
  font-size: 12px;
  padding: 9px 12px;
}
.goto-line {
  color: #ffd76a;
}
.dock-group-label {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(244, 205, 116, 0.45);
  border-radius: 4px;
  color: #f1d68b;
  font: 10px/1.2 sans-serif;
  vertical-align: middle;
  white-space: nowrap;
}
.dock-actions .fire-button {
  background: linear-gradient(#ac6452, #71372d);
  border: 1px solid #e6a176;
  color: #ffebce;
  font-weight: bold;
  min-width: 105px;
}
.firing-estimate {
  display: block;
  flex-basis: 100%;
  font-size: 11px;
  color: #e2be9a;
  line-height: 1.4;
}
.dock-idle {
  padding: 6px 12px;
  max-width: 360px;
}
.dock-idle .label {
  font-size: 10px;
}
.dock-idle strong {
  display: block;
  font: 19px Georgia;
  color: #e7ddbb;
  margin: 7px 0;
}
.dock-idle p {
  font-size: 11px;
  color: #aebfba;
}
.ship-art {
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
  pointer-events: none;
}
.portrait-art {
  position: relative;
  display: block;
  width: 60px;
  height: 80px;
  flex-shrink: 0;
  pointer-events: none;
}
.panel-ship {
  margin: -12px auto -8px;
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 8px 5px #0007);
}
.catalog-ship {
  width: 178px;
  height: 178px;
  margin: -21px auto -24px;
  filter: drop-shadow(0 8px 7px #0007);
}
.unit-card {
  background: linear-gradient(145deg, #293b3d, #172831);
  border-color: #78827677;
  border-radius: 2px;
  padding: 20px;
  min-height: 310px;
}
.unit-card .unit-code {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #142933bd;
  border-color: #789b9c80;
  color: #d0dabe;
  font-size: 11px;
  padding: 4px 6px;
}
.unit-card h3 {
  font-size: 22px;
  color: #e8e1be;
  margin: 12px 0;
  min-height: 50px;
}
.unit-card p {
  color: #b7c9c9;
}
.unit-spec {
  color: #d0d7c1 !important;
}
.unit-card .cost {
  color: #d9d199;
}
.dialog {
  background: linear-gradient(130deg, #314144, #172a35 75%);
  border-color: #a5ad8d88;
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 #c9d6ae22,
    0 25px 90px #000b;
}
.overlay {
  backdrop-filter: blur(4px);
  background: #03111dbb;
}
.dialog h1 {
  color: #ede1b0;
}
.dialog > p {
  color: #bfcfcb;
}
.eyebrow {
  color: #d5c790;
}
.dialog-head h2 {
  color: #e4dfbd;
}
.dialog-head p {
  color: #b6c7c3;
}
.dialog-footer {
  border-color: #8591785e;
}
.faction {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #394b48, #1a2d37);
  border-color: #7889718c;
  padding: 22px 24px 22px 120px;
  min-height: 226px;
}
.faction.active {
  background: linear-gradient(130deg, #46554b, #254549);
  border-color: #c5ce94;
}
.faction h3 {
  font-size: 26px;
  position: relative;
}
.faction p {
  color: #c1d0c8;
  position: relative;
}
.faction .label {
  position: relative;
}
.faction .select-mark {
  position: relative;
  color: #e0e5bd;
  font-size: 12px;
}
.faction-portrait {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 116px;
  height: 190px;
  mask-image: linear-gradient(to right, #000 65%, transparent 100%);
  opacity: 0.95;
}
.faction .label {
  font-size: 10px;
  letter-spacing: 1px;
}
.faction.britannia {
  border-top-color: #b48cf0;
}
.faction.eu {
  border-top-color: #6fa6e8;
}
.faction.cf {
  border-top-color: #e8806a;
}
.badge {
  border-color: #82927c88;
  color: #c5d1bf;
  background: #152b3255;
}
.officer {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 23px 23px 23px 137px;
  background: linear-gradient(130deg, #35413b, #1b3039);
  border-color: #8e927077;
  border-radius: 2px;
}
.officer-portrait {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 125px;
  mask-image: linear-gradient(to right, #000 75%, transparent);
}
.officer h3 {
  font-size: 24px;
  position: relative;
}
.officer p {
  font-size: 13px;
  line-height: 1.6;
  color: #bdcfca;
  position: relative;
  min-height: 94px;
}
.officer button {
  position: relative;
}
.stars {
  color: #dacf9c;
}
.tech-card {
  background: linear-gradient(135deg, #314145, #1b303b);
  border-color: #798e8180;
  border-radius: 2px;
}
.tech-card h3 {
  color: #e5dfb8;
}
.tech-card p {
  color: #bdcecb;
}
.tech-levels i {
  background: #4b625e;
}
.tech-levels i.unlocked {
  background: #c9c58f;
}
.info-strip {
  background: #132d3a70;
  border-color: #79988d55;
  color: #c2d4d1;
}
.tabs button.active {
  background: #677552;
  color: #f3f0cf;
  border-color: #bec397;
}
#toast {
  bottom: 75px;
  background: #334843f5;
  border-color: #a7b390;
  color: #f4f2d9;
  font-size: 13px;
  box-shadow: 0 6px 20px #0007;
}
.target-box {
  background: #503b30b8;
  border-color: #bc8d6a88;
}
.target-box h3 {
  color: #f6dfb5;
}
.target-box button {
  border-color: #dbaa7a;
  background: linear-gradient(#c3a671, #917248);
  color: #221e11;
}
.side .target-box .label {
  color: #e6bd93;
}
@media (max-width: 1100px) {
  .brand {
    display: none;
  }
  .topbar {
    gap: 10px;
  }
  .resources {
    gap: 21px;
  }
  .selection-dock {
    gap: 9px;
  }
  .dock-unit {
    min-width: 170px;
  }
  .dock-actions {
    max-width: 320px;
  }
  .footer .end {
    min-width: 158px;
  }
  .objective {
    max-width: 260px;
  }
  .top-actions button {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  .topbar {
    top: 8px;
    left: 9px;
    right: 9px;
    height: auto;
    min-height: 47px;
    padding: 8px 11px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .resources {
    order: 0;
    flex-basis: auto;
    gap: 14px;
    justify-content: flex-start;
    flex: 1;
  }
  .resource b {
    font-size: 15px;
  }
  .resource-symbol {
    font-size: 18px;
  }
  .resource:last-child {
    display: none;
  }
  .top-actions button {
    padding: 6px;
    font-size: 10px;
  }
  .top-actions button:nth-child(3) {
    display: none;
  }
  .theater-head {
    top: 73px;
    left: 15px;
    right: 15px;
  }
  .theater-head h2 {
    font-size: 20px;
  }
  .objective {
    font-size: 10px;
    max-width: 185px;
  }
  .map-tools {
    top: 135px;
    right: 14px;
  }
  .theater {
    height: 100%;
    min-height: 0;
  }
  .map-wrap {
    height: 100%;
    min-height: 0;
  }
  .map-caption {
    bottom: 176px;
    left: 15px;
    right: 15px;
    font-size: 10px;
  }
  .map-caption > span:last-child {
    display: none;
  }
  .map-legend {
    display: none;
  }
  .selection-dock {
    bottom: 67px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    min-height: 94px;
    padding: 7px 10px 7px 4px;
    gap: 8px;
  }
  .dock-visual {
    width: 72px;
    height: 70px;
  }
  .dock-visual .ship-art {
    width: 90px;
    height: 90px;
    left: -8px;
    top: -5px;
  }
  .dock-unit {
    min-width: 0;
    max-width: none;
    flex: 1;
  }
  .dock-unit strong {
    font-size: 17px;
    margin-bottom: 7px;
  }
  .dock-unit .label {
    font-size: 9px;
    letter-spacing: 0.4px;
  }
  .dock-health .bar {
    width: 75px;
  }
  .dock-health span {
    font-size: 9px;
  }
  .dock-unit p {
    font-size: 9px;
  }
  .dock-actions {
    margin-left: 3px;
    max-width: 175px;
    gap: 5px;
    flex-direction: column;
    align-items: stretch;
  }
  .dock-actions button {
    font-size: 11px;
    padding: 6px 10px;
  }
  .dock-actions button.ghost:not([data-action='cancel-target']) {
    display: none;
  }
  .firing-estimate {
    font-size: 10px;
    max-width: 145px;
  }
  .footer {
    bottom: 11px;
    left: 12px;
    right: 12px;
    height: 43px;
    gap: 8px;
  }
  .footer .small {
    font-size: 11px;
    padding: 7px 10px;
  }
  .footer .end {
    min-width: 123px;
    font-size: 12px;
  }
  .footer-actions {
    gap: 5px;
  }
  .turn-status {
    font-size: 10px;
    padding: 6px 9px;
  }
  .turn-status small {
    display: none;
  }
  .side {
    top: 124px;
    bottom: 174px;
    left: 12px;
    width: min(320px, calc(100vw - 24px));
    padding: 25px 18px;
    display: none;
  }
  .side.open {
    display: block;
  }
  .side .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .side .description {
    font-size: 13px;
  }
  .side .section-divider {
    display: block;
  }
  .faction {
    padding: 19px 17px 19px 80px;
    min-height: 225px;
  }
  .faction-portrait {
    width: 86px;
    height: 180px;
    opacity: 0.7;
  }
  .faction h3 {
    font-size: 24px;
  }
  .faction p {
    font-size: 12px;
  }
  .faction .label {
    font-size: 9px;
  }
  .officer {
    padding-left: 123px;
  }
  .officer-portrait {
    width: 114px;
  }
  .officer h3 {
    font-size: 23px;
  }
  .dock-idle {
    max-width: 240px;
    padding: 5px 8px;
  }
  .dock-idle strong {
    font-size: 17px;
  }
  .dock-idle p {
    font-size: 10px;
  }
  #toast {
    bottom: 75px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .resources {
    gap: 9px;
  }
  .resource {
    gap: 4px;
  }
  .resource b {
    font-size: 14px;
  }
  .resource-symbol {
    font-size: 16px;
  }
  .top-actions {
    gap: 3px;
  }
  .top-actions button {
    font-size: 10px;
    padding: 6px 5px;
  }
  .objective {
    max-width: 142px;
    font-size: 9px;
  }
  .theater-head .label {
    font-size: 9px;
  }
  .theater-head h2 {
    font-size: 18px;
  }
  .dock-visual {
    width: 58px;
  }
  .dock-visual .ship-art {
    width: 79px;
    height: 79px;
    left: -8px;
    top: 0;
  }
  .dock-visual .dock-portrait {
    width: 25px;
    height: 32px;
    left: -1px;
    top: 0;
  }
  .dock-unit {
    max-width: 180px;
  }
  .dock-unit strong {
    font-size: 16px;
  }
  .dock-health .bar {
    width: 60px;
  }
  .dock-health span {
    font-size: 8px;
  }
  .dock-actions {
    max-width: 106px;
  }
  .dock-actions button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .dock-actions .fire-button {
    min-width: 87px;
  }
  .dock-unit p {
    font-size: 8px;
  }
  .footer .small {
    padding: 7px;
    font-size: 10px;
  }
  .footer .small[data-action='details'] {
    display: none;
  }
  .footer .end {
    min-width: 105px;
    font-size: 11px;
  }
  .turn-status {
    max-width: 110px;
    font-size: 10px;
  }
  .dialog h1 {
    font-size: 32px;
  }
  .faction {
    padding: 15px 13px;
    min-height: 240px;
  }
  .faction-portrait {
    height: 175px;
    width: 95px;
    opacity: 0.24;
    left: auto;
    right: 0;
    mask-image: linear-gradient(to left, #000, transparent);
  }
  .faction h3 {
    font-size: 23px;
  }
  .faction .label {
    font-size: 9px;
  }
  .choice-grid {
    gap: 9px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .catalog-ship {
    width: 185px;
    height: 185px;
  }
  .unit-card {
    min-height: 285px;
  }
  .dock-idle {
    max-width: 240px;
  }
  .dock-idle p {
    max-width: 195px;
  }
  .side .stat-grid .label {
    font-size: 10px;
  }
  .selection-dock {
    gap: 4px;
  }
}
.ship-art,
.portrait-art {
  background-image: none;
}
.ship-art > svg,
.portrait-art > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.portrait-art > svg {
  border-radius: inherit;
}

.weapon-focus {
  display: block;
  margin: 0.4rem 0;
  color: var(--gold);
  font-size: 0.875rem;
  line-height: 1.4;
}
.unit-card .unit-spec {
  gap: 6px 10px;
}

/* ---- Battlefield iconography: resource tokens, stat glyphs, hull rings, undo ---- */
.ico {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.3em;
  flex-shrink: 0;
  overflow: visible;
}
.resource .res-icon {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 2px #000c);
}
.resource {
  gap: 6px;
}
.label .ico {
  width: 15px;
  height: 15px;
  margin-right: 3px;
  vertical-align: -3px;
}
.cost-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.cost-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-weight: 700;
}
.cost-ico {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
.unit-spec span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.unit-spec .ico {
  width: 16px;
  height: 16px;
}
.hp-ring {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.hp-ring text {
  font:
    bold 10px 'Trebuchet MS',
    Arial,
    sans-serif;
  fill: #eef3e6;
}
.hp-ring-lg {
  width: 46px;
  height: 46px;
}
.side .hp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.side .hp-row .mono {
  margin-left: auto;
}
.dock-stats {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.dock-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font:
    700 13px 'Trebuchet MS',
    Arial,
    sans-serif;
  color: #eef0dc;
}
.dock-stats .stat .ico {
  width: 18px;
  height: 18px;
}
.undo-button {
  background: linear-gradient(#2f6a58, #173d33) !important;
  border-color: #6fe0b6 !important;
  color: #e6fff4;
}
.undo-button:hover:not(:disabled) {
  background: linear-gradient(#3b836d, #1d4b3f) !important;
}
.undo-button:disabled {
  background: linear-gradient(#394341, #252e2d) !important;
  border-color: #6a7974 !important;
  color: #bfcbc4 !important;
  opacity: 0.7;
  cursor: not-allowed;
}
.faction-flag.britannia {
  background: #5d1818;
  border-color: #e6c56a;
}
.faction-flag.eu {
  background: #214783;
  border-color: #d3dbe2;
}
.faction-flag.cf {
  background: #5c1512;
  border-color: #f2c14e;
}
.faction-flag.neutral {
  background: #45402f;
  border-color: #e6dfc0;
}
@media (max-width: 760px) {
  .resource .res-icon {
    width: 22px;
    height: 22px;
  }
  .resource {
    gap: 3px;
  }
  .dock-stats {
    gap: 6px;
  }
  .dock-stats .stat {
    font-size: 11px;
  }
  .dock-stats .stat .ico {
    width: 14px;
    height: 14px;
  }
  .dock-stats .hp-ring {
    width: 30px;
    height: 30px;
  }
}
@media (max-width: 500px) {
  .resources {
    gap: 7px;
  }
  .resource .res-icon {
    width: 18px;
    height: 18px;
  }
  .resource b {
    font-size: 12px;
  }
  .footer .undo-button .kbd {
    display: none;
  }
}

/* ---- Station buildings, fortress gun, scenarios, air wings ---- */
.buildings {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.building {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 10px 12px;
  border: 1px solid #66766e70;
  background: #132d3a70;
}
.building .level {
  color: #e2ce8b;
  letter-spacing: 2px;
}
.building > small {
  grid-column: 1 / -1;
  color: #aebfba;
  font-size: 11px;
  line-height: 1.5;
}
.building button {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.fortress-gun {
  background: #3b2a1cb8;
  border-color: #e2b46f88;
}
.mode-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #bfcfcb;
}
.star-rating {
  font-size: 34px;
  letter-spacing: 6px;
  color: #f2c94c;
  text-shadow: 0 2px 6px #000a;
  margin: 10px 0 4px;
}
.objective b {
  color: #e2ce8b;
  white-space: nowrap;
}

/* ---- Disabled-order reasons, branch research, admiral development ---- */
button.blocked:disabled {
  opacity: 0.82;
  cursor: not-allowed;
}
.cost-item.short {
  color: #ff5a4a;
  font-weight: 800;
}
button small.why {
  color: #f2b48a;
  font-weight: 700;
}
/* A button's reason or cost sits on its own line under the label (side by side only in panel action rows). */
button > small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  white-space: normal;
}
.actions button > small {
  margin-top: 0;
  text-align: right;
}
button.mini > small.why {
  display: none;
}
.doctrine {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #9fb0ad;
}
.doctrine li.unlocked {
  color: #e2ce8b;
}
.officer-line {
  font-size: 11px !important;
  color: #c9d2b8 !important;
}
.officers .officer {
  min-height: 0;
}
.officer .xp {
  margin: 10px 0;
  position: relative;
}
.officer .xp small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #c2d4d1;
}
.officer .ratings,
.officer .skills {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  position: relative;
  font-size: 12px;
}
.officer .rating,
.officer .skill {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.officer .pips {
  color: #8fd3c3;
  letter-spacing: 2px;
}
.officer .medals,
.officer .officer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  position: relative;
}
.officer .officer-actions button {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
button.mini {
  padding: 1px 7px;
  min-width: 0;
  line-height: 1.3;
}
button.mini small {
  display: none;
}
.medal-case {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 12px 0;
}
.medal-case small {
  color: #aebfba;
  line-height: 1.6;
}
.medal-chip,
.medal-slot {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #8c8b6a;
  background: #263632;
  color: #f0e4b8;
}
.medal-slot:not(.filled) {
  color: #8a9a96;
  border-style: dashed;
}

/* ---- Command HQ: tokens and persistent research ---- */
.hq-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #c9a24a55;
  background: #1b2a2c99;
  border-radius: 3px;
}
.hq-summary b,
.hq-balance b {
  color: #f1d27a;
}
.hq-summary small {
  color: #9fb0ad;
}
.hq-summary button {
  align-self: flex-start;
  margin-top: 4px;
}
.tier-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}
.tier {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid #4b625e;
  color: #7f918d;
  border-radius: 2px;
}
.tier.open {
  border-color: #c9a24a;
  color: #f1d27a;
}
.tech-card.hq p {
  min-height: 0;
}
.tech-card.hq .doctrine {
  margin-left: 0;
  list-style: none;
}
.tech-card.hq .doctrine li b {
  display: inline-block;
  min-width: 26px;
  color: #c9c58f;
}
.tech-card.hq .doctrine li small {
  color: #6f8480;
  white-space: nowrap;
}
.tech-card .req {
  display: block;
  margin-top: 8px;
  color: #d9a86a;
  font-size: 12px;
}
.reward {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #c9a24a66;
  background: #2a261699;
}
.reward b {
  font-size: 22px;
  color: #f1d27a;
}
.reward small {
  color: #c9c2a0;
}
@media (max-width: 700px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- General Info (officer card) ---- */
[data-general] {
  cursor: pointer;
}
[data-general]:hover,
[data-general]:focus-visible {
  outline: 2px solid #f1d27a;
  outline-offset: 1px;
}
.general-info {
  padding: 0;
  overflow: hidden;
  max-width: 980px;
  border: 2px solid #6f8fae;
  background: #182838;
}
.gi-head {
  position: relative;
  background: linear-gradient(180deg, #5d9bd6, #2f6aa5);
  text-align: center;
  padding: 8px 48px;
  border-bottom: 2px solid #1d3d5e;
}
.gi-head h2 {
  margin: 0;
  font-size: 24px;
  color: #fff;
  text-shadow: 0 2px 0 #123456;
  letter-spacing: 0.02em;
}
.gi-head .close {
  position: absolute;
  left: 8px;
  top: 6px;
  background: linear-gradient(180deg, #e2483c, #a1201a);
  border-color: #ffb3a8;
  color: #fff;
  font-weight: 800;
  padding: 4px 12px;
}
.gi-body {
  display: grid;
  grid-template-columns: 280px 1fr;
}
.gi-left {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 40%, #f2b544, #c7652a 60%, #6e2a17);
  border-right: 2px solid #1d3d5e;
}
.general-info.britannia .gi-left {
  background: radial-gradient(circle at 50% 40%, #f0c76a, #b53838 60%, #5d1818);
}
.general-info.eu .gi-left {
  background: radial-gradient(circle at 50% 40%, #a9d0ff, #376fca 60%, #153b78);
}
.general-info.cf .gi-left {
  background: radial-gradient(circle at 50% 40%, #f2c14e, #b52a2a 60%, #4a0d0b);
}
.gi-nameplate {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  margin: 8px 10px 0;
  padding: 4px 10px;
  background: linear-gradient(90deg, #6a3fb0, #3b2470);
  border: 1px dashed #c9b3ff;
  color: #fff;
}
.gi-nameplate b {
  display: block;
  min-width: 0;
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.gi-stars-top {
  display: block;
  color: #ffd76a;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: break-word;
}
.gi-portrait {
  position: relative;
  height: 300px;
  margin: 6px 10px 0;
}
.gi-portrait .gi-portrait-art {
  width: 100%;
  height: 100%;
}
.gi-ribbons {
  position: absolute;
  left: 4px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gi-ribbon,
.gi-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 22px;
  border: 1px solid #f1e3b0;
  box-shadow: 0 2px 4px #0009;
  font-weight: 800;
  color: #fff;
}
.gi-slot {
  width: 34px;
  height: 30px;
  background: #0d1218dd;
  font-size: 20px;
}
.gi-slot.locked {
  font-size: 12px;
  opacity: 0.6;
}
.gi-ribbon.valor {
  background: repeating-linear-gradient(90deg, #c22b2b 0 8px, #fff 8px 11px, #1f3f9a 11px 18px, #fff 18px 21px);
}
.gi-ribbon.laurel {
  background: repeating-linear-gradient(90deg, #2f8a3a 0 10px, #e6c34f 10px 14px);
}
.gi-ribbon.star {
  background: repeating-linear-gradient(90deg, #1f4fa8 0 9px, #fff 9px 12px, #d9b440 12px 16px);
}
.gi-ribbon.marksman {
  background: repeating-linear-gradient(90deg, #d86a1f 0 8px, #222 8px 11px, #f2d06a 11px 15px);
}
.gi-ribbon.campaign {
  background: repeating-linear-gradient(90deg, #6a3fb0 0 9px, #e6c34f 9px 12px, #2f8a3a 12px 16px);
}
.gi-ribbon-hit {
  position: absolute;
  inset: 0;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
}
.gi-rank {
  padding: 8px 10px 10px;
  background: #1c3046;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gi-rank-line,
.gi-promote {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: linear-gradient(180deg, #2f5f92, #1e4470);
  border: 1px solid #5d8fc4;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  width: 100%;
  text-align: left;
}
.gi-insignia {
  color: #ffd76a;
  min-width: 64px;
  letter-spacing: -1px;
}
.gi-up {
  margin-left: auto;
  color: #55e06a;
  font-size: 18px;
}
.gi-heart {
  color: #ff4a5e;
  min-width: 64px;
}
.gi-right {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #223a52;
}
.gi-ratings {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.gi-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 6px 12px;
  border: 1px solid #16293b;
  background: linear-gradient(180deg, #2c4c6c, #20384f);
}
.gi-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid #e7b937;
  background: radial-gradient(circle, #34506c, #142434);
  overflow: hidden;
}
.gi-badge .ship-art {
  width: 50px;
  height: 50px;
}
.gi-badge.mobility {
  border-color: #39ff8a;
  background: radial-gradient(circle, #1e5138, #0b2017);
  box-shadow: inset 0 0 14px #39ff8a22, 0 0 10px #39ff8a22;
}
.gi-badge .gi-mobility-glyph {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 5px #39ff8aaa);
}
.gi-name {
  font-size: 12px;
  color: #c7d6e4;
  min-width: 74px;
}
.gi-stars {
  font-size: 22px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.gi-stars i {
  font-style: normal;
  color: #57677a;
}
.gi-stars i.on {
  color: #ffd23f;
  text-shadow: 0 0 6px #ff9d00aa;
}
.gi-ability {
  padding: 10px 14px;
  border-bottom: 1px solid #16293b;
}
.gi-ability p {
  margin: 4px 0;
  font-size: 13px;
  color: #d7e2ec;
}
.gi-ability small {
  color: #9fb4c8;
}
.gi-skills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 14px 10px 6px;
}
.gi-skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  opacity: 0.55;
}
.gi-skill.learned {
  opacity: 1;
}
.gi-emblem {
  display: grid;
  place-items: center;
  width: 56px;
  height: 46px;
  font-size: 24px;
  color: #ffe08a;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(180deg, #3d7fd0, #1d4f94);
  box-shadow: inset 0 0 0 3px #e7b937;
}
.gi-skill:nth-child(n + 4) .gi-emblem {
  background: linear-gradient(180deg, #d0453d, #8e1d18);
}
.gi-skill b {
  padding: 1px 10px;
  background: #1b2c3e;
  border: 1px solid #5d8fc4;
  color: #fff;
}
.gi-skill small {
  font-size: 10px;
  color: #b9c9d8;
  line-height: 1.2;
}
.gi-xp {
  padding: 8px 14px 12px;
  margin-top: auto;
}
.gi-xp small {
  color: #b9c9d8;
}
.gi-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px;
  border-top: 2px solid #1d3d5e;
  background: #15263a;
}
.gi-wear,
.gi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.gi-enemy {
  padding: 10px 14px;
  margin: 0;
}
@media (max-width: 760px) {
  .gi-body {
    grid-template-columns: 1fr;
  }
  .gi-portrait {
    height: 220px;
  }
  .gi-ratings {
    grid-template-columns: 1fr;
  }
  .gi-skills {
    grid-template-columns: repeat(3, 1fr);
  }
}
.gi-rating .star-buy {
  white-space: nowrap;
  padding: 3px 8px;
  border-color: #e7b937;
  background: linear-gradient(180deg, #4a3a14, #2a2008);
  color: #ffe08a;
}
.gi-rating .star-buy .cost-line {
  display: inline-flex;
}
.gi-rating .star-buy .cost-ico {
  width: 14px;
  height: 14px;
}
.gi-stars {
  font-size: 19px;
}
/* Token-priced buttons and the promotion row on the General Info card. */
.token-buy {
  white-space: nowrap;
  padding: 4px 10px;
  border-color: #e7b937;
  background: linear-gradient(180deg, #4a3a14, #2a2008);
  color: #ffe08a;
}
.token-buy.blocked {
  opacity: 0.8;
  cursor: not-allowed;
}
.token-buy .cost-line {
  display: inline-flex;
}
.token-buy .cost-ico {
  width: 15px;
  height: 15px;
}
.gi-promote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-top: auto;
  border-top: 1px solid #16293b;
  background: #1c3046;
}
.gi-promote-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gi-promote-row b {
  color: #fff;
  font-size: 16px;
}
.gi-promote-row small {
  color: #9fb4c8;
}
.gi-portrait {
  height: 330px;
}
/* General Info layout fixes: columns may shrink, rating cells stack name over stars, no overflow. */
.dialog.wide.general-info {
  width: min(980px, 100%);
}
.gi-body {
  grid-template-columns: 270px minmax(0, 1fr);
}
.gi-body > *,
.gi-ratings > * {
  min-width: 0;
}
.gi-ratings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gi-rating {
  min-height: 72px;
  gap: 10px;
  padding: 8px 10px;
}
.gi-badge {
  width: 48px;
  height: 48px;
}
.gi-badge .ship-art {
  width: 44px;
  height: 44px;
}
.gi-rating-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.gi-name {
  min-width: 0;
  font-size: 12px;
}
.gi-stars {
  font-size: 18px;
  letter-spacing: 0;
}
.gi-rating .token-buy {
  flex-shrink: 0;
  padding: 4px 8px;
}
.gi-portrait {
  height: 260px;
}
.gi-ladder {
  padding: 10px 14px 12px;
  border-bottom: 1px solid #16293b;
}
.gi-pips {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.gi-pips i {
  height: 10px;
  border: 1px solid #5d8fc4;
  background: #142434;
  transform: skewX(-20deg);
}
.gi-pips i.done {
  background: #3d7fd0;
}
.gi-pips i.now {
  background: #ffd23f;
  border-color: #fff3b0;
  box-shadow: 0 0 6px #ffb300aa;
}
.gi-promote-row {
  margin-top: auto;
  flex-wrap: wrap;
}
.gi-promote-row .token-buy {
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .gi-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .gi-ratings {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Recruitable admirals not yet in the high command. */
.locked-officer .officer-portrait {
  filter: grayscale(0.7) brightness(0.8);
}
.locked-officer h3 {
  color: #c9c2a0;
}
.officer-section {
  margin: 18px 0 8px;
  font-size: 18px;
  color: #e5dfb8;
  border-bottom: 1px solid #798e8180;
  padding-bottom: 6px;
}
.portrait-art.photo {
  overflow: hidden;
}
.portrait-art.photo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ---- Campaign map ---- */
.campaign {
  margin: 18px 0 6px;
}
.camp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  color: #c9d2b8;
  font-size: 13px;
}
.campaign-map {
  position: relative;
  aspect-ratio: 16 / 6;
  min-height: 220px;
  border: 1px solid #798e8180;
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff9 50%, transparent),
    radial-gradient(1px 1px at 38% 78%, #fff8 50%, transparent),
    radial-gradient(1.5px 1.5px at 66% 18%, #fffb 50%, transparent),
    radial-gradient(1px 1px at 84% 84%, #fff8 50%, transparent),
    radial-gradient(1px 1px at 52% 48%, #fff6 50%, transparent),
    radial-gradient(ellipse at 20% 60%, #3a2a5a66, transparent 45%),
    radial-gradient(ellipse at 75% 35%, #1f4a5a66, transparent 50%),
    linear-gradient(135deg, #0a1424, #101c2e 60%, #0b1220);
}
.campaign-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.camp-path {
  fill: none;
  stroke: #6f8fae66;
  stroke-width: 0.6;
  stroke-dasharray: 1.6 1.2;
  vector-effect: non-scaling-stroke;
}
.camp-path.done {
  stroke: #e7b937;
  stroke-dasharray: none;
  stroke-width: 2;
}
.campaign-map .camp-path {
  stroke-width: 2;
}
.camp-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  color: #dfe7ef;
  width: 110px;
  text-align: center;
}
.camp-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #6f8fae;
  background: #142434;
  font-weight: 800;
  font-size: 13px;
}
.camp-node.done .camp-dot {
  border-color: #e7b937;
  background: #3a2e10;
  color: #ffe08a;
}
.camp-node.selected .camp-dot {
  box-shadow: 0 0 0 3px #3ff2c4aa;
}
.camp-node.recommended .camp-dot {
  border-color: #3ff2c4;
  animation: camp-pulse 1.6s ease-in-out infinite;
}
@keyframes camp-pulse {
  50% {
    box-shadow: 0 0 0 7px #3ff2c433;
  }
}
@media (prefers-reduced-motion: reduce) {
  .camp-node.recommended .camp-dot {
    animation: none;
  }
}
.camp-name {
  font-size: 11px;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000;
}
.camp-stars {
  font-size: 11px;
  color: #ffd23f;
  letter-spacing: 1px;
}
.camp-reward {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #ffe08a;
}
.camp-reward .cost-ico {
  width: 12px;
  height: 12px;
}
.camp-flag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  background: #3ff2c4;
  color: #062018;
  border-radius: 2px;
  font-weight: 800;
}
.camp-advice {
  margin: 8px 0;
  font-size: 13px;
  color: #c9d2b8;
}
.camp-advice b {
  color: #3ff2c4;
}
.camp-brief {
  padding: 12px 14px;
  border: 1px solid #798e8180;
  background: #142234aa;
  border-radius: 3px;
}
.camp-brief h3 {
  margin: 4px 0 6px;
  font-size: 20px;
  color: #e5dfb8;
}
.camp-brief p {
  margin: 0 0 6px;
  font-size: 13px;
  color: #bdcecb;
}
.camp-objective {
  color: #ffd23f !important;
}
.camp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #c9d2b8;
}
.camp-meta b {
  color: #ffe08a;
}
.camp-meta .cost-ico {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}
.camp-pip {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border: 1px solid #6f8fae;
  font-size: 10px;
  font-weight: 800;
  color: #6f8fae;
}
.camp-pip.on {
  border-color: #e7b937;
  background: #e7b937;
  color: #1b1405;
}
@media (max-width: 700px) {
  .campaign-map {
    aspect-ratio: auto;
    height: 300px;
  }
  .camp-node {
    width: 74px;
  }
  .camp-name {
    font-size: 9px;
  }
  .camp-reward,
  .camp-flag {
    display: none;
  }
  .camp-node.recommended .camp-flag {
    display: inline;
  }
}
.campaign-map button.camp-node,
.campaign-map button.camp-node:hover,
.campaign-map button.camp-node:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.campaign-map button.camp-node:focus-visible .camp-dot {
  outline: 2px solid #f1d27a;
  outline-offset: 2px;
}
.camp-reward .cost-ico,
.camp-meta .cost-ico {
  position: static;
  margin: 0;
}
.camp-kind {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7cc8ff;
}
/* Side campaigns: locked chapters and the separate Conquest picker. */
.campaign-map button.camp-node.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.camp-node.locked .camp-dot {
  font-size: 12px;
  border-style: dashed;
}
.camp-node.won .camp-dot {
  border-color: #c9a24a;
}
.camp-launch {
  margin-top: 10px;
}
.conquest-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #798e8180;
  border-radius: 3px;
  background: #101c2c99;
}
.conquest-row > div {
  flex: 1;
  min-width: 0;
}
.conquest-row label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.conquest-row button {
  flex-shrink: 0;
  margin-bottom: 14px;
}
@media (max-width: 700px) {
  .conquest-row {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Your generals versus scenario commanders. */
.gi-kind {
  margin-top: 2px;
  padding: 3px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  color: #c9d2b8;
  border: 1px dashed #5d8fc4;
}
.gi-kind.mine {
  color: #1b1405;
  background: #e7b937;
  border: 1px solid #fff3b0;
}
.gi-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #16293b;
}
.scenario-commanders {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.scenario-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid #798e8180;
  background: #142234aa;
}
.scenario-chip .chip-portrait {
  width: 36px;
  height: 46px;
}
.scenario-chip span {
  display: flex;
  flex-direction: column;
}
.scenario-chip small {
  color: #9fb0ad;
}
.hq-buttons {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* ---- Knightmare Conquest: three powers, a world map with a minimap, sea transports ---- */
:root {
  --britannia: #e34b4b;
  --eu: #4f8cff;
  --cf: #ff8c6e;
}
body,
.map-wrap {
  background: #0b2234;
}
.map-wrap canvas.minimap {
  inset: auto;
  top: 312px;
  right: 22px;
  width: 210px;
  height: 80px;
  z-index: 4;
  border: 1px solid #a9b8a7aa;
  box-shadow: 0 4px 14px #000a;
  cursor: crosshair;
  background: #0d2b40;
}
.map-legend span:nth-child(n + 3) {
  display: inline;
}
.choice-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choice-grid.three .faction {
  padding: 18px 16px 18px 104px;
  min-height: 250px;
}
.choice-grid.three .faction-portrait {
  width: 100px;
  height: 172px;
}
.choice-grid.three .faction h3 {
  font-size: 20px;
}
.choice-grid.three .faction p {
  font-size: 12.5px;
}
.faction .doctrine {
  font-size: 11.5px;
  color: #e5dcb4;
}
.faction.britannia.active {
  background: linear-gradient(130deg, #63302f, #3a1717);
  border-color: #e34b4b;
}
.faction.eu.active {
  background: linear-gradient(130deg, #315a92, #18345f);
  border-color: #4f8cff;
}
.faction.cf.active {
  background: linear-gradient(130deg, #5e3a33, #3a1d1c);
  border-color: #ff8c6e;
}
.conquest-title {
  margin: 4px 0 6px;
  font: 22px Georgia;
  color: #ede1b0;
}
.conquest-row .primary {
  min-width: 190px;
  font-size: 16px;
}
.unit-art > svg {
  overflow: visible;
}
.unit-art.city-art {
  filter: drop-shadow(0 6px 5px #0007);
}
.unit-model {
  margin: -4px 0 6px;
  font-size: 11px;
  color: #c9c6a8;
  letter-spacing: 0.4px;
}
.lore {
  font-size: 11.5px;
  font-style: italic;
  color: #b9c6bd;
  line-height: 1.45;
}
.unit-card .lore b {
  font-style: normal;
  color: #d9d199;
}
.sea-strip {
  border-color: #7cc8ff88 !important;
  color: #d8f0ff;
}
.dispatch {
  border-left: 3px solid #6c776f;
  padding-left: 7px;
}
table.powers {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 13px;
}
table.powers th,
table.powers td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #6c776f55;
}
table.powers th {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c9c6a8;
}
table.powers tr.mine td {
  background: #ffffff0d;
  color: #fff6d0;
}
table.powers .legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.gi-badge .unit-art {
  width: 56px;
  height: 56px;
}
.end .kbd {
  margin-left: 8px;
}
@media (max-width: 1100px) {
  .choice-grid.three {
    grid-template-columns: 1fr;
  }
  .choice-grid.three .faction {
    min-height: 0;
  }
}
@media (max-width: 760px) {
  .map-wrap canvas.minimap {
    top: auto;
    bottom: 214px;
    right: 12px;
    width: 140px;
  }
}

/* Layer imported images inside the wrapper's existing card or dock placement. */
.unit-art.local-art > img,
.portrait-art.local-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.unit-art.local-art > img {
  object-fit: contain;
}
.portrait-art.local-art > img {
  object-fit: cover;
}

.notice {
  font-size: 11px;
  line-height: 1.45;
  color: #b9c6bd;
}
.credits {
  margin: 12px 0 6px;
  padding: 10px 12px;
  border: 1px solid #6c776f66;
  background: #0c202966;
}
.credits .notice {
  margin: 4px 0 0;
}

/* ---- Sakuradite: deposits, mines and the fourth resource ---- */
.deposit-box {
  border-color: #ff6fb566;
  background: linear-gradient(135deg, #3a0f2633, #0c202966);
}
.deposit-box h3 {
  color: #ffc2e0;
}
.mine-art {
  display: grid;
  place-items: center;
  height: 110px;
}
.mine-art .mine-photo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 6px 6px #000a);
}
.mine-art .mine-icon {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 6px 6px #000a);
}
.mine-visual {
  display: grid;
  place-items: center;
}
.mine-visual .dock-mine {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 3px 3px #000a);
}
.deposit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
}
.deposit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 3px;
  background: #0c202999;
  font-size: 12px;
}
.deposit-chip small {
  color: #b9c6bd;
}
@media (max-width: 500px) {
  /* Six resources do not fit a phone: command tokens stay in HQ. */
  .resource.res-token {
    display: none;
  }
}

/* ---- F.L.E.I.J.A.: arsenal, projects, the strategic-weapon warning ---- */
.fleija-button {
  background: linear-gradient(#b0356f, #6d1440);
  border-color: #ff9fd0;
  color: #fff1f8;
  text-shadow: 0 1px 1px #0008;
}
.fleija-button:hover:not(:disabled) {
  background: linear-gradient(#cf4686, #861a50);
}
.fleija-button.armed {
  box-shadow:
    0 0 0 2px #ffd6ec,
    0 0 16px #ff5fae;
}
.fleija-panel {
  border-color: #ff5fae88;
  background: linear-gradient(135deg, #4a0f2c55, #0c202966);
}
.fleija-panel h3 {
  color: #ffc2e0;
}
.fleija-text {
  color: #ff9fd0;
}
.eliminator-text {
  color: #9eeaff;
}
.danger-strip {
  border-color: #ff5fae;
  background: #4a0f2c99;
  color: #ffe0ef;
}
button.danger {
  background: linear-gradient(#e0478e, #8e1a52);
  border-color: #ffb6d9;
  color: #fff4f9;
  text-shadow: 0 1px 1px #0009;
}
button.danger:hover:not(:disabled) {
  background: linear-gradient(#f05a9f, #a32462);
}
.blast-list {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: #d9e2dc;
}
.fleija-alert {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #3a0820 0%, #0b0207 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.fleija-alert[hidden] {
  display: none;
}
.fleija-alert.show {
  opacity: 1;
  pointer-events: auto;
}
.fleija-box {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 28px 36px;
  border-top: 2px solid #ff5fae;
  border-bottom: 2px solid #ff5fae;
  text-align: center;
  color: #ffe6f3;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  text-transform: uppercase;
  animation: fleija-pulse 0.5s ease-in-out infinite alternate;
}
.fleija-kicker {
  color: #ff5f5f;
  font-size: 15px;
  letter-spacing: 4px;
  font-weight: 700;
}
.fleija-box b {
  font-size: clamp(30px, 7vw, 64px);
  letter-spacing: 6px;
  color: #ffd6ec;
  text-shadow: 0 0 24px #ff5fae;
}
.fleija-impact {
  font-size: clamp(16px, 3vw, 24px);
  letter-spacing: 3px;
}
.fleija-box small {
  color: #ff9fd0;
  letter-spacing: 2px;
}
@keyframes fleija-pulse {
  from {
    border-color: #ff5fae;
  }
  to {
    border-color: #ff2a2a;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fleija-box {
    animation: none;
  }
}
/* ---- Elite Forces ---- */
.elite-card {
  position: relative;
}
.elite-card::before {
  content: 'ELITE';
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 3px 6px;
  border: 1px solid var(--gold);
  background: #182420dd;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.elite-card.locked .catalog-ship {
  filter: grayscale(.6);
  opacity: .62;
}
.elite-fragments {
  margin: 8px 0 10px;
  padding-top: 7px;
  border-top: 1px solid #ffffff1c;
  color: var(--muted);
  font-size: 12px;
}
.elite-fragments b {
  color: var(--gold);
}
/* An HQ fragment action becomes green only when it can be purchased. */
.elite-card button.elite-upgrade-ready:not(:disabled) {
  background: linear-gradient(145deg, #5fe0a0, #2c9c72);
  border-color: #98f5be;
  color: #081d18;
  font-weight: 800;
  box-shadow: 0 0 0 1px #72dca54d, 0 3px 12px #176d4b55;
}
.elite-card button.elite-upgrade-ready:hover:not(:disabled) {
  background: linear-gradient(145deg, #8bf5b9, #45b989);
  border-color: #c0ffda;
}

/* ---- Campaign ---- */
.campaign-row {
  border-color: #f0c94a66;
  background: linear-gradient(100deg, #221d0fcc, #101c2c99 60%);
}
.campaign-select .tabs button.active {
  border-color: var(--c);
  color: var(--c);
}
.campaign-total {
  color: #f1d27a;
  font-weight: 700;
}
.campaign-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.campaign-portrait {
  display: block;
  width: 170px;
  height: 230px;
  overflow: hidden;
  border: 1px solid #4a5b70;
  border-radius: 4px;
}
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mission-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
  background: #122032;
  border-color: #3c4d61;
}
.mission-card:hover:not(:disabled) {
  border-color: var(--gold);
}
.mission-card.cleared {
  border-color: #c9a24a88;
}
.mission-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mission-num {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #c9a24a88;
  border-radius: 50%;
  font: 16px Georgia;
  color: var(--gold);
}
.mission-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mission-info small {
  font-size: 11px;
  color: var(--muted);
}
.stars {
  white-space: nowrap;
  letter-spacing: 2px;
  color: #3a4858;
}
.stars i,
.result-stars span {
  font-style: normal;
}
.stars .on,
.result-stars .on {
  color: #f1d27a;
  text-shadow: 0 0 8px #f1d27a88;
}
.brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
}
.brief-story {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: #c3d0dd;
}
.brief-block {
  margin: 12px 0;
}
.brief-block > p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #d6dde6;
}
.star-list {
  list-style: none;
  display: grid;
  gap: 5px;
  margin: 6px 0 0;
  padding: 0;
  font-size: 14px;
}
.star-list b {
  display: inline-block;
  width: 20px;
  color: #f1d27a;
}
.star-list .lost {
  color: var(--muted);
}
.star-list .lost b {
  color: #e07a6e;
}
.mission-result .star-list .lost b {
  color: #5a6878;
}
.side-chips,
.brief-cmds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.side-chip {
  padding: 3px 9px;
  border: 1px solid var(--c);
  border-radius: 3px;
  background: #0b1520;
  color: var(--c);
  font-size: 12px;
}
.versus {
  font-size: 12px;
  color: var(--muted);
}
.brief-cmd {
  width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}
.brief-portrait {
  display: block;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid #c9a24a88;
  border-radius: 50%;
}
.brief-map {
  display: block;
  width: 100%;
  border: 1px solid #4a5b70;
  border-radius: 4px;
  background: #0d2b40;
}
.brief-side > small {
  display: block;
  margin: 6px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.star-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.star-chip {
  padding: 1px 8px;
  border: 1px solid #c9a24a88;
  border-radius: 10px;
  font-size: 11px;
  color: #f1d27a;
}
.star-chip.todo {
  border-color: #4a5b70;
  color: #aab7c5;
}
.star-chip.lost {
  border-color: #5a6878;
  color: #7d8b9b;
  text-decoration: line-through;
}
.overlay.talk-overlay {
  align-items: flex-end;
  background: #02081040;
  backdrop-filter: none;
}
.dialog.talk {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: min(860px, 100%);
  margin-bottom: 64px;
  padding: 20px 24px;
  border-color: #c9a24a88;
}
.talk-portrait {
  flex: 0 0 96px;
  display: block;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid #c9a24a88;
  border-radius: 4px;
}
.talk-emblem {
  display: grid;
  place-items: center;
  background: #0b1520;
  font: 40px Georgia;
  color: var(--c);
}
.talk-body {
  flex: 1;
  min-width: 0;
}
.talk-body p {
  margin: 6px 0 12px;
  font-size: 17px;
  line-height: 1.6;
}
.talk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.talk-actions small {
  order: -2;
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}
.talk-actions .ghost {
  order: -1;
}
.campaign-portrait img,
.brief-portrait img,
.talk-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.result-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 4px;
  font-size: 54px;
  line-height: 1;
  color: #2d3a4a;
}
@media (max-width: 760px) {
  .campaign-layout,
  .brief-grid,
  .mission-grid {
    grid-template-columns: 1fr;
  }
  .campaign-portrait {
    display: none;
  }
  .dialog.talk {
    margin-bottom: 12px;
    padding: 14px;
  }
  .talk-portrait {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }
}
.season-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 0 0 4px;
}
.season-tab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.season-tab b {
  font: 18px Georgia;
}
.season-tab small {
  font-size: 12px;
  color: var(--muted);
}
.season-tab.active {
  border-color: var(--gold);
  background: #2a2614;
}
.season-tab.active b {
  color: #f1d27a;
}
.warn-text {
  display: block;
  color: var(--red);
}

/* Restore the compact pre-shortcut-label unit dock; keep controls accessible. */
.selection-dock:has(.unit-dock-actions) {
  gap: 9px;
  padding-right: 10px;
}
/* Keep all five unit statistics, including range, on a single row. */
.selection-dock:has(.unit-dock-actions) .dock-unit {
  min-width: 245px;
  max-width: none;
  flex: 0 0 auto;
}
.selection-dock:has(.unit-dock-actions) .dock-stats {
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}
.selection-dock:has(.unit-dock-actions) .dock-stats > * {
  flex-shrink: 0;
}
.unit-dock-actions {
  max-width: 320px;
  margin-left: 3px;
  gap: 5px;
  align-content: center;
}
.unit-dock-actions button {
  font-size: 11px;
  padding: 7px 9px;
  min-height: 30px;
}
@media (max-width: 1100px) {
  .unit-dock-actions { max-width: 300px; }
}
@media (max-width: 760px) {
  .selection-dock:has(.unit-dock-actions) .dock-unit {
    min-width: 0;
    max-width: none;
    width: auto;
    flex: 1 1 190px;
  }
  .selection-dock:has(.unit-dock-actions) .dock-stats {
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
  }
}
/* All unit orders are in the bottom bar; only carrier cargo opens the right drawer. */
.deployment-only h2 { margin: 4px 0 12px; font-size: 18px; }
.deployment-only .section-divider { margin-top: 0; }
@media (max-width: 760px) {
  .unit-dock-actions { max-width: 205px; max-height: 165px; overflow-y: auto; }
  .unit-dock-actions button { min-height: 28px; }
}

/* 2018 U.F.N. setup card: show its standard above the existing commander portrait. */
.choice-grid.three .faction.ufn-2018 {
  border-top-color: #f6cf67;
}
.choice-grid.three .faction.ufn-2018.active {
  background: linear-gradient(130deg, #263c37, #14272b);
  border-color: #f6cf67;
}
.choice-grid.three .faction.ufn-2018 .ufn-start-flag {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 12px;
  display: block;
  width: 78px;
  aspect-ratio: 8 / 5;
  pointer-events: none;
  filter: drop-shadow(0 5px 8px #000b);
}
.choice-grid.three .faction.ufn-2018 .ufn-start-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
@media (max-width: 760px) {
  .choice-grid.three .faction.ufn-2018 {
    padding-top: 79px;
  }
}

/* Real rectangular faction flags on selected armies, cities, ports and mines. */
.faction-flag.flag-art {
  width: 28px;
  height: 19px;
  border-radius: 2px;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}
.faction-flag.flag-art svg { display: block; width: 100%; height: 100%; }



/* Section 10 — nonblocking turn feedback and classified notifications. */
#toast.categorized-toast {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-width: 220px;
  max-width: min(460px, 90vw);
  padding: 11px 16px;
  border-left: 4px solid #8eaabc;
  pointer-events: none;
  z-index: 50;
}
#toast .notice-type { font-size: 10px; font-weight: 800; letter-spacing: .11em; color: #d4e6ef; }
#toast .notice-message { line-height: 1.35; overflow-wrap: anywhere; }
#toast.notice-success { border-left-color: #7fc79f; }
#toast.notice-warning { border-left-color: #efbe70; background: #443b31f5; }
#toast.notice-strategic { border-left-color: #dbab68; background: #2e3041f7; }
#toast.notice-warning .notice-type { color: #ffe1a8; }
#toast.notice-strategic .notice-type { color: #ffe1a8; }
.ai-phase-status {
  position: fixed; top: 77px; left: 50%; transform: translateX(-50%);
  z-index: 11; pointer-events: none; padding: 7px 16px;
  background: #172937f2; border: 1px solid var(--phase-color, #a8b4bc);
  color: #f0f2e7; border-radius: 3px; font-size: 12px;
  letter-spacing: .025em; box-shadow: 0 4px 12px #0007;
}
.turn-announcement {
  position: fixed; top: 24%; left: 50%; transform: translate(-50%, -12px);
  z-index: 22; pointer-events: none; opacity: 0;
  min-width: min(350px, 85vw); padding: 17px 35px;
  border: 1px solid #ccba84; background: #122538ed;
  box-shadow: 0 12px 36px #0009; text-align: center;
  display: flex; flex-direction: column; gap: 5px;
  transition: opacity .18s ease, transform .18s ease;
}
.turn-announcement.visible { opacity: 1; transform: translate(-50%, 0); }
/* One-second active-ability announcement; distinct from F.L.E.I.J.A. and
   ordinary toasts. Centered over the map and non-interactive on all screens. */
.commander-ability-banner {
  position: fixed; top: 27%; left: 50%; transform: translate(-50%, -10px);
  z-index: 52; pointer-events: none; opacity: 0;
  width: min(530px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 17px 24px; display: flex; flex-direction: column; gap: 5px;
  text-align: center; border: 1px solid #d6b86e;
  border-left: 5px solid #cda55a;
  background: linear-gradient(105deg, #132336f5, #283447f7);
  box-shadow: 0 12px 35px #000a;
  transition: opacity .14s ease, transform .14s ease;
}
.commander-ability-banner[hidden] { display: none; }
.commander-ability-banner.visible { opacity: 1; transform: translate(-50%, 0); }
.commander-ability-banner small {
  color: #d9be85; font-size: 10px; font-weight: 800; letter-spacing: .16em;
}
.commander-ability-banner strong {
  color: #fff3d5; font: bold clamp(19px, 4.4vw, 29px) Georgia, serif;
  overflow-wrap: anywhere;
}
.commander-ability-banner span { color: #c9d6df; font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .commander-ability-banner { transition: none; }
}
.turn-announcement small { color: #d8c690; letter-spacing: .13em; font-size: 10px; text-transform: uppercase; }
.turn-announcement strong { color: #f7f0d5; font: 29px Georgia, serif; }
.turn-announcement span { color: #c0cdd4; font-size: 12px; }
.turn-summary {
  position: fixed; right: 17px; top: 80px; z-index: 13;
  width: min(306px, calc(100vw - 34px));
  background: #182b39f7; border: 1px solid #79897b;
  color: #e9eee7; box-shadow: 0 6px 24px #0009; border-radius: 4px;
}
.turn-summary summary {
  padding: 11px 13px; cursor: pointer; color: #f0dca7;
  font-weight: 700; font-size: 12px; letter-spacing: .07em;
}
.turn-summary .summary-chevron { float: right; }
.turn-summary-body { padding: 0 13px 12px; }
.turn-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.turn-summary-grid span { color: #bed0d2; font-size: 11px; display: flex; flex-direction: column; gap: 2px; }
.turn-summary-grid b { color: #f3f3e2; font-size: 18px; }
.turn-summary-body small { display: block; margin-top: 9px; font-size: 10px; color: #b7c8cb; }
.summary-actions { display: flex; gap: 8px; margin-top: 12px; }
.summary-actions button { font-size: 11px; }
.political-report {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 24;
  width: min(570px, calc(100vw - 30px)); padding: 13px 15px;
  background: linear-gradient(125deg, #283647fa, #152431f9);
  color: #f8eede; border: 1px solid #d1b575;
  box-shadow: 0 9px 28px #0009; display: flex; gap: 15px; align-items: flex-start;
}
.political-report > div { flex: 1; }
.political-report small { color: #f2d08c; letter-spacing: .11em; font-size: 10px; }
.political-report h3 { font-size: 19px; margin: 5px 0; }
.political-report p { font-size: 13px; line-height: 1.4; }
.political-report button { flex-shrink: 0; }
.notification-history { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; max-height: 50vh; overflow-y: auto; }
.notification-history li { border-left: 3px solid #7894a9; padding: 7px 10px; background: #122431; line-height: 1.4; }
.notification-history li.notice-warning { border-color: #efbe70; }
.notification-history li.notice-success { border-color: #7fc79f; }
.notification-history li.notice-strategic { border-color: #dbab68; }
.notification-history li b { font-size: 10px; margin-right: 9px; color: #e7dcaf; }
@media (max-width: 760px) {
  .ai-phase-status { top: 59px; font-size: 11px; }
  .turn-summary { top: 64px; right: 8px; width: min(280px, calc(100vw - 16px)); }
  .political-report { top: 64px; }
  #toast.categorized-toast { max-width: 84vw; }
}
@media (prefers-reduced-motion: reduce) {
  .turn-announcement { transition: none; }
  #toast { transition: none; }
}
[hidden] { display: none !important; }

/* Section 4: Army Group operation UI */
.operations-views{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:10px 0 3px}
.operations-views button{min-width:110px;min-height:34px;padding:7px 12px;border:1px solid #536977;background:#1b303d;color:#d9e8e7}
.operations-views button.ops-selected{background:#334752;border-color:#e3c677;color:#ffe9b4;box-shadow:inset 0 -2px #e3c677}
.operations-views button:focus-visible{outline:2px solid #9be5f3;outline-offset:2px}
.ops-disclaimer{color:#b5c8cb;font-size:12px;line-height:1.4;margin:5px 0 12px}
.ops-group-row{border-left:4px solid var(--ops-group-color,#e3c677);padding-left:12px}
.ops-group-id{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--ops-group-color,#e3c677);color:var(--ops-group-color,#e3c677);background:#132937;padding:3px 8px;font-size:12px;font-weight:800;letter-spacing:.04em}
.ops-phase{display:inline-block;font-weight:700;color:#d5e6e8}
.ops-phase-blocked,.ops-phase-empty,.ops-phase-no-objective{color:#ffb9a1}
.ops-row-alert{font-size:12px;color:#ffd1ac;margin:6px 0}
.ops-command-card{border:1px solid #5a6d76;border-left:4px solid var(--ops-group-color,#e3c677);background:linear-gradient(120deg,#172b38,#203740);padding:14px;margin:8px 0 14px}
.ops-command-head{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.ops-command-head>div{display:flex;flex-direction:column;gap:4px}
.ops-command-head strong{font-size:17px}
.ops-command-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px}
.ops-command-grid>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.ops-command-grid small{color:#b5c4c7;text-transform:uppercase;letter-spacing:.07em;font-size:10px}
.ops-command-grid strong{color:#f0f0e2;font-size:13px;overflow-wrap:anywhere}
.ops-alerts{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0}
.ops-alerts span{padding:5px 8px;background:#473a31;border:1px solid #aa7b55;color:#ffe0b7;font-size:12px}
@media(max-width:640px){.ops-command-grid{grid-template-columns:1fr}.operations-views button{flex:1;min-width:90px}} 

/* Army Group dialog: consistent controls regardless of primary/small state.
   Keep this scoped so regular conquest and scenario buttons are unaffected. */
.dialog[aria-label="Army groups"] button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
}
.dialog[aria-label="Army groups"] .scenario-group-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}
.dialog[aria-label="Army groups"] .scenario-group-buttons > button {
  flex: 0 1 164px;
  width: 164px;
  margin: 0;
  text-align: center;
}
.dialog[aria-label="Army groups"] .scenario-group-buttons > .mode-note {
  flex: 1 1 100%;
}
.dialog[aria-label="Army groups"] .ops-group-row > .scenario-group-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 360px;
  align-self: center;
}
.dialog[aria-label="Army groups"] .ops-group-row .scenario-group-buttons > button {
  width: 100%;
  min-width: 0;
  margin: 0;
}
/* Override the otherwise oversized primary buttons in conquest rows. */
.dialog[aria-label="Army groups"] .conquest-row .primary {
  min-width: 0;
  font-size: 13px;
}
.dialog[aria-label="Army groups"] .dialog-footer {
  flex-wrap: wrap;
  gap: 8px;
}
.dialog[aria-label="Army groups"] .dialog-footer > button {
  flex: 0 1 164px;
  width: 164px;
}
.dialog[aria-label="Army groups"] .operations-views button {
  flex: 0 1 164px;
  min-height: 44px;
}
@media (max-width: 700px) {
  .dialog[aria-label="Army groups"] .ops-group-row > .scenario-group-buttons {
    flex: none;
    width: 100%;
  }
}
@media (max-width: 420px) {
  .dialog[aria-label="Army groups"] .ops-group-row > .scenario-group-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Section 7 — Compact command HUD. Explicit scope prevents changes to start-menu dialogs. */
.topbar.hud-v2 {
  top: 9px; left: 13px; right: 13px; height: 60px; min-height: 0;
  display: flex; align-items: center; gap: 13px; padding: 0 13px;
  clip-path: none; border-radius: 5px; overflow: visible;
  background: linear-gradient(180deg,#1c3038fa,#0b1c27f7);
  box-shadow: 0 6px 20px #0009, inset 0 1px #ffffff1c;
}
.hud-v2 .hud-brand { min-width: 158px; gap: 7px; flex: 0 0 auto; }
.hud-v2 .hud-brand h1 { font-size: 15px; letter-spacing: .15px; white-space: nowrap; }
.hud-v2 .hud-brand small { font-size: 7px; letter-spacing: 1.1px; }
.hud-v2 .mark { font-size: 23px; }
.hud-phase { flex: 0 0 auto; display: flex; align-items: center; padding-left: 12px; border-left: 1px solid #bfcba52e; }
.hud-phase strong { font: 600 12px Arial,sans-serif; color: #f5e8c5; white-space: nowrap; }
/* Icon-left resource groups show the balance with a smaller per-turn rate below. */
.hud-v2 .hud-resources {
  display: inline-flex; flex: 0 1 auto; width: auto; min-width: 0;
  gap: clamp(4px, .45vw, 9px); align-items: center;
  justify-content: flex-start; margin: 0 0 0 6px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.hud-v2 .hud-resources::-webkit-scrollbar { display: none; }
.hud-v2 .resource {
  display: inline-flex; flex: 0 0 auto; flex-direction: row; align-items: center;
  justify-content: center; gap: 7px; min-width: 0; white-space: nowrap;
  padding: 6px 4px; border: 1px solid transparent; border-radius: 3px;
  position: relative; cursor: help;
}
.hud-v2 .resource:hover, .hud-v2 .resource:focus-visible {
  background: #c8dfc214; border-color: #b6cbaa77; outline-offset: 2px;
}
.hud-v2 .resource .res-icon {
  width: 25px; height: 25px; flex: 0 0 25px; margin: 0;
  display: inline-block; vertical-align: middle; filter: drop-shadow(0 2px 2px #000c);
}
.hud-v2 .resource .res-city-icon { display: none; }
.hud-v2 .resource .label { display: none; }
.hud-v2 .resource.res-cities .label {
  display: inline; order: 0; color: #aebdbf;
  font: 9px/1 Arial,sans-serif; text-transform: uppercase; letter-spacing: .6px;
}
.hud-v2 .resource b {
  display: inline; order: 1; font: 700 16px/1.2 'Trebuchet MS',Arial,sans-serif;
  margin: 0; white-space: nowrap;
}
.hud-v2 .resource .res-values {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 2px; min-width: 0;
}
.hud-v2 .resource .res-values b { order: 0; }
.hud-v2 .resource .hud-income {
  display: block; order: 1;
  color: #a9e3b9; font: 700 10px/1.1 'Trebuchet MS',Arial,sans-serif;
  font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 2px #000b;
}
.hud-v2 .resource .hud-income.negative { color: #f4a7a5; }
.hud-v2 .resource .income-unit {
  font: 600 9px/1 Arial,sans-serif; color: #b2c8bf;
}
.hud-v2 .hud-nav { display:flex; flex:0 0 auto; gap:5px; align-items:stretch; margin:0 0 0 auto; }
.hud-nav-group { position:relative; color:#eae7d5; }
.hud-nav-group > summary { list-style:none; cursor:pointer; border:1px solid #81938c55; border-radius:3px; background:#253a41d9; padding:9px 10px; font:600 11px Arial,sans-serif; white-space:nowrap; user-select:none; }
.hud-nav-group > summary::-webkit-details-marker { display:none; }
.hud-nav-group > summary:hover, .hud-nav-group[open] > summary { background:#435650; border-color:#c3bd8a; }
.hud-nav-group > summary:focus-visible { outline:2px solid #f2d686; outline-offset:3px; }
.hud-chevron { color:#c9c49c; padding-left:6px; }
.hud-nav-menu { position:absolute; right:0; top:calc(100% + 9px); min-width:180px; display:flex; flex-direction:column; gap:4px; padding:8px; background:#152a33fa; border:1px solid #a5a77e9c; box-shadow:0 12px 27px #000b; border-radius:4px; z-index:60; }
.hud-v2 .hud-nav .hud-menu-action { width:100%; display:block; text-align:left; padding:11px 12px; font:12px Arial,sans-serif; white-space:nowrap; background:#263a40; }
.hud-v2 .hud-nav .hud-menu-action:hover:not(:disabled) { background:#3a5657; }
.hud-v2 .hud-nav .hud-menu-action:disabled { cursor:not-allowed; opacity:.48; }
.hud-v2 .hud-nav .fleija-button { align-self:center; background:linear-gradient(#85414e,#542c38); border-color:#e9a5a4; color:#ffebde; font-size:11px; }
.hud-v2 .hud-nav button:focus-visible { outline:2px solid #f2d686; outline-offset:2px; }
.theater-head { top:86px; }
.theater-head .label { letter-spacing:1.6px; }
.footer .hud-all-orders { background:linear-gradient(#33434b,#1c2d39); border:1px solid #798e92; color:#d6e3de; }
.footer .hud-all-orders:hover:not(:disabled) { background:linear-gradient(#4a5a60,#293c47); }
.footer .hud-end-turn { background:linear-gradient(#e5cf83,#ae944a); border-color:#f8df9a; color:#18221e; font-weight:800; box-shadow: 0 0 0 1px #d4bc6c44,0 4px 18px #0007; }
.footer .hud-end-turn:hover:not(:disabled) { background:linear-gradient(#f0dea0,#c7aa62); }
@media (max-width: 1400px) {
  .topbar.hud-v2 { gap:8px; padding:0 8px; }
  .hud-v2 .hud-brand { min-width:0; }
  .hud-v2 .hud-brand small { display:none; }
  .hud-v2 .resource { padding: 5px 2px; gap: 5px; }
  .hud-nav-group > summary { padding:9px 7px; }
}
@media (max-width: 1170px) {
  .hud-v2 .hud-brand { display:none; }
  .hud-v2 .resource b { font-size: 14px; }
  .hud-v2 .hud-nav .fleija-button { padding:7px 6px; }
}
@media (max-width: 850px) {
  .topbar.hud-v2 { height:99px; min-height:0; top:7px; left:7px; right:7px; padding:7px; display:grid; grid-template-columns: 108px minmax(0,1fr); grid-template-rows:39px 37px; gap:5px 7px; }
  .hud-v2 .hud-phase { grid-column:1; grid-row:1; padding-left:3px; border:0; min-width:0; }
  .hud-v2 .hud-resources {
    grid-column: 2; grid-row: 1; width: 100%; min-width: 0;
    gap: 7px; margin: 0;
    justify-content: flex-start; align-self: center;
  }
  .hud-v2 .resource { padding: 3px 1px; gap: 4px; min-width: 0; flex-direction: row; }
  .hud-v2 .resource .res-icon { width: 19px; height: 19px; flex-basis: 19px; }
  .hud-v2 .resource b { font-size: 13px; }
  .hud-v2 .resource:last-child { display: inline-flex; }
  .hud-v2 .hud-nav { grid-column:1 / -1; grid-row:2; display:grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap:3px; margin:0; width:100%; }
  .hud-v2 .hud-nav > .fleija-button { grid-column:5; grid-row:1; }
  .hud-nav-group { min-width:0; }
  .hud-nav-group > summary { padding:8px 2px; text-align:center; font-size:11px; overflow:hidden; text-overflow:ellipsis; }
  .hud-nav-menu { z-index:60; }
  .hud-v2 .top-actions button:nth-child(3) { display:block; }
  .theater-head { top:126px; }
  .map-tools { top:185px; }
}
@media (max-width: 550px) {
  .hud-v2 .hud-nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .hud-v2 .hud-nav > .fleija-button { grid-column:4; grid-row:1; font-size:9px; max-height:32px; position:absolute; top:102px; right:0; }
  .hud-v2 .hud-nav .hud-chevron { display:none; }
  .hud-v2 .resource b { font-size: 12px; }
  .hud-v2 .resource .res-icon { width: 18px; height: 18px; flex-basis: 18px; }
  .hud-v2 .resource.res-cities .label { font-size: 8px; }
  .hud-nav-group > summary { font-size:10px; }
  .footer .hud-all-orders { font-size:10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hud-nav-group, .hud-v2 .resource { scroll-behavior:auto; }
}
