:root {
  color-scheme: dark;
  --bg: #101211;
  --panel: #181d1c;
  --panel-2: #222927;
  --panel-3: #2a302a;
  --line: #36413e;
  --line-soft: rgba(198, 211, 188, 0.13);
  --text: #f5f1e5;
  --muted: #aeb6a8;
  --accent: #e7b764;
  --accent-deep: #9c6f2d;
  --accent-soft: rgba(231, 183, 100, 0.16);
  --accent-2: #7fc39e;
  --danger: #d86f5c;
  --good: #90d07f;
  --water: #6fa8dc;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --panel-shadow: 0 24px 60px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 241, 198, 0.04);
  --brass-border: rgba(231, 183, 100, 0.38);
  --brass-border-strong: rgba(231, 183, 100, 0.62);
  --ui-font-scale: 1;
}

@font-face {
  font-family: "Cinzel";
  src: url("./assets/fonts/Cinzel-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel Decorative";
  src: url("./assets/fonts/CinzelDecorative-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-size: calc(16px * var(--ui-font-scale));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(231, 183, 100, 0.16), transparent 26%),
    radial-gradient(circle at 78% 12%, rgba(127, 195, 158, 0.1), transparent 24%),
    linear-gradient(135deg, #0b0d0c 0%, #171b19 46%, #0f1111 100%);
}

body[data-ui-scale="large"] {
  --ui-font-scale: 1.12;
}

body[data-ui-scale="huge"] {
  --ui-font-scale: 1.24;
}

body[data-ui-scale="large"] :is(.topbar, .tools-panel, .intel-panel, .command-dock, .selection-modal, .intel-modal, .confirm-modal, .game-menu-modal, .campaign-overlay, .audio-panel, .save-toast) {
  zoom: 1.12;
}

body[data-ui-scale="huge"] :is(.topbar, .tools-panel, .intel-panel, .command-dock, .selection-modal, .intel-modal, .confirm-modal, .game-menu-modal, .campaign-overlay, .audio-panel, .save-toast) {
  zoom: 1.24;
}

button {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100vh;
  padding: 10px 14px 14px;
  overflow: hidden;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(250px, 330px) minmax(520px, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: 132px;
  padding: 12px 18px 10px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(231, 183, 100, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(21, 25, 24, 0.98), rgba(8, 11, 11, 0.98));
  border: 2px solid rgba(101, 72, 32, 0.88);
  border-radius: 4px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.56), inset 0 0 0 1px rgba(231, 183, 100, 0.22), inset 0 12px 34px rgba(231, 183, 100, 0.04);
}

.topbar::before {
  position: absolute;
  inset: 6px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(231, 183, 100, 0.34);
  border-radius: 2px;
  box-shadow:
    inset 0 1px rgba(255, 241, 198, 0.12),
    inset 0 -1px rgba(0, 0, 0, 0.62),
    0 0 22px rgba(231, 183, 100, 0.08);
}

.topbar::after {
  position: absolute;
  inset: 6px 10px auto;
  height: 2px;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(231, 183, 100, 0.85), transparent);
}

.brand-block {
  position: relative;
  min-width: 0;
}

.brand-block::before {
  display: none;
}

.topbar-brand {
  display: grid;
  justify-items: center;
  align-self: stretch;
  align-content: center;
  gap: 0;
  z-index: 3;
  margin: -20px -34px -26px;
  pointer-events: none;
}

.topbar-logo {
  display: block;
  width: min(350px, 112%);
  height: 144px;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.72));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: "Cinzel", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-family: "Cinzel Decorative", "Cinzel", Georgia, serif;
  font-size: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

h2 {
  font-size: 15px;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: -28px;
  padding: 4px 12px;
  color: var(--accent);
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  background: rgba(9, 12, 12, 0.82);
  border: 1px solid rgba(231, 183, 100, 0.42);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 180, 0.05), 0 8px 18px rgba(0, 0, 0, 0.34);
}

.stats {
  display: grid;
  align-self: center;
  gap: 0;
  min-width: 0;
  max-width: none;
  padding: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 20, 20, 0.92), rgba(8, 11, 11, 0.9));
  border: 1px solid rgba(127, 89, 36, 0.9);
  box-shadow: inset 0 0 0 1px rgba(231, 183, 100, 0.16), 0 14px 32px rgba(0, 0, 0, 0.28);
}

.stats-left {
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  padding-right: 34px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
}

.stats-right {
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  padding-left: 34px;
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 50%);
}

.stat {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: minmax(32px, auto) 5px;
  align-items: center;
  column-gap: 6px;
  min-height: 66px;
  min-width: 0;
  padding: 8px 9px 7px;
  background:
    radial-gradient(circle at 18% 18%, rgba(231, 183, 100, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(34, 39, 36, 0.95), rgba(13, 17, 17, 0.96));
  border: 1px solid rgba(119, 86, 40, 0.78);
  border-left-width: 0;
  border-radius: 0;
  box-shadow: inset 0 1px rgba(255, 241, 198, 0.05);
  --stat-color: #9aa5a0;
  outline: none;
}

.stat.good {
  --stat-color: var(--good);
}

.stat.warning {
  --stat-color: var(--accent);
}

.stat.critical {
  --stat-color: var(--danger);
}

.stat.neutral {
  --stat-color: #8ea0aa;
}

.stat {
  border-color: color-mix(in srgb, var(--stat-color) 24%, rgba(119, 86, 40, 0.76));
}

.stat:first-child {
  border-left-width: 1px;
}

.stat:hover,
.stat:focus-visible {
  background:
    linear-gradient(180deg, rgba(50, 58, 56, 0.98), rgba(30, 35, 34, 0.98)),
    rgba(45, 53, 58, 0.96);
  border-color: color-mix(in srgb, var(--stat-color) 62%, rgba(170, 179, 167, 0.18));
}

.stat .stat-label {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-row: 1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  min-width: 0;
}

.stat-icon {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.52)) saturate(1.12);
  opacity: 0.98;
}

.civic-balance-icon {
  border: 1px solid rgba(226, 168, 68, 0.48);
  border-radius: 8px 2px 8px 2px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 151, 0.1),
    0 0 10px rgba(226, 168, 68, 0.18);
  object-fit: cover;
}

.stat strong {
  display: block;
  margin-top: 0;
  font-size: 19px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: visible;
}

.stat em {
  display: none;
  min-height: 11px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-style: normal;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .stat-bar {
  display: block;
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 0;
  overflow: hidden;
  background: rgba(8, 10, 10, 0.42);
  border-radius: 999px;
}

.stat .stat-bar i {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--stat-color);
  border-radius: inherit;
}

.stat[data-stat="trajectory"] .civic-mini-meter {
  position: absolute;
  right: 9px;
  bottom: 2px;
  left: 9px;
  height: 4px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(216, 111, 92, 0.82), rgba(228, 179, 99, 0.64) 50%, rgba(140, 205, 127, 0.82)),
    url("./assets/ui/utopia-dystopia-balance.png") center / cover no-repeat;
  border-radius: 999px;
  opacity: 0.86;
}

.stat[data-stat="trajectory"] .civic-mini-meter b {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  background: #fff0bf;
  border: 1px solid rgba(34, 19, 7, 0.68);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 224, 145, 0.72);
  transform: translate(-50%, -50%);
}

.hud-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  background: rgba(18, 21, 23, 0.98);
  border: 1px solid rgba(228, 179, 99, 0.52);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.hud-tooltip[hidden] {
  display: none;
}

.build-tool-tooltip {
  position: fixed;
  z-index: 1002;
  width: min(360px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
  padding: 13px;
  color: var(--text);
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(231, 183, 100, 0.14), transparent 90px),
    linear-gradient(160deg, rgba(21, 27, 25, 0.99), rgba(6, 10, 9, 0.99));
  border: 1px solid rgba(226, 168, 68, 0.92);
  border-radius: 10px 3px 10px 3px;
  box-shadow:
    0 0 0 1px rgba(255, 224, 145, 0.12),
    0 0 0 3px rgba(80, 50, 18, 0.72),
    0 18px 44px rgba(0, 0, 0, 0.62);
}

.build-tool-tooltip[hidden] {
  display: none;
}

.build-tool-tooltip:has(.autonomous-roadmap) {
  width: min(430px, calc(100vw - 20px));
}

.build-guide-heading {
  display: grid;
  gap: 2px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(226, 168, 68, 0.28);
}

.build-guide-heading span,
.build-guide-heading em,
.build-guide-subjects section > span,
.build-guide-route > span,
.build-guide-lock span {
  color: #b6b9aa;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.build-guide-heading strong {
  color: #f5e5bd;
  font: 800 18px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.build-guide-description {
  margin: 9px 0;
  color: #d7d9cf;
  font-size: 11px;
  line-height: 1.4;
}

.build-guide-lock,
.build-guide-route {
  display: grid;
  gap: 5px;
  margin: 8px 0;
  padding: 8px 9px;
  background: rgba(225, 166, 74, 0.08);
  border: 1px solid rgba(225, 166, 74, 0.32);
  border-radius: 5px 2px 5px 2px;
}

.build-guide-lock strong {
  color: #e4bf78;
  font-size: 10px;
  line-height: 1.35;
}

.autonomous-roadmap {
  display: grid;
  gap: 7px;
  margin: 9px 0;
  padding: 9px;
  background: rgba(225, 166, 74, 0.07);
  border: 1px solid rgba(225, 166, 74, 0.38);
  border-radius: 6px 2px 6px 2px;
}

.autonomous-roadmap header {
  display: grid;
  gap: 4px;
}

.autonomous-roadmap header span {
  color: #b6b9aa;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.autonomous-roadmap header strong {
  color: #f1ce84;
  font-size: 11px;
  line-height: 1.35;
}

.autonomous-roadmap ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.autonomous-roadmap li {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 5px;
  padding: 5px 6px;
  background: rgba(4, 8, 7, 0.48);
  border-left: 2px solid #8d7145;
}

.autonomous-roadmap li.complete {
  border-left-color: #75a06d;
}

.autonomous-roadmap li.pending {
  border-left-color: #c27b55;
}

.autonomous-roadmap li.info {
  border-left-color: #7894a1;
}

.autonomous-roadmap li > span {
  color: #d8b56e;
  font-size: 11px;
  font-weight: 900;
}

.autonomous-roadmap li.complete > span {
  color: #8fbd82;
}

.autonomous-roadmap li div {
  display: grid;
  gap: 1px;
}

.autonomous-roadmap li strong,
.autonomous-roadmap li em,
.autonomous-roadmap li small {
  font-style: normal;
  line-height: 1.25;
}

.autonomous-roadmap li strong {
  color: #e7dcc0;
  font-size: 10px;
  text-transform: uppercase;
}

.autonomous-roadmap li em {
  color: #c9cbbf;
  font-size: 10px;
}

.autonomous-roadmap li small,
.autonomous-roadmap footer {
  color: #aeb1a7;
  font-size: 9px;
  line-height: 1.35;
}

.autonomous-roadmap footer {
  padding-top: 5px;
  border-top: 1px solid rgba(225, 166, 74, 0.2);
}

.build-guide-route > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #f2d28b;
  font-size: 9px;
  line-height: 1.25;
}

.build-guide-route b,
.build-guide-route strong {
  min-width: 0;
  font-weight: 750;
}

.build-guide-route i {
  flex: 0 0 auto;
  color: #d49b42;
  font-size: 13px;
  font-style: normal;
}

.build-guide-subjects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.build-guide-subjects section {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(205, 211, 201, 0.13);
  border-radius: 5px 2px 5px 2px;
}

.build-guide-subjects section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.build-guide-subjects section b,
.build-guide-subjects section strong {
  color: #d9dace;
  font-size: 9px;
  line-height: 1.25;
}

.build-guide-subjects section b {
  padding: 2px 4px;
  background: rgba(228, 179, 99, 0.08);
  border: 1px solid rgba(228, 179, 99, 0.18);
  border-radius: 3px;
}

.build-guide-subjects section b.more {
  color: #d7bc78;
}

.build-guide-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 8px 0 0;
}

.build-guide-stats div {
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(226, 168, 68, 0.2);
}

.build-guide-stats dt,
.build-guide-stats dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-guide-stats dt {
  color: #969d90;
  font-size: 8px;
  text-transform: uppercase;
}

.build-guide-stats dd {
  margin-top: 2px;
  color: #f1dfb4;
  font-size: 9px;
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

.play-area {
  position: relative;
  display: grid;
  grid-template-columns: 186px minmax(620px, 1fr) 238px;
  gap: 10px;
  min-height: 0;
  overflow: visible;
}

.panel {
  min-height: 0;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(231, 183, 100, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(20, 25, 24, 0.96), rgba(7, 10, 10, 0.96)),
    var(--panel);
  border: 2px solid rgba(88, 64, 31, 0.92);
  border-radius: 3px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(231, 183, 100, 0.18);
}

.panel-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(231, 183, 100, 0.24);
}

.panel-header h2 {
  font-family: "Cinzel", Georgia, serif;
  font-size: 14px;
  text-align: center;
  text-transform: uppercase;
  color: #f4dfae;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.panel-header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.panel-header-actions .icon-button {
  min-height: 36px;
  font-size: 11px;
}

.category-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.tools-panel {
  position: relative;
  align-self: start;
  overflow: visible;
}

.tool-list {
  display: grid;
  gap: 8px;
}

.build-tool-section {
  display: grid;
  gap: 7px;
}

.build-tool-section + .build-tool-section {
  margin-top: 8px;
}

.build-tool-section-heading {
  display: flex;
  min-height: 24px;
  align-items: center;
  color: #d7bc78;
  border-bottom: 1px solid rgba(226, 168, 68, 0.3);
  font: 800 10px/1 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.build-tool-section-items {
  display: grid;
  gap: 8px;
}

.tool-button-group {
  display: grid;
}

.tool-button-group.has-contract-action .tool-button {
  border-radius: 3px 3px 0 0;
}

.autonomous-contract-action {
  width: 100%;
  padding: 8px 10px;
  color: #241a0d;
  background: linear-gradient(180deg, #f0ce7d, #c28b32);
  border: 1px solid #f6dda0;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.autonomous-contract-action:hover {
  filter: brightness(1.12);
}

.autonomous-contract-status {
  width: 100%;
  padding: 8px 10px;
  color: #bfe3a9;
  background: linear-gradient(180deg, rgba(53, 91, 55, 0.96), rgba(31, 58, 37, 0.98));
  border: 1px solid rgba(142, 201, 120, 0.72);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.tool-button,
.category-button,
.speed-button,
.icon-button {
  width: 100%;
  min-height: 44px;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(231, 183, 100, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(24, 31, 30, 0.95), rgba(9, 13, 13, 0.95));
  border: 1px solid rgba(104, 75, 35, 0.86);
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(231, 183, 100, 0.08), 0 8px 16px rgba(0, 0, 0, 0.18);
}

.category-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  text-transform: uppercase;
}

.category-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.52)) saturate(1.1);
}

.category-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-new-badge {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: #241a0d;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.tool-button {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 88px;
  padding: 7px;
  text-align: left;
}

.tool-button:hover,
.category-button:hover,
.speed-button:hover,
.icon-button:hover,
.tool-button.active,
.category-button.active,
.speed-button.active {
  border-color: var(--brass-border-strong);
  background:
    linear-gradient(180deg, rgba(68, 54, 34, 0.62), rgba(37, 34, 27, 0.9)),
    rgba(231, 183, 100, 0.14);
  box-shadow: inset 0 1px rgba(255, 241, 198, 0.08), 0 8px 22px rgba(0, 0, 0, 0.2);
}

.tool-button.active {
  box-shadow: inset 4px 0 0 var(--accent), inset 0 1px rgba(255, 241, 198, 0.08), 0 8px 22px rgba(0, 0, 0, 0.22);
}

.category-button.active {
  color: var(--text);
}

.tool-button.locked {
  opacity: 0.44;
  cursor: not-allowed;
}

.tool-button.locked.teaser {
  opacity: 1;
  border-color: rgba(139, 119, 82, 0.48);
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(15, 18, 17, 0.92), rgba(7, 9, 9, 0.96)),
    rgba(116, 106, 87, 0.05);
  box-shadow: inset 0 0 0 1px rgba(184, 164, 126, 0.04);
}

.tool-button.level-goal {
  border-color: rgba(216, 163, 62, 0.82);
  box-shadow: inset 3px 0 0 rgba(225, 172, 68, 0.78), inset 0 0 0 1px rgba(247, 210, 125, 0.06);
}

.tool-button.locked.level-goal .tool-copy {
  opacity: 0.88;
}

.tool-button.level-goal .tool-preview-stage {
  color: #241a0d;
  background: #d9a845;
  border-color: #f4d98b;
}

.tool-button.goal-support {
  border-color: rgba(105, 165, 159, 0.72);
  box-shadow: inset 3px 0 0 rgba(105, 165, 159, 0.7), inset 0 0 0 1px rgba(169, 222, 210, 0.05);
}

.tool-button.locked.goal-support .tool-copy {
  opacity: 0.82;
}

.tool-button.goal-support .tool-preview-stage,
.tool-button.locked.goal-support .tool-preview-stage {
  color: #071311;
  background: #70aaa2;
  border-color: #addbd3;
}

.tool-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 72px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 64%, rgba(231, 183, 100, 0.13), transparent 58%),
    rgba(4, 8, 7, 0.62);
  border: 1px solid rgba(183, 125, 42, 0.54);
  border-radius: 8px 2px 8px 2px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.42);
  font-weight: 700;
}

.tool-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.58));
  transform: scale(1.08);
}

.tool-preview-stage {
  position: absolute;
  right: 4px;
  bottom: 3px;
  padding: 2px 5px;
  color: #f2c86d;
  background: rgba(6, 9, 8, 0.88);
  border: 1px solid rgba(211, 151, 56, 0.72);
  border-radius: 5px 1px 5px 1px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.tool-preview-fallback {
  color: var(--muted);
  font-size: 24px;
}

.tool-button.locked .tool-preview img {
  opacity: 0.5;
  filter: grayscale(0.86) saturate(0.25) brightness(0.72) contrast(0.9) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.46));
}

.tool-button.locked .tool-copy {
  opacity: 0.46;
}

.tool-button.locked .tool-preview {
  background: rgba(14, 16, 15, 0.82);
  border-color: rgba(145, 127, 94, 0.36);
}

.tool-button.locked .tool-preview-stage {
  color: #a69b84;
  background: rgba(11, 13, 12, 0.92);
  border-color: rgba(151, 133, 99, 0.44);
}

.tool-button.locked .tool-cost {
  color: #9f8d6b;
  opacity: 0.72;
}

.tool-button.locked:hover {
  border-color: rgba(139, 119, 82, 0.48);
  background:
    linear-gradient(180deg, rgba(15, 18, 17, 0.92), rgba(7, 9, 9, 0.96)),
    rgba(116, 106, 87, 0.05);
  box-shadow: inset 0 0 0 1px rgba(184, 164, 126, 0.04);
}

.tool-button.locked.level-goal,
.tool-button.locked.level-goal:hover {
  border-color: rgba(216, 163, 62, 0.82);
  border-style: solid;
  box-shadow: inset 3px 0 0 rgba(225, 172, 68, 0.78), inset 0 0 0 1px rgba(247, 210, 125, 0.06);
}

.tool-button.locked.level-goal .tool-preview-stage {
  color: #241a0d;
  background: #d9a845;
  border-color: #f4d98b;
}

.tool-copy strong,
.tool-copy span {
  display: block;
}

.tool-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

.tool-info-mark {
  display: inline-grid;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  place-items: center;
  color: #e6bc68;
  border: 1px solid rgba(228, 179, 99, 0.55);
  border-radius: 50%;
  font: 800 9px/1 Georgia, serif;
  text-transform: none;
}

.tool-copy span {
  color: var(--muted);
  font-size: 12px;
}

.tool-cost {
  align-self: start;
  color: var(--accent);
  font-size: 12px;
}

.selected-tool-summary {
  display: grid;
  gap: 3px;
  min-height: 66px;
  margin-top: 10px;
  padding: 9px;
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.1), transparent 40%),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(104, 75, 35, 0.82);
  border-radius: 3px;
}

.selected-tool-summary span,
.selected-tool-summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.selected-tool-summary strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speed-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 0;
}

.build-popup {
  position: absolute;
  top: 14px;
  left: calc(100% + 12px);
  z-index: 16;
  width: min(330px, calc(100vw - 560px));
  max-height: min(680px, calc(100vh - 156px));
  overflow: auto;
  padding: 12px;
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.13), transparent 34%),
    linear-gradient(160deg, rgba(28, 34, 33, 0.97), rgba(14, 17, 17, 0.97));
  border: 1px solid var(--brass-border);
  border-radius: 11px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 241, 198, 0.05);
  backdrop-filter: blur(12px);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.popup-header span,
.modal-header span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.popup-header strong {
  display: block;
  font-size: 15px;
}

.icon-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #1a241d;
  border: 2px solid rgba(88, 64, 31, 0.92);
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(231, 183, 100, 0.12);
}

.map-wrap::after {
  position: absolute;
  inset: 8px;
  z-index: 2;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(231, 183, 100, 0.18);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.28);
}

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

#gameCanvas.pan-ready {
  cursor: grab;
}

#gameCanvas.panning {
  cursor: grabbing;
}

.map-hud {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.city-alerts {
  position: absolute;
  top: 202px;
  left: 50%;
  z-index: 6;
  width: min(620px, calc(100% - 310px));
  pointer-events: none;
  transform: translateX(-50%);
}

.city-alerts[hidden] { display: none; }

.city-alert {
  position: relative;
  padding: 16px 48px 14px 18px;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 0, rgba(231, 183, 100, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(27, 27, 22, 0.97), rgba(8, 12, 11, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.68);
  border-radius: 12px 3px 12px 3px;
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(255, 226, 169, 0.08);
  backdrop-filter: blur(8px) saturate(0.82);
}

.city-alert-header {
  display: grid;
  gap: 3px;
  padding-right: 20px;
}

.city-alert-kicker {
  color: var(--accent);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.city-alert-title {
  color: #f8edcf;
  font-family: "Cinzel", Georgia, serif;
  font-size: 20px;
  line-height: 1.12;
}

.city-alert-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  margin: 13px 0 11px;
  padding: 9px 0;
  border-top: 1px solid rgba(231, 183, 100, 0.28);
  border-bottom: 1px solid rgba(231, 183, 100, 0.2);
}

.city-alert-fact {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 0 10px;
  align-content: start;
  border-left: 1px solid rgba(231, 183, 100, 0.18);
}

.city-alert-fact:first-child { border-left: 0; }
.city-alert-fact.wide { grid-column: 1 / -1; border-left: 0; }

.city-alert-fact > span {
  color: #959d91;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  font-weight: 750;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.city-alert-fact > strong {
  overflow-wrap: anywhere;
  color: #f2e5c5;
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  line-height: 1.25;
}

.city-alert-fact > small {
  color: #b8b2a0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  line-height: 1.3;
}

.city-alert-fact.good > strong { color: var(--good); }
.city-alert-fact.danger > strong { color: #ed927f; }

.city-alert-message,
.city-alert-action {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  line-height: 1.48;
}

.city-alert-message { color: #c7cec2; }

.city-alert-action {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
  color: #f0dcae;
}

.city-alert-action > span {
  color: var(--accent);
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.city-alert.labor-info { border-color: rgba(111, 191, 154, 0.56); }
.city-alert.labor-info .city-alert-kicker { color: var(--good); }
.city-alert.food-warning { border-color: rgba(228, 179, 99, 0.68); }
.city-alert.food-warning .city-alert-kicker { color: var(--accent); }
.city-alert.progression-warning { border-color: rgba(111, 168, 220, 0.68); }
.city-alert.progression-warning .city-alert-kicker { color: var(--water); }
.city-alert-count {
  position: absolute;
  right: 14px;
  bottom: 11px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
}
.city-alert-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  pointer-events: auto;
  color: var(--text);
  background: rgba(8, 11, 11, 0.76);
  border: 1px solid rgba(231, 183, 100, 0.42);
  border-radius: 4px;
  cursor: pointer;
}
.city-alert-dismiss:hover,
.city-alert-dismiss:focus-visible { color: var(--accent); border-color: var(--accent); }

.command-dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 7;
  display: grid;
  grid-template-columns: auto 220px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 7px 10px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(17, 21, 20, 0.9), rgba(6, 9, 9, 0.92));
  border: 2px solid rgba(88, 64, 31, 0.94);
  box-shadow: inset 0 0 0 1px rgba(231, 183, 100, 0.18), 0 18px 44px rgba(0, 0, 0, 0.48);
  transform: translateX(-50%);
}

.season-chip {
  min-width: 86px;
  color: #f4dfae;
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.overlay-bar {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(9, 12, 12, 0.86);
  border: 2px solid rgba(88, 64, 31, 0.86);
  border-radius: 3px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.overlay-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(42, 50, 48, 0.95), rgba(28, 34, 33, 0.95));
  border: 1px solid rgba(174, 182, 168, 0.2);
  border-radius: 3px;
  cursor: pointer;
}

.overlay-button:hover,
.overlay-button.active {
  border-color: var(--brass-border-strong);
  background: rgba(231, 183, 100, 0.18);
}

.overlay-button span {
  font-size: 12px;
  font-weight: 800;
}

.overlay-legend {
  max-width: 250px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(18, 20, 22, 0.84);
  border: 1px solid rgba(170, 179, 167, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.3;
  backdrop-filter: blur(10px);
}

.overlay-legend strong,
.overlay-legend span {
  display: block;
}

.overlay-legend strong {
  color: var(--text);
  font-size: 12px;
}

.tooltip-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.tooltip-title strong {
  font-size: 14px;
}

.tooltip-title span,
.tooltip-body,
.tooltip-meta,
.tooltip-action {
  color: var(--muted);
  font-size: 11px;
}

.tooltip-body {
  line-height: 1.35;
}

.tooltip-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 8px 0 0;
}

.tooltip-stats div {
  min-width: 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.tooltip-stats dt,
.tooltip-stats dd {
  margin: 0;
}

.tooltip-stats dt {
  color: var(--muted);
  font-size: 10px;
}

.tooltip-stats dd {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.agent-panel {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.agent-panel h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.agent-list {
  display: grid;
  gap: 5px;
}

.agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.agent-row > span:last-child {
  text-align: right;
}

.agent-row strong,
.agent-row small {
  display: block;
}

.agent-row strong {
  font-size: 11px;
}

.agent-row small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.tooltip-hints,
.tooltip-meta,
.tooltip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tooltip-hints span,
.tooltip-meta span,
.tooltip-actions span {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(170, 179, 167, 0.14);
  border-radius: 999px;
  font-size: 10px;
}

.tooltip-hints .danger,
.tooltip-action.blocked {
  color: var(--danger);
}

.tooltip-hints .warning {
  color: var(--accent);
}

.tooltip-hints .info,
.tooltip-action.ready {
  color: var(--good);
}

.tooltip-action {
  margin-top: 8px;
  font-weight: 700;
}

.tooltip-actions span {
  color: var(--text);
  border-color: rgba(228, 179, 99, 0.24);
}

.hover-hints {
  color: var(--accent);
  font-weight: 700;
}

.inspector-header,
.modal-header,
.modal-actions,
.inspector-upgrade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inspector-header strong,
.modal-header strong {
  display: block;
  font-size: 14px;
}

.inspector-header span,
.modal-header span,
.inspector-upgrade span,
.modal-section p,
.modal-missing {
  color: var(--muted);
  font-size: 11px;
}

.inspector-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.inspector-upgrade {
  align-items: stretch;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.inspector-upgrade button,
.modal-actions button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(228, 179, 99, 0.14);
  border: 1px solid rgba(228, 179, 99, 0.36);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.inspector-upgrade button:disabled,
.modal-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: auto;
}

.selection-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 34px);
}

.selection-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(240px, 365px) auto minmax(0, 1fr);
  width: min(1320px, calc(100vw - 40px));
  max-height: min(900px, calc(100vh - 40px));
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(231, 183, 100, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(31, 36, 34, 0.995), rgba(15, 18, 18, 0.995));
  border: 1px solid var(--brass-border-strong);
  border-radius: 16px;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.68), inset 0 1px rgba(255, 241, 198, 0.08), inset 0 -1px rgba(0, 0, 0, 0.45);
}

.selection-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  gap: 16px;
  align-items: center;
  padding: 18px 20px 14px;
  background:
    linear-gradient(90deg, rgba(231, 183, 100, 0.1), transparent 56%),
    rgba(255, 255, 255, 0.018);
  border-bottom: 1px solid rgba(231, 183, 100, 0.22);
}

.selection-header span,
.selection-eyebrow,
.section-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-header h2 {
  margin: 3px 0 0;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1;
}

.selection-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(174, 182, 168, 0.24);
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.selection-close:hover {
  color: var(--accent);
  border-color: var(--brass-border-strong);
  background: rgba(231, 183, 100, 0.11);
}

.selection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(174, 182, 168, 0.2);
  border-radius: 999px;
}

.selection-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-follow-button {
  min-height: 34px;
  padding: 0 12px;
  color: #e8d9af;
  background: linear-gradient(180deg, rgba(34, 38, 34, 0.96), rgba(10, 13, 12, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.42);
  border-radius: 4px;
  cursor: pointer;
  font: 700 11px/1 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.selection-follow-button:hover,
.selection-follow-button:focus-visible,
.selection-follow-button.active {
  color: #fff1c7;
  border-color: rgba(231, 183, 100, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 188, 0.12), 0 0 12px rgba(231, 183, 100, 0.18);
  outline: none;
}

.selection-status i,
.route-row > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--muted);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(170, 179, 167, 0.1);
}

.selection-status.good i,
.route-row.reachable > i { background: var(--good); box-shadow: 0 0 0 4px rgba(140, 205, 127, 0.12); }
.selection-status.warning i { background: var(--accent); box-shadow: 0 0 0 4px rgba(228, 179, 99, 0.12); }
.selection-status.danger i,
.route-row.blocked > i { background: var(--danger); box-shadow: 0 0 0 4px rgba(216, 111, 92, 0.12); }

.selection-status span {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.selection-hero {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(560px, 1.3fr);
  min-height: 0;
  border-bottom: 1px solid rgba(231, 183, 100, 0.18);
}

.selection-art {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(rgba(12, 17, 14, 0.1), rgba(12, 17, 14, 0.6)),
    radial-gradient(ellipse at center, rgba(127, 195, 158, 0.13), transparent 64%),
    #121a16;
  border-right: 1px solid rgba(231, 183, 100, 0.16);
}

.selection-art img,
.selection-development-art img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.42));
}

.selection-art-fallback,
.resident-monogram {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  color: #171a17;
  background: linear-gradient(145deg, var(--accent), #8ccd7f);
  border-radius: 26px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  font-size: 40px;
  font-weight: 900;
}

.selection-hero-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 14px 20px;
}

.selection-hero-copy p,
.development-copy p,
.resource-hero p {
  margin: 4px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.selection-key-stats,
.selection-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.selection-key-stats {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.selection-metric,
.selection-detail-card {
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.032));
  border: 1px solid rgba(174, 182, 168, 0.16);
  border-radius: 10px;
  box-shadow: inset 0 1px rgba(255, 241, 198, 0.035);
}

button.selection-detail-card {
  cursor: pointer;
}

button.selection-detail-card:hover {
  border-color: var(--brass-border-strong);
  background: rgba(228, 179, 99, 0.08);
}

.selection-metric span,
.selection-detail-card span,
.selection-detail-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.selection-metric strong,
.selection-detail-card strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.selection-metric.warning {
  border-color: rgba(228, 179, 99, 0.52);
  background: rgba(228, 179, 99, 0.09);
}

.selection-metric.danger {
  border-color: rgba(216, 111, 92, 0.62);
  background: rgba(216, 111, 92, 0.12);
}

.selection-metric.warning strong { color: var(--accent); }
.selection-metric.danger strong,
.condition-value.danger { color: var(--danger); }
.condition-value.warning { color: var(--accent); }
.condition-value.good { color: var(--good); }

.selection-quick-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.selection-quick-actions .selection-primary {
  min-height: 38px;
}

.selection-upgrade-summary > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.selection-upgrade-summary {
  min-width: 0;
}

.selection-upgrade-summary > div {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  overflow-x: auto;
}

.selection-upgrade-summary em {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.selection-upgrade-summary em b { color: var(--text); }
.selection-upgrade-summary em strong { color: var(--good); }

.selection-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 0.65fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(10, 16, 14, 0.62);
  border: 1px solid rgba(174, 182, 168, 0.16);
  border-radius: 9px;
}

.selection-flow > span { min-width: 0; }
.selection-flow small,
.selection-flow strong { display: block; }
.selection-flow small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.selection-flow strong { margin-top: 2px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.selection-flow > i { color: var(--accent); font-style: normal; }
.flow-efficiency b { display: block; height: 3px; margin-top: 4px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 999px; }
.flow-efficiency b em { display: block; height: 100%; background: var(--good); }

.selection-detail-card small {
  margin-top: 4px;
  line-height: 1.3;
}

.selection-tabs {
  display: flex;
  gap: 5px;
  padding: 9px 12px 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(231, 183, 100, 0.16);
}

.selection-tabs button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.selection-tabs button:hover,
.selection-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 14px rgba(231, 183, 100, 0.16);
}

.selection-body {
  min-height: 190px;
  overflow: auto;
  padding: 18px 20px 22px;
}

.selection-section + .selection-section {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-heading strong {
  font-size: 15px;
}

.selection-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.selection-alert {
  padding: 11px 13px;
  background: rgba(111, 168, 220, 0.08);
  border: 1px solid rgba(111, 168, 220, 0.24);
  border-left: 4px solid #6fa8dc;
  border-radius: 9px;
  box-shadow: inset 0 1px rgba(255, 241, 198, 0.035);
}

.selection-alert.warning { background: rgba(228, 179, 99, 0.08); border-color: rgba(228, 179, 99, 0.28); border-left-color: var(--accent); }
.selection-alert.danger { background: rgba(216, 111, 92, 0.08); border-color: rgba(216, 111, 92, 0.28); border-left-color: var(--danger); }
.selection-alert.good { background: rgba(140, 205, 127, 0.08); border-color: rgba(140, 205, 127, 0.28); border-left-color: var(--good); }

.selection-alert strong,
.selection-alert span {
  display: block;
}

.selection-alert strong { font-size: 12px; }
.selection-alert span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.selection-dense-stats .tooltip-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.selection-dense-stats .tooltip-stats div {
  padding: 10px 12px;
  border: 1px solid rgba(170, 179, 167, 0.12);
  border-radius: 9px;
}

.selection-dense-stats .tooltip-stats dt { font-size: 10px; }
.selection-dense-stats .tooltip-stats dd { margin-top: 3px; font-size: 12px; }

.building-health-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.building-health-row {
  display: grid;
  grid-template-columns: 9px minmax(76px, 0.55fr) minmax(110px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(205, 211, 201, 0.16);
  border-radius: 9px;
}

.building-health-row > i,
.improvement-tip > i {
  width: 8px;
  height: 8px;
  background: var(--text);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(236, 236, 220, 0.2);
}

.building-health-row > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.building-health-row > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.building-health-row > small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.building-health-row.danger {
  background: rgba(216, 111, 92, 0.075);
  border-color: rgba(216, 111, 92, 0.3);
}

.building-health-row.danger > i,
.improvement-tip.danger > i { background: var(--danger); box-shadow: 0 0 11px rgba(216, 111, 92, 0.42); }
.building-health-row.danger > strong { color: var(--danger); }

.building-health-row.good {
  background: rgba(140, 205, 127, 0.07);
  border-color: rgba(140, 205, 127, 0.28);
}

.building-health-row.good > i,
.improvement-tip.good > i { background: var(--good); box-shadow: 0 0 11px rgba(140, 205, 127, 0.4); }
.building-health-row.good > strong { color: var(--good); }

.improvement-tip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.improvement-tip {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(205, 211, 201, 0.14);
  border-radius: 9px;
}

.improvement-tip > i { margin-top: 3px; }
.improvement-tip strong,
.improvement-tip small { display: block; }
.improvement-tip strong { font-size: 11px; }
.improvement-tip small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.improvement-tip.danger { border-color: rgba(216, 111, 92, 0.25); }
.improvement-tip.good { border-color: rgba(140, 205, 127, 0.24); }

.selection-people-list,
.route-list {
  display: grid;
  gap: 7px;
}

.selection-person-row,
.route-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.5fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(170, 179, 167, 0.12);
  border-radius: 9px;
}

.selection-person-row { cursor: pointer; }
.selection-person-row:hover { border-color: var(--accent); background: rgba(228, 179, 99, 0.08); }
.selection-person-row span:nth-child(2) { text-align: right; }
.selection-person-row strong,
.selection-person-row small { display: block; }
.selection-person-row small,
.selection-person-row em,
.route-row small,
.route-row em { color: var(--muted); font-size: 10px; font-style: normal; }

.storage-policy-list {
  display: grid;
  gap: 7px;
}

.storage-policy-header,
.storage-policy-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) repeat(3, minmax(104px, 0.8fr)) minmax(126px, 0.9fr) 92px;
  gap: 9px;
  align-items: center;
}

.storage-policy-header {
  padding: 0 11px 4px 45px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.storage-policy-row {
  grid-template-columns: 28px minmax(115px, 1.15fr) repeat(3, minmax(104px, 0.8fr)) minmax(126px, 0.9fr) 92px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(170, 179, 167, 0.15);
  border-radius: 9px;
}

.storage-policy-row.disabled { opacity: 0.62; }
.storage-policy-row.danger { border-color: rgba(216, 111, 92, 0.28); }
.storage-policy-row.good { border-color: rgba(140, 205, 127, 0.24); }
.storage-policy-row span,
.storage-policy-row label { min-width: 0; }
.storage-policy-row strong,
.storage-policy-row small,
.storage-policy-row em { display: block; }
.storage-policy-row strong { overflow-wrap: anywhere; font-size: 11px; }
.storage-policy-row small,
.storage-policy-row em { color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.35; }
.storage-policy-product small { margin-top: 2px; }
.storage-target-control select {
  width: 100%;
  margin: 2px 0;
  padding: 4px 6px;
  color: var(--text);
  background: rgba(7, 13, 12, 0.9);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.storage-policy-toggle {
  padding: 7px 8px;
  color: var(--text);
  font-size: 9px;
  font-weight: 800;
  background: rgba(216, 111, 92, 0.12);
  border: 1px solid rgba(216, 111, 92, 0.38);
  border-radius: 6px;
  cursor: pointer;
}

.storage-policy-toggle.on {
  color: var(--good);
  background: rgba(140, 205, 127, 0.1);
  border-color: rgba(140, 205, 127, 0.4);
}

.needs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.need-card {
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(170, 179, 167, 0.12);
  border-radius: 9px;
}

.need-card > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.need-card em { color: var(--muted); font-style: normal; }
.need-card > div { height: 7px; overflow: hidden; background: rgba(255, 255, 255, 0.08); border-radius: 999px; }
.need-card i { display: block; height: 100%; background: var(--good); border-radius: inherit; }
.need-card.warning i { background: var(--accent); }
.need-card.danger i { background: var(--danger); }

.route-row {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}
.route-row span strong,
.route-row span small { display: block; }
.route-row span small { margin-top: 2px; }
.route-row.reachable em { color: var(--good); }
.route-row.blocked em,
.route-row .missing { color: var(--danger); }

.development-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
}

.development-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
}

.development-copy h3 { margin: 4px 0 0; font-size: 22px; }
.development-cost { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.development-cost span { color: var(--muted); }
.selection-primary {
  min-height: 42px;
  padding: 0 15px;
  color: #171a17;
  background: linear-gradient(135deg, var(--accent), #cf9e4f);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 900;
}
.selection-primary:disabled { cursor: not-allowed; filter: grayscale(0.7); opacity: 0.5; }
.workplace-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(231, 183, 100, 0.07);
  border: 1px solid rgba(231, 183, 100, 0.34);
  border-radius: 9px;
}

.building-condition-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(140, 205, 127, 0.055);
  border: 1px solid rgba(140, 205, 127, 0.3);
  border-radius: 9px;
}

.building-condition-control.warning {
  background: rgba(228, 179, 99, 0.08);
  border-color: rgba(228, 179, 99, 0.42);
}

.building-condition-control.danger {
  background: rgba(216, 111, 92, 0.1);
  border-color: rgba(216, 111, 92, 0.55);
}

.building-condition-control span,
.building-condition-control strong,
.building-condition-control small { display: block; }
.building-condition-control span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.building-condition-control strong { margin-top: 2px; color: var(--good); font-size: 12px; }
.building-condition-control.warning strong { color: var(--accent); }
.building-condition-control.danger strong { color: var(--danger); }
.building-condition-control small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.workplace-control.paused {
  background: rgba(111, 191, 154, 0.06);
  border-color: rgba(111, 191, 154, 0.38);
}

.workplace-control span,
.workplace-control strong,
.workplace-control small { display: block; }
.workplace-control span { color: var(--accent); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.workplace-control.paused span { color: var(--good); }
.workplace-control strong { margin-top: 2px; font-size: 12px; }
.workplace-control small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }

.selection-secondary {
  min-height: 38px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(18, 20, 18, 0.82);
  border: 1px solid rgba(231, 183, 100, 0.55);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
}

.selection-secondary:hover:not(:disabled) { color: #171a17; background: var(--accent); }
.selection-secondary:disabled { cursor: not-allowed; opacity: 0.48; }
.selection-secondary.workplace-toggle.active {
  color: #dff2d4;
  background: linear-gradient(180deg, rgba(43, 75, 42, 0.96), rgba(15, 31, 19, 0.98));
  border-color: rgba(126, 205, 103, 0.86);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(126, 205, 103, 0.16);
  transform: translateY(1px);
}
.selection-development-art { min-height: 250px; margin: 0; padding: 14px; }

.selection-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}
.selection-empty strong,
.selection-empty span { display: block; }
.selection-empty strong { color: var(--text); font-size: 16px; }

.resource-selection-card { grid-template-rows: auto auto minmax(0, 1fr); }
.resource-hero { display: flex; align-items: center; gap: 18px; padding: 28px; border-bottom: 1px solid var(--line); }
.resource-hero > span { display: grid; width: 90px; height: 90px; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--resource-color) 32%, #202421); border: 1px solid var(--resource-color); border-radius: 22px; font-size: 42px; }
.resource-hero strong { font-size: 20px; }

@media (max-width: 780px) {
  .selection-modal { padding: 8px; }
  .selection-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); grid-template-rows: auto auto auto minmax(0, 1fr); border-radius: 12px; }
  .selection-header { grid-template-columns: minmax(0, 1fr) 38px; padding: 14px; }
  .selection-header-actions { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; justify-self: start; }
  .workplace-control,
  .building-condition-control { grid-template-columns: 1fr; }
  .city-alerts { top: 142px; width: calc(100% - 24px); }
  .city-alert { padding: 14px 44px 13px 14px; }
  .city-alert-title { font-size: 17px; }
  .city-alert-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-alert-fact:nth-child(odd) { border-left: 0; }
  .city-alert-fact { padding-block: 5px; }
  .city-alert-action { grid-template-columns: 1fr; gap: 2px; }
  .selection-status { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .selection-close { grid-column: 2; grid-row: 1; }
  .selection-hero { grid-template-columns: 1fr; }
  .selection-art { min-height: 170px; max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .selection-hero-copy { padding: 14px; }
  .selection-body { padding: 14px; }
  .selection-detail-grid,
  .selection-key-stats,
  .needs-grid,
  .development-layout,
  .building-health-table,
  .improvement-tip-list { grid-template-columns: 1fr; }
  .selection-quick-actions { grid-template-columns: 1fr; }
  .selection-flow { grid-template-columns: 1fr; }
  .selection-flow > i { display: none; }
  .selection-dense-stats .tooltip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selection-person-row { grid-template-columns: minmax(0, 1fr) auto; }
  .selection-person-row em { display: none; }
  .storage-policy-header { display: none; }
  .storage-policy-row { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; }
  .storage-policy-row > span:nth-of-type(n + 3),
  .storage-policy-row > .storage-target-control { grid-column: 2 / -1; }
  .storage-policy-row > .storage-policy-toggle { grid-column: 3; grid-row: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(231, 183, 100, 0.08), transparent 30%),
    rgba(5, 7, 7, 0.7);
  backdrop-filter: blur(7px) saturate(0.72);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(231, 183, 100, 0.12), transparent 34%),
    rgba(18, 22, 22, 0.98);
  border: 1px solid var(--brass-border);
  border-radius: 12px;
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.6), inset 0 1px rgba(255, 241, 198, 0.06);
}

.modal-section {
  margin-top: 12px;
}

.modal-section h3 {
  margin: 0 0 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.modal-section p {
  margin: 0;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-tags span {
  padding: 4px 7px;
  color: var(--good);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.modal-tags .missing,
.modal-missing {
  color: var(--danger);
}

.upgrade-preview-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.upgrade-preview {
  display: grid;
  grid-template-rows: auto minmax(168px, 1fr) auto;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upgrade-preview span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.upgrade-preview img {
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 168px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.36));
}

.upgrade-preview strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-preview {
  grid-template-rows: auto 1fr auto;
  min-height: 214px;
  place-items: center;
}

.upgrade-compare {
  display: grid;
  gap: 6px;
  margin: 0;
}

.upgrade-compare div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.upgrade-compare dt,
.upgrade-compare dd {
  margin: 0;
}

.upgrade-compare dt {
  color: var(--muted);
  font-size: 11px;
}

.upgrade-compare dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  font-size: 11px;
}

.upgrade-compare dd span {
  color: var(--muted);
}

.upgrade-compare dd strong {
  color: var(--good);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.modal-actions .primary {
  background: rgba(140, 205, 127, 0.18);
  border-color: rgba(140, 205, 127, 0.48);
}

.intel-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  align-self: start;
  overflow: visible;
}

.intel-sticky-hint {
  display: grid;
  gap: 8px;
}

.intel-actions {
  display: grid;
  gap: 7px;
}

.intel-action-button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  gap: 4px 9px;
  width: 100%;
  min-height: 52px;
  padding: 7px 9px 7px 6px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(24, 31, 30, 0.94), rgba(8, 11, 11, 0.96));
  border: 1px solid rgba(104, 75, 35, 0.88);
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(231, 183, 100, 0.08);
}

.intel-action-button img {
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.52)) saturate(1.08);
}

.intel-action-button:hover,
.intel-action-button.active {
  border-color: var(--brass-border-strong);
  background:
    linear-gradient(180deg, rgba(67, 51, 28, 0.72), rgba(20, 17, 12, 0.95));
}

.intel-action-button span,
.intel-action-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-action-button span {
  align-self: end;
  font-size: 12px;
  font-weight: 700;
}

.intel-action-button strong {
  align-self: start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.reading {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.trajectory-panel {
  --trajectory-color: #d6b66b;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 12px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(44, 47, 43, 0.94), rgba(27, 31, 31, 0.96));
  border: 1px solid color-mix(in srgb, var(--trajectory-color) 42%, var(--line));
  border-radius: 10px;
}

.trajectory-panel.utopian { --trajectory-color: #8ccd7f; }
.trajectory-panel.dystopian { --trajectory-color: #d86f5c; }

.trajectory-heading,
.trajectory-heading > div,
.trajectory-dimension,
.trajectory-cause {
  display: flex;
}

.trajectory-heading {
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trajectory-emblem {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--trajectory-color) 55%, rgba(231, 183, 100, 0.25));
  border-radius: 12px 3px 12px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 151, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.32);
}

.trajectory-heading > div,
.trajectory-cause {
  flex-direction: column;
}

.trajectory-heading span,
.trajectory-rule,
.trajectory-hints,
.trajectory-cause span {
  color: var(--muted);
}

.trajectory-heading strong { font-size: 17px; }
.trajectory-heading b { color: var(--trajectory-color); font-size: 25px; }

.trajectory-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  height: 30px;
  margin: 12px 0 10px;
  padding-top: 13px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, rgba(216, 111, 92, 0.75), rgba(215, 180, 104, 0.4) 50%, rgba(140, 205, 127, 0.75)) center 5px / 100% 6px no-repeat;
  border-radius: 999px;
}

.trajectory-scale i {
  position: absolute;
  top: 0;
  width: 3px;
  height: 17px;
  margin-left: -1px;
  background: #fff6dd;
  border-radius: 2px;
  box-shadow: 0 0 8px var(--trajectory-color);
}

.trajectory-dimensions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.trajectory-dimension {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px;
  font-size: 10px;
}

.trajectory-dimension b { color: var(--trajectory-color); }
.trajectory-dimension em {
  flex-basis: 100%;
  height: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}

.trajectory-dimension em i {
  display: block;
  height: 100%;
  background: var(--trajectory-color);
}

.trajectory-causes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.trajectory-cause {
  gap: 3px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 7px;
  font-size: 10px;
}

.trajectory-cause.positive > strong,
.trajectory-cause.positive span b { color: var(--good); }
.trajectory-cause.negative > strong,
.trajectory-cause.negative span b { color: var(--danger); }

.trajectory-rule {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.4;
}

.reading > p { margin: 8px 0 0; }
.trajectory-hints strong { color: var(--accent); }

@media (max-width: 720px) {
  .trajectory-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trajectory-causes { grid-template-columns: 1fr; }
}

.guidance-card {
  margin-top: 0;
}

.guidance-empty,
.guidance-alert {
  padding: 11px;
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(24, 31, 30, 0.94), rgba(8, 11, 11, 0.96));
  border: 1px solid rgba(104, 75, 35, 0.88);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(231, 183, 100, 0.08);
}

.guidance-empty strong,
.guidance-alert strong,
.guidance-empty span,
.guidance-alert span,
.guidance-alert p {
  display: block;
}

.guidance-empty strong,
.guidance-alert strong {
  font-size: 13px;
}

.guidance-empty span,
.guidance-alert span,
.guidance-alert p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.guidance-alert {
  border-color: rgba(231, 183, 100, 0.46);
}

.guidance-alert.warning {
  border-color: rgba(231, 183, 100, 0.64);
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(36, 29, 18, 0.96), rgba(11, 9, 7, 0.96));
}

.guidance-alert.info {
  border-color: rgba(111, 191, 154, 0.42);
  background: rgba(111, 191, 154, 0.07);
}

.guidance-alert.success {
  border-color: rgba(116, 214, 145, 0.72);
  background:
    radial-gradient(circle at 0% 0%, rgba(116, 214, 145, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(17, 45, 31, 0.96), rgba(7, 19, 13, 0.98));
  box-shadow: inset 0 0 0 1px rgba(151, 235, 169, 0.1), 0 0 14px rgba(71, 180, 105, 0.12);
}

.guidance-alert.success strong {
  color: #91e5a5;
}

.guidance-alert.success span,
.guidance-alert.success p {
  color: #b7d9bf;
}

.tutorial-guidance {
  display: grid;
  gap: 7px;
  padding: 11px;
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(35, 29, 19, 0.97), rgba(10, 10, 8, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.68);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 174, 0.08), 0 0 18px rgba(216, 156, 55, 0.08);
}

.tutorial-guidance.completed {
  border-color: rgba(116, 214, 145, 0.72);
  background:
    radial-gradient(circle at 0% 0%, rgba(116, 214, 145, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(17, 42, 29, 0.97), rgba(7, 16, 11, 0.98));
}

.tutorial-guidance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent);
  font: 800 9px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tutorial-guidance-heading em {
  color: #f4dfae;
  font-style: normal;
}

.tutorial-guidance > strong {
  color: #f7e5b8;
  font: 800 14px/1.15 "Cinzel", Georgia, serif;
}

.tutorial-guidance > p,
.tutorial-guidance > small,
.tutorial-hint p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.38;
}

.tutorial-guidance > small b,
.tutorial-hint span {
  color: var(--accent);
}

.tutorial-hint {
  padding: 7px 8px;
  background: rgba(231, 183, 100, 0.08);
  border-left: 2px solid rgba(231, 183, 100, 0.66);
}

.tutorial-hint span {
  display: block;
  margin-bottom: 2px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tutorial-confirmation {
  padding: 5px 7px;
  color: #9be5ad;
  background: rgba(74, 168, 98, 0.12);
  border: 1px solid rgba(116, 214, 145, 0.28);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
}

.tutorial-guidance-actions {
  display: flex;
  gap: 6px;
}

.tutorial-guidance-actions button {
  min-height: 28px;
  padding: 4px 9px;
  color: #f3d997;
  background: linear-gradient(180deg, rgba(48, 39, 24, 0.98), rgba(16, 14, 10, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.52);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.tutorial-guidance-actions button:hover,
.tutorial-guidance-actions button:focus-visible {
  color: #fff2c9;
  border-color: #efb957;
  outline: none;
}

.tutorial-focus {
  position: relative;
  outline: 2px solid rgba(255, 205, 105, 0.92) !important;
  outline-offset: 2px;
  will-change: box-shadow;
  animation: tutorial-focus-pulse 1.15s ease-in-out infinite;
}

#gameCanvas.tutorial-focus {
  outline-offset: -8px;
  animation-name: tutorial-canvas-pulse;
}

@keyframes tutorial-focus-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 185, 87, 0.18), 0 0 9px rgba(239, 185, 87, 0.18);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(239, 185, 87, 0.1), 0 0 26px rgba(239, 185, 87, 0.68);
  }
}

@keyframes tutorial-canvas-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(239, 185, 87, 0.44), inset 0 0 16px rgba(239, 185, 87, 0.06); }
  50% { box-shadow: inset 0 0 0 5px rgba(255, 210, 118, 0.86), inset 0 0 34px rgba(239, 185, 87, 0.18); }
}

.intel-panel.tutorial-active:not(.collapsed) .guidance-card {
  max-height: min(390px, calc(100vh - 190px));
  overflow: auto;
}

.intel-panel.tutorial-active #intelActions[hidden] {
  display: none;
}

.tutorial-level-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.tutorial-level-overlay[hidden] {
  display: none;
}

.tutorial-level-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(26, 34, 29, 0.28), rgba(2, 4, 4, 0.82) 68%),
    rgba(2, 4, 4, 0.46);
  backdrop-filter: blur(3px);
}

.tutorial-level-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(860px, calc(100vw - 44px));
  max-height: calc(100vh - 48px);
  padding: clamp(24px, 4vh, 44px) clamp(28px, 5vw, 56px);
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(231, 183, 100, 0.19), transparent 43%),
    linear-gradient(160deg, rgba(28, 33, 30, 0.99), rgba(8, 11, 10, 0.99));
  border: 2px solid rgba(159, 110, 45, 0.9);
  border-radius: 5px;
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.76), inset 0 0 0 1px rgba(255, 229, 169, 0.13), inset 0 0 44px rgba(231, 183, 100, 0.05);
}

.tutorial-level-card::before,
.tutorial-level-card::after {
  position: absolute;
  width: 62px;
  height: 62px;
  pointer-events: none;
  content: "";
  border-color: rgba(231, 183, 100, 0.52);
}

.tutorial-level-card::before {
  top: 9px;
  left: 9px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.tutorial-level-card::after {
  right: 9px;
  bottom: 9px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.tutorial-level-eyebrow {
  color: var(--accent);
  font: 800 11px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.tutorial-level-card h2 {
  margin: 10px 0 7px;
  color: #f7e5b8;
  font: 800 clamp(24px, 4vw, 38px)/1.08 "Cinzel Decorative", "Cinzel", Georgia, serif;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.72);
}

.tutorial-level-card > strong {
  color: #d9c18b;
  font: 700 13px/1.4 "Cinzel", Georgia, serif;
}

.tutorial-level-card p {
  max-width: 480px;
  margin: 18px 0 0;
  color: #c7c0aa;
  font-size: 14px;
  line-height: 1.6;
}

.tutorial-level-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: min(720px, 100%);
  margin: 20px 0 0;
  padding: 0;
  overflow: visible;
  list-style: none;
  text-align: left;
}

.tutorial-level-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  color: rgba(245, 241, 229, 0.64);
  background: rgba(255, 241, 198, 0.045);
  border: 1px solid rgba(231, 183, 100, 0.16);
  border-radius: 4px;
}

.tutorial-level-list li.current {
  color: #f7e5b8;
  background: rgba(231, 183, 100, 0.14);
  border-color: rgba(231, 183, 100, 0.48);
}

.tutorial-level-list li.complete {
  color: rgba(198, 238, 192, 0.86);
  border-color: rgba(122, 201, 132, 0.32);
}

.tutorial-level-list span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #1b160d;
  background: linear-gradient(180deg, #e9c779, #9f6e2d);
  border-radius: 999px;
  font: 900 11px/1 "Cinzel", Georgia, serif;
}

.tutorial-level-list strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutorial-level-card .tutorial-level-list button {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: none;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  font: 800 11px/1.2 "Cinzel", Georgia, serif;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.tutorial-level-card .tutorial-level-list button:hover,
.tutorial-level-card .tutorial-level-list button:focus-visible {
  color: #f7e5b8;
  filter: none;
  outline: 1px solid rgba(255, 226, 164, 0.46);
  outline-offset: 3px;
}

.tutorial-level-list em {
  color: inherit;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tutorial-level-card small {
  margin-top: 14px;
  color: #91d4a3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tutorial-level-card button {
  min-width: 190px;
  min-height: 46px;
  margin-top: 24px;
  padding: 10px 20px;
  color: #1b160d;
  background: linear-gradient(180deg, #f0c66f, #b97b2f);
  border: 1px solid #ffe0a0;
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 249, 218, 0.54);
  cursor: pointer;
  font: 900 11px/1 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tutorial-level-card button:hover,
.tutorial-level-card button:focus-visible {
  filter: brightness(1.12);
  outline: 2px solid rgba(255, 226, 164, 0.46);
  outline-offset: 3px;
}

.tutorial-level-card.end {
  border-color: rgba(93, 164, 110, 0.82);
  background:
    radial-gradient(circle at 50% 0%, rgba(104, 201, 127, 0.17), transparent 43%),
    linear-gradient(160deg, rgba(21, 40, 29, 0.99), rgba(7, 15, 11, 0.99));
}

.guidance-alert p {
  margin: 6px 0 0;
}

.compact-list,
.event-log,
.mission-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.compact-list li,
.event-log li,
.mission-list li {
  margin: 0 0 7px;
}

.compact-list strong,
.compact-list span {
  display: block;
}

.compact-list span {
  font-size: 11px;
}

.mission-list li.complete {
  color: var(--good);
}

.mission-list li.ready {
  color: var(--accent);
}

.mission-list strong,
.mission-list span {
  display: block;
}

.mission-list span {
  font-size: 11px;
}

.mission-list .campaign-objective-intro,
.mission-list .campaign-assignment-intro {
  margin: 10px 0 9px -18px;
  padding: 11px 12px;
  list-style: none;
  background: rgba(231, 183, 100, 0.07);
  border: 1px solid rgba(231, 183, 100, 0.28);
  border-radius: 5px 2px 5px 2px;
}

.mission-list .campaign-objective-intro > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-list .campaign-objective-intro > strong,
.mission-list .campaign-assignment-intro > strong {
  margin-top: 3px;
  color: #f2dfae;
  font-family: "Cinzel", Georgia, serif;
}

.mission-list .campaign-objective-intro > em {
  display: block;
  margin-top: 5px;
  color: #c9c1ad;
  font-size: 10px;
  font-style: normal;
  line-height: 1.45;
}

.mission-list .campaign-objective-intro.complete {
  background: rgba(101, 184, 117, 0.09);
  border-color: rgba(101, 184, 117, 0.42);
}

.mission-list .campaign-objective-intro.failed {
  background: rgba(216, 111, 92, 0.1);
  border-color: rgba(216, 111, 92, 0.5);
}

.mission-list .campaign-objective-intro.failed > span,
.mission-list .campaign-objective-intro.failed > strong {
  color: var(--danger);
}

.mission-list .campaign-objective-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  margin: 0 0 7px -18px;
  padding: 9px 10px;
  list-style: none;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(231, 183, 100, 0.42);
}

.mission-list .campaign-objective-item > i {
  display: grid;
  width: 20px;
  height: 20px;
  color: var(--accent);
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.mission-list .campaign-objective-item > div {
  min-width: 0;
}

.mission-list .campaign-objective-item strong {
  color: #e7ddc5;
}

.mission-list .campaign-objective-item span {
  margin-top: 2px;
  line-height: 1.4;
}

.mission-list .campaign-objective-item em {
  display: block;
  margin-top: 4px;
  color: #e7b764;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.mission-list .campaign-objective-item.complete {
  color: var(--good);
  background: rgba(101, 184, 117, 0.065);
  border-left-color: var(--good);
}

.mission-list .campaign-objective-item.complete strong,
.mission-list .campaign-objective-item.complete em {
  color: var(--good);
}

.mission-list .campaign-building-targets {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.mission-list .campaign-building-targets > div {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  color: #c9c1ad;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.mission-list .campaign-building-targets > div.complete {
  border-color: rgba(101, 184, 117, 0.28);
}

.mission-list .campaign-building-targets span,
.mission-list .campaign-building-targets b,
.mission-list .campaign-building-targets small {
  display: block;
}

.mission-list .campaign-building-targets b {
  color: inherit;
  font-size: 10px;
}

.mission-list .campaign-building-targets small {
  margin-top: 1px;
  color: #9f9889;
  font-size: 8px;
}

.mission-list .campaign-building-targets > div.complete small {
  color: var(--good);
}

.mission-list .campaign-building-targets button {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #f2dfae;
  background: rgba(231, 183, 100, 0.1);
  border: 1px solid rgba(231, 183, 100, 0.45);
  border-radius: 3px;
  font: 800 8px/1 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  cursor: pointer;
}

.mission-list .campaign-objective-phase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 6px -18px;
  padding: 6px 9px;
  list-style: none;
  color: #99917e;
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mission-list .campaign-objective-phase strong {
  color: inherit;
  font: 800 10px/1.2 "Cinzel", Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-list .campaign-objective-phase.active {
  color: var(--accent);
  border-color: rgba(231, 183, 100, 0.35);
}

.mission-list .campaign-objective-phase.complete {
  color: var(--good);
}

.mission-list .campaign-objective-item.locked {
  opacity: 0.52;
  border-left-color: rgba(255, 255, 255, 0.14);
}

.mission-list .campaign-objective-item.locked > i {
  color: #817b6f;
}

.mission-list .campaign-assignment-intro {
  margin-top: 13px;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.09);
}

.mission-list .campaign-assignment-intro > span {
  margin-top: 3px;
}

.inventory-list {
  display: grid;
  gap: 12px;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.55fr) minmax(190px, 0.6fr);
  gap: 9px;
  align-items: end;
  padding: 10px 12px;
  background:
    linear-gradient(90deg, rgba(228, 179, 99, 0.075), transparent 42%),
    rgba(11, 16, 15, 0.96);
  border: 1px solid rgba(204, 143, 49, 0.44);
  border-radius: 8px 3px 8px 3px;
}

.inventory-toolbar-summary,
.inventory-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-toolbar-summary > span,
.inventory-toolbar label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-toolbar-summary strong {
  overflow: hidden;
  color: #f1ddaa;
  font: 700 12px/1.25 "Cinzel", Georgia, serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-toolbar select {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 9px;
  color: var(--text);
  font: 700 10px/1 "Cinzel", Georgia, serif;
  background: rgba(7, 12, 11, 0.92);
  border: 1px solid rgba(205, 211, 201, 0.2);
  border-radius: 6px 2px 6px 2px;
}

.inventory-toolbar select:hover,
.inventory-toolbar select:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.inventory-group {
  display: grid;
  gap: 7px;
}

.inventory-group > header {
  display: flex;
  min-height: 28px;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 6px;
  border-bottom: 1px solid rgba(204, 143, 49, 0.36);
}

.inventory-group > header strong {
  color: #ead4a0;
  font: 800 13px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.inventory-group > header span {
  color: var(--muted);
  font-size: 9px;
}

.inventory-group-grid,
.inventory-sorted-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.inventory-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.inventory-item.good {
  border-left: 3px solid rgba(140, 205, 127, 0.74);
}

.inventory-item.danger {
  border-left: 3px solid rgba(216, 111, 92, 0.78);
}

.inventory-item.stocked {
  border-left: 3px solid rgba(228, 179, 99, 0.68);
}

.inventory-item.empty {
  opacity: 0.68;
}

.inventory-icon {
  display: grid;
  width: 26px;
  height: 26px;
  overflow: hidden;
  place-items: center;
  color: #f6f0df;
  font-size: 10px;
  font-weight: 800;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--resource-color) 18%, transparent), transparent 72%),
    rgba(8, 12, 11, 0.74);
  border: 1px solid color-mix(in srgb, var(--resource-color) 42%, rgba(186, 128, 42, 0.5));
  border-radius: 5px;
}

.inventory-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.72));
}

.inventory-item .inventory-icon {
  width: 36px;
  height: 36px;
}

.inventory-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inventory-copy strong,
.inventory-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-copy strong {
  font-size: 12px;
}

.inventory-item-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inventory-item-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-heading small {
  flex: 0 0 auto;
  color: #bba56f;
  font-size: 8px;
  text-transform: uppercase;
}

.inventory-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.inventory-bar {
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.inventory-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

@media (max-width: 760px) {
  .inventory-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-toolbar-summary {
    grid-column: 1 / -1;
  }

  .inventory-group-grid,
  .inventory-sorted-list {
    grid-template-columns: 1fr;
  }
}

.upgrade-list {
  display: grid;
  gap: 12px;
}

.upgrade-progress-overview {
  display: grid;
  gap: 8px;
}

.upgrade-next-action {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 0 0, rgba(228, 179, 99, 0.15), transparent 130px),
    rgba(228, 179, 99, 0.055);
  border: 1px solid rgba(228, 179, 99, 0.46);
  border-left-width: 4px;
  border-radius: 8px 3px 8px 3px;
}

.upgrade-next-action > span,
.upgrade-subject > span,
.upgrade-knowledge-step span,
.upgrade-section-heading span,
.upgrade-collection summary span {
  color: #b8bbae;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.upgrade-next-action > strong {
  color: #f3dfae;
  font: 800 17px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.upgrade-next-action p {
  grid-column: 1;
  margin: 2px 0 0;
  color: #ced1c7;
  font-size: 10px;
  line-height: 1.4;
}

.upgrade-next-action > b {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  padding: 6px 9px;
  color: #251a0d;
  background: #e5b458;
  border-radius: 5px 2px 5px 2px;
  font-size: 11px;
  white-space: nowrap;
}

.upgrade-subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.upgrade-subject {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 72px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(205, 211, 201, 0.17);
  border-top: 3px solid #6d746d;
  border-radius: 7px 2px 7px 2px;
}

.upgrade-subject.good { border-top-color: #79b774; }
.upgrade-subject.warning { border-top-color: #d2a24e; }

.upgrade-subject strong {
  overflow: hidden;
  color: #f1e6c9;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-subject small {
  color: #aeb3a8;
  font-size: 9px;
  line-height: 1.35;
}

.upgrade-knowledge-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(205, 211, 201, 0.13);
  border-radius: 5px 2px 5px 2px;
}

.upgrade-knowledge-step strong {
  min-width: 0;
  overflow: hidden;
  color: #dadccf;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-knowledge-step em {
  color: #d5b66f;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.upgrade-section,
.upgrade-collection {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(205, 211, 201, 0.13);
  border-radius: 8px 3px 8px 3px;
}

.upgrade-section.available {
  border-color: rgba(121, 183, 116, 0.3);
}

.upgrade-section-heading,
.upgrade-collection summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 24px;
}

.upgrade-section-heading > strong,
.upgrade-collection summary > strong {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  color: #2a1e0e;
  background: #d8aa55;
  border-radius: 50%;
  font-size: 9px;
}

.upgrade-section-heading small,
.upgrade-collection summary small {
  color: #959c91;
  font-size: 9px;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.upgrade-empty {
  margin: 0;
  padding: 9px 10px;
  color: #9ba196;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 5px;
}

.upgrade-collection summary {
  cursor: pointer;
  list-style: none;
}

.upgrade-collection summary::-webkit-details-marker { display: none; }

.upgrade-collection summary::after {
  content: "+";
  grid-column: 4;
  color: #e2b55d;
  font: 700 18px/1 Georgia, serif;
}

.upgrade-collection[open] summary::after { content: "−"; }

.upgrade-collection:not([open]) .upgrade-grid { display: none; }

.upgrade-collection[open] .upgrade-grid {
  margin-top: 2px;
}

.upgrade-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  gap: 5px 8px;
  width: 100%;
  min-height: 126px;
  padding: 10px;
  color: var(--text);
  text-align: left;
  background:
    radial-gradient(circle at 0 0, rgba(228, 179, 99, 0.07), transparent 100px),
    var(--panel-2);
  border: 1px solid rgba(205, 211, 201, 0.17);
  border-left: 3px solid #6c746d;
  border-radius: 7px 2px 7px 2px;
  cursor: pointer;
}

.upgrade-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(228, 179, 99, 0.14);
}

.upgrade-button.available {
  border-color: rgba(140, 205, 127, 0.72);
  border-left-color: #8ccd7f;
  box-shadow: inset 0 0 0 1px rgba(140, 205, 127, 0.16);
}

.upgrade-button.available .upgrade-status {
  color: #9edb91;
  font-weight: 700;
}

.upgrade-button.needs-points .upgrade-status {
  color: #dfbd75;
}

.upgrade-button.needs-points { border-left-color: #c49a4e; }

.upgrade-button.knowledge-locked .upgrade-status {
  color: #b28e87;
}

.upgrade-button.knowledge-locked { border-left-color: #8b6b66; }

.upgrade-button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.upgrade-button.purchased {
  border-color: rgba(140, 205, 127, 0.5);
  border-left-color: #719b6a;
  opacity: 0.76;
}

.upgrade-button strong,
.upgrade-button em,
.upgrade-button small {
  display: block;
}

.upgrade-button em,
.upgrade-button small {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

.upgrade-button small {
  grid-column: 1 / -1;
}

.upgrade-title strong {
  color: #f0e4c4;
  font: 800 13px/1.2 "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.upgrade-title em {
  margin-top: 3px;
  font-size: 8px;
  text-transform: uppercase;
}

.upgrade-button .upgrade-status {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.upgrade-description {
  min-height: 28px;
  line-height: 1.4;
}

.upgrade-requirement {
  color: #d1ae6b !important;
  line-height: 1.3;
}

.upgrade-system-chips {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 3px;
}

.upgrade-system-chips b {
  padding: 2px 5px;
  color: #9dc795;
  background: rgba(140, 205, 127, 0.07);
  border: 1px solid rgba(140, 205, 127, 0.2);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.upgrade-cost {
  color: var(--accent);
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .upgrade-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upgrade-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .upgrade-next-action { grid-template-columns: 1fr; }
  .upgrade-next-action > b { grid-column: 1; grid-row: auto; justify-self: start; }
  .upgrade-subject-grid { grid-template-columns: 1fr; }
  .upgrade-knowledge-step { grid-template-columns: 1fr; gap: 3px; }
}

.event-log {
  max-height: 360px;
  overflow: auto;
}

.intel-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 18px;
}

.intel-modal-card {
  width: min(1120px, calc(100vw - 36px));
  max-height: min(880px, calc(100vh - 36px));
}

.intel-section-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 6px;
  margin: 12px 0;
  overflow-x: auto;
}

.intel-section-tabs button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.intel-section-tabs button:hover,
.intel-section-tabs button.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(228, 179, 99, 0.14);
}

.intel-modal-body {
  min-height: 160px;
}

.intel-section-panel {
  display: block;
}

.production-overview {
  display: grid;
  gap: 12px;
}

.production-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.flow-summary {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow-summary span,
.flow-summary strong,
.flow-summary small { display: block; }
.flow-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.flow-summary strong { margin-top: 3px; font-size: 12px; }
.flow-summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.flow-summary.danger { border-color: rgba(216, 111, 92, 0.38); background: rgba(216, 111, 92, 0.075); }
.flow-summary.danger strong,
.flow-summary.danger small { color: var(--danger); }
.flow-summary.good { border-color: rgba(140, 205, 127, 0.34); background: rgba(140, 205, 127, 0.065); }
.flow-summary.good strong,
.flow-summary.good small { color: var(--good); }

.production-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 10px;
}

.production-table-header,
.production-row {
  display: grid;
  grid-template-columns: 38px minmax(150px, 1.35fr) minmax(92px, 0.72fr) minmax(145px, 1fr) minmax(82px, 0.6fr) minmax(150px, 1.08fr);
  gap: 10px;
  align-items: center;
}

.production-table-header {
  padding: 0 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.production-table-header span:first-child { grid-column: 1 / 3; }

.production-list {
  display: grid;
  gap: 6px;
}

.production-row {
  min-width: 0;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(205, 211, 201, 0.15);
  border-left: 4px solid var(--text);
  border-radius: 8px;
}

.production-row > span { min-width: 0; }
.production-row small,
.production-row strong,
.production-row em { display: block; overflow-wrap: anywhere; }
.production-row small,
.production-row em { color: var(--muted); font-size: 9px; font-style: normal; }
.production-row strong { margin-top: 2px; font-size: 11px; }
.production-row em { margin-top: 2px; line-height: 1.25; }
.production-resource strong { margin-top: 0; font-size: 12px; }
.production-resource small { margin-top: 3px; }
.production-row.danger { border-left-color: var(--danger); background: rgba(216, 111, 92, 0.06); }
.production-row.danger > span:not(.production-resource) > strong { color: var(--danger); }
.production-row.good { border-left-color: var(--good); background: rgba(140, 205, 127, 0.05); }
.production-row.good > span:not(.production-resource) > strong { color: var(--good); }

@media (max-width: 820px) {
  .production-summary { grid-template-columns: 1fr; }
  .production-table-header { display: none; }
  .production-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
  }
  .production-resource { grid-column: 2 / -1; }
  .production-trend { grid-column: 2 / -1; }
}

@media (max-width: 1180px) {
  .play-area {
    grid-template-columns: 260px 1fr;
  }

  .intel-panel {
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
    align-items: start;
  }

  .intel-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .brand-block {
    flex-basis: 250px;
  }
}

/* Resident well-being and external trade intelligence. */
.intel-action-button.locked,
.intel-action-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.28);
}

.intel-action-button.locked:hover,
.intel-action-button:disabled:hover {
  border-color: rgba(104, 75, 35, 0.88);
  background: linear-gradient(180deg, rgba(24, 31, 30, 0.94), rgba(8, 11, 11, 0.96));
}

.intel-section-tabs {
  grid-template-columns: repeat(9, minmax(92px, 1fr));
}

.intel-section-tabs button[hidden] {
  display: none;
}

.wellbeing-overview,
.trading-overview {
  display: grid;
  gap: 12px;
}

.intel-empty-state {
  display: grid;
  min-height: 260px;
  padding: 36px;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  border: 1px solid rgba(204, 143, 49, 0.38);
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.28);
}

.intel-empty-state strong {
  color: var(--text);
  font-family: "Cinzel", Georgia, serif;
  font-size: 18px;
}

.intel-empty-state span {
  max-width: 520px;
  font-size: 12px;
  line-height: 1.55;
}

.trade-locked-state img {
  width: 64px;
  height: 64px;
  margin: 0 auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.62));
}

.wellbeing-summary {
  display: grid;
  grid-template-columns: 1.05fr repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(204, 143, 49, 0.56);
  background: rgba(7, 11, 10, 0.58);
}

.wellbeing-score-block,
.wellbeing-summary-stat {
  display: grid;
  min-width: 0;
  min-height: 78px;
  padding: 11px 14px;
  align-content: center;
  gap: 2px;
  border-right: 1px solid rgba(204, 143, 49, 0.28);
}

.wellbeing-summary > :last-child {
  border-right: 0;
}

.wellbeing-score-block {
  grid-template-columns: auto 1fr;
  background: rgba(228, 179, 99, 0.08);
}

.wellbeing-score-block > span,
.wellbeing-score-block > em {
  grid-column: 2;
}

.wellbeing-score-block > strong {
  grid-row: 1 / span 2;
  align-self: center;
  margin-right: 12px;
  color: #f3d58b;
  font-family: "Cinzel", Georgia, serif;
  font-size: 38px;
  line-height: 1;
}

.wellbeing-score-block > span,
.wellbeing-summary-stat > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.wellbeing-summary-stat > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wellbeing-score-block > em,
.wellbeing-summary-stat > em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.wellbeing-summary-stat.danger { box-shadow: inset 0 -3px rgba(216, 111, 92, 0.72); }
.wellbeing-summary-stat.warning { box-shadow: inset 0 -3px rgba(228, 179, 99, 0.72); }
.wellbeing-summary-stat.good { box-shadow: inset 0 -3px rgba(140, 205, 127, 0.66); }

.trend {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.trend.up { color: var(--good); }
.trend.down { color: var(--danger); }

.wellbeing-explainer,
.trade-rule,
.trade-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  border-left: 3px solid var(--accent);
  background: rgba(228, 179, 99, 0.055);
}

.wellbeing-explainer strong,
.trade-rule strong {
  color: var(--accent);
  text-transform: uppercase;
}

.wellbeing-pillar-list {
  display: grid;
  gap: 7px;
}

.wellbeing-pillar {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(190px, 0.48fr);
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--pillar-color) 48%, rgba(104, 75, 35, 0.76));
  border-left: 4px solid var(--pillar-color);
  background: rgba(12, 17, 16, 0.8);
}

.wellbeing-pillar.danger { background: color-mix(in srgb, rgba(12, 17, 16, 0.88) 90%, #7f3029); }
.wellbeing-pillar.warning { background: color-mix(in srgb, rgba(12, 17, 16, 0.88) 94%, #9f7334); }

.pillar-score {
  display: grid;
  padding: 12px 8px;
  place-content: center;
  text-align: center;
  border-right: 1px solid rgba(205, 211, 201, 0.12);
}

.pillar-score strong {
  color: var(--pillar-color);
  font-family: "Cinzel", Georgia, serif;
  font-size: 24px;
  line-height: 1;
}

.pillar-score span {
  color: var(--muted);
  font-size: 8px;
}

.pillar-main,
.pillar-diagnosis {
  display: grid;
  min-width: 0;
  padding: 9px 11px;
  align-content: start;
}

.pillar-heading {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.pillar-heading > div {
  display: grid;
  min-width: 0;
}

.pillar-heading strong {
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
}

.pillar-heading span,
.pillar-heading em,
.pillar-main p,
.pillar-diagnosis span,
.pillar-diagnosis em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.pillar-meter {
  height: 4px;
  margin: 6px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pillar-meter i {
  display: block;
  height: 100%;
  background: var(--pillar-color);
}

.pillar-main p {
  margin: 0 0 7px;
  line-height: 1.35;
}

.pillar-components {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 9px;
}

.pillar-components > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 2px 5px;
  align-items: center;
}

.pillar-components b,
.pillar-components strong {
  color: var(--muted);
  font-size: 8px;
}

.pillar-components strong { text-align: right; }
.pillar-components i {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.pillar-components u {
  display: block;
  height: 100%;
  background: var(--pillar-color);
  text-decoration: none;
}

.pillar-diagnosis {
  gap: 4px;
  align-content: center;
  border-left: 1px solid rgba(205, 211, 201, 0.12);
}

.pillar-diagnosis strong {
  color: var(--text);
  font-size: 10px;
  line-height: 1.3;
}

.pillar-diagnosis em {
  color: color-mix(in srgb, var(--pillar-color) 72%, var(--muted));
}

.trade-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(204, 143, 49, 0.56);
  background: rgba(7, 11, 10, 0.64);
}

.trade-summary > div {
  display: grid;
  min-width: 0;
  min-height: 66px;
  padding: 9px 11px;
  align-content: center;
  gap: 2px;
  border-right: 1px solid rgba(204, 143, 49, 0.24);
}

.trade-summary > div:last-child { border-right: 0; }
.trade-summary span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.trade-summary strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.trade-summary em { overflow: hidden; color: var(--muted); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.trade-summary .good { box-shadow: inset 0 -3px rgba(140, 205, 127, 0.62); }
.trade-summary .danger { box-shadow: inset 0 -3px rgba(216, 111, 92, 0.68); }
.trade-summary .warning { box-shadow: inset 0 -3px rgba(228, 179, 99, 0.68); }

.trade-notice {
  display: block;
  color: #ead49b;
}

.trade-group,
.trade-history {
  display: grid;
  gap: 5px;
}

.trade-group-heading {
  display: flex;
  min-height: 24px;
  padding: 0 5px 4px;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(204, 143, 49, 0.42);
}

.trade-group-heading strong {
  color: #ecd698;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  text-transform: uppercase;
}

.trade-group-heading span {
  color: var(--muted);
  font-size: 8px;
}

.trade-table-header,
.trade-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 1.3fr) minmax(102px, 0.72fr) 116px 76px 124px;
  gap: 7px;
  align-items: center;
}

.trade-table-header {
  min-height: 18px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.trade-table-header span:first-child { grid-column: 1 / 3; }

.trade-rows {
  display: grid;
  gap: 4px;
}

.trade-row {
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid rgba(205, 211, 201, 0.13);
  border-left: 3px solid color-mix(in srgb, var(--resource-color) 60%, #8c672c);
  background: rgba(255, 255, 255, 0.025);
}

.trade-row.route-import { background: rgba(94, 145, 174, 0.075); }
.trade-row.route-export { background: rgba(140, 176, 100, 0.075); }

.trade-row .inventory-icon {
  width: 30px;
  height: 30px;
  color: color-mix(in srgb, var(--resource-color) 82%, white);
  background: color-mix(in srgb, var(--resource-color) 16%, rgba(12, 16, 15, 0.96));
  border-color: color-mix(in srgb, var(--resource-color) 44%, rgba(104, 75, 35, 0.72));
  font-size: 8px;
}

.trade-good,
.trade-prices {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.trade-good strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-good em,
.trade-prices em {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-good > i {
  height: 3px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
}

.trade-good > i u {
  display: block;
  height: 100%;
  background: var(--resource-color);
  text-decoration: none;
}

.trade-prices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-prices b { color: var(--muted); font-size: 8px; }
.trade-prices em { grid-column: 1 / -1; }
.trade-prices.high em { color: #e1b36c; }
.trade-prices.low em { color: #83abb8; }

.trade-mode,
.trade-manual {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.trade-manual { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.trade-mode button,
.trade-manual button {
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  color: var(--muted);
  background: rgba(7, 11, 10, 0.86);
  border: 1px solid rgba(104, 75, 35, 0.8);
  border-radius: 3px;
  font-size: 8px;
  cursor: pointer;
}

.trade-mode button:hover,
.trade-manual button:hover,
.trade-mode button.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(228, 179, 99, 0.14);
}

.trade-mode button:disabled,
.trade-manual button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.trade-target {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
}

.trade-target input {
  width: 100%;
  height: 28px;
  padding: 0 5px;
  color: var(--text);
  background: rgba(4, 7, 6, 0.8);
  border: 1px solid rgba(104, 75, 35, 0.8);
  border-radius: 3px;
  font: inherit;
}

.trade-target input:focus {
  border-color: var(--accent);
  outline: none;
}

.trade-history-row {
  display: grid;
  grid-template-columns: 24px minmax(130px, 1fr) minmax(130px, 1fr) 150px 92px;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
  align-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border-left: 3px solid var(--line);
  font-size: 8px;
}

.trade-history-row.import { border-left-color: #6f9eb8; }
.trade-history-row.export { border-left-color: #86ad6a; }
.trade-history-row.barter { border-left-color: #c9a852; }
.trade-history-row > span { color: var(--accent); font-size: 15px; text-align: center; }
.trade-history-row strong { color: var(--text); font-size: 9px; }
.trade-history-row em { font-style: normal; }
.trade-history-row b,
.trade-history-row u { text-align: right; text-decoration: none; }
.trade-history-row.import u { color: var(--danger); }
.trade-history-row.export u { color: var(--good); }
.trade-history-empty { padding: 18px; color: var(--muted); text-align: center; font-size: 9px; }

@media (max-width: 980px) {
  .wellbeing-summary,
  .trade-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wellbeing-summary > *,
  .trade-summary > div { border-bottom: 1px solid rgba(204, 143, 49, 0.24); }
  .wellbeing-pillar { grid-template-columns: 62px minmax(0, 1fr); }
  .pillar-diagnosis { grid-column: 2; border-left: 0; border-top: 1px solid rgba(205, 211, 201, 0.12); }
  .trade-table-header { display: none; }
  .trade-row { grid-template-columns: 34px minmax(150px, 1fr) 112px 116px; }
  .trade-prices { grid-column: 3; }
  .trade-mode { grid-column: 4; }
  .trade-target { grid-column: 3; }
  .trade-manual { grid-column: 4; }
}

@media (max-width: 680px) {
  .intel-section-tabs { grid-template-columns: repeat(9, minmax(96px, 1fr)); }
  .wellbeing-summary,
  .trade-summary { grid-template-columns: 1fr; }
  .wellbeing-pillar { grid-template-columns: 54px minmax(0, 1fr); }
  .pillar-components { grid-template-columns: 1fr; }
  .trade-row { grid-template-columns: 30px minmax(0, 1fr) 104px; }
  .trade-prices { grid-column: 3; }
  .trade-mode { grid-column: 2 / -1; }
  .trade-target { grid-column: 2; }
  .trade-manual { grid-column: 3; }
  .trade-history-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .trade-history-row em,
  .trade-history-row b { display: none; }
}

@media (max-width: 760px) {
  .shell {
    padding: 10px;
  }

  .topbar,
  .play-area,
  .intel-panel {
    grid-template-columns: 1fr;
  }

  .build-popup {
    position: fixed;
    inset: auto 10px 10px;
    width: auto;
    max-height: min(70vh, 620px);
  }

  .intel-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-block {
    flex: 0 0 auto;
  }

  #gameCanvas {
    min-height: 480px;
  }
}

/* Full-screen game HUD pass: map is the stage, panels are overlays. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shell {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #060807;
}

.play-area {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  overflow: hidden;
}

.map-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  min-height: 0;
  background: #142016;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-wrap::after {
  inset: 0;
  z-index: 3;
  border: 0;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.34) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.22));
  box-shadow: inset 0 0 130px rgba(0, 0, 0, 0.52);
}

#gameCanvas {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.topbar {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: 230px minmax(300px, 380px) 220px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: 80px;
  height: 80px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.topbar::before,
.topbar::after {
  display: none;
}

.city-plate,
.stats {
  position: relative;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(18, 22, 20, 0.96), rgba(4, 7, 7, 0.96));
  border: 2px solid rgba(113, 78, 33, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(237, 181, 83, 0.2),
    inset 0 12px 20px rgba(255, 210, 105, 0.03),
    0 16px 34px rgba(0, 0, 0, 0.5);
}

.city-plate::before,
.stats::before,
.panel::before,
.command-dock::before,
.overlay-bar::before {
  position: absolute;
  inset: 5px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(230, 174, 82, 0.26);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.38);
}

.city-plate {
  display: grid;
  align-content: center;
  gap: 8px;
  height: 80px;
  padding: 12px 14px;
}

.city-plate strong {
  color: #f4dfae;
  font-family: "Cinzel", Georgia, serif;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.66);
}

.date-badge {
  width: fit-content;
  min-height: 22px;
  margin: 0;
  padding: 4px 9px;
  font-size: 11px;
  border-color: rgba(230, 174, 82, 0.58);
}

.stats {
  align-self: stretch;
  gap: 0;
  height: 80px;
  padding: 8px 7px;
  overflow: visible;
  border-left-width: 0;
}

.stats-left {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-right: 17px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
}

.stats-right {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  padding-left: 17px;
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
}

.topbar-brand {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  height: 100px;
  margin: -10px -10px -10px;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(231, 183, 100, 0.16), transparent 62%);
  pointer-events: none;
}

.topbar-logo {
  width: 232px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 13px 16px rgba(0, 0, 0, 0.82));
}

.stat {
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: minmax(28px, auto) 5px;
  column-gap: 4px;
  min-height: 58px;
  padding: 6px 5px 5px;
  border-color: rgba(117, 84, 38, 0.82);
}

.stat-icon {
  flex-basis: 25px;
  width: 25px;
  height: 25px;
}

.stat strong {
  font-size: 16px;
}

.stat em {
  display: block;
  grid-column: 2;
  min-height: 10px;
  margin-top: -8px;
  color: color-mix(in srgb, var(--stat-color) 78%, #f4dfae);
  font-size: 8px;
  font-weight: 800;
}

.panel {
  position: absolute;
  z-index: 20;
  border-color: rgba(113, 78, 33, 0.96);
  background:
    linear-gradient(180deg, rgba(18, 22, 20, 0.94), rgba(4, 7, 7, 0.94));
  backdrop-filter: blur(9px);
}

.tools-panel {
  top: 108px;
  left: 14px;
  width: 240px;
  max-height: calc(100vh - 188px);
  overflow: visible;
}

.panel-header {
  grid-template-columns: 1fr auto;
}

.panel-header h2 {
  text-align: left;
}

.category-tabs {
  gap: 5px;
}

.category-button {
  min-height: 39px;
  padding: 4px 8px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.category-icon {
  width: 28px;
  height: 28px;
}

.selected-tool-summary {
  min-height: 82px;
  margin-top: 10px;
}

.build-popup {
  top: 0;
  left: calc(100% + 12px);
  width: clamp(330px, 28vw, 390px);
  max-height: min(520px, calc(100vh - 130px));
  border-color: rgba(230, 174, 82, 0.42);
  border-radius: 4px;
}

.tool-button {
  min-height: 88px;
}

.map-hud {
  top: 128px;
  right: 300px;
  z-index: 22;
}

.overlay-bar {
  position: relative;
  border-radius: 4px;
}

.intel-panel {
  top: 108px;
  right: 14px;
  width: 276px;
  max-height: calc(100vh - 188px);
  overflow: visible;
}

.guidance-card {
  max-height: 220px;
  overflow: auto;
}

.intel-actions {
  gap: 0;
  border: 2px solid rgba(113, 78, 33, 0.82);
}

.intel-action-button {
  min-height: 52px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.intel-action-button:last-child {
  border-bottom-width: 0;
}

.command-dock {
  bottom: 12px;
  z-index: 26;
  min-height: 52px;
  border-color: rgba(113, 78, 33, 0.92);
}

.selection-modal,
.confirm-modal,
.intel-modal {
  z-index: 50;
}

/* Main menu and versioned save-game UI. */
.attract-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background-color: #0a0c0c;
  background-image: url("./assets/ui/sovereign-streets-attract.png");
  background-position: center;
  background-size: cover;
}

.attract-screen::before,
.attract-screen::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.attract-screen::before {
  background:
    linear-gradient(180deg, rgba(1, 3, 3, 0.08), transparent 42%, rgba(1, 3, 3, 0.18)),
    radial-gradient(ellipse at center, transparent 46%, rgba(2, 4, 4, 0.42) 100%);
}

.attract-screen::after {
  inset: 7px;
  border: 1px solid rgba(231, 183, 100, 0.42);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.62);
}

.attract-menu {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 2.6vh, 30px);
  right: 50%;
  width: min(1060px, calc(100vw - 40px));
  transform: translateX(50%);
}

.attract-version {
  position: absolute;
  right: 18px;
  bottom: 13px;
  z-index: 2;
  padding: 4px 8px;
  color: rgba(255, 232, 178, 0.58);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  background: rgba(4, 7, 7, 0.45);
  border: 1px solid rgba(231, 183, 100, 0.22);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.attract-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(7px, 1vw, 14px);
  padding: 8px;
  background: rgba(5, 8, 8, 0.78);
  border: 1px solid rgba(231, 183, 100, 0.7);
  border-radius: 14px 4px 14px 4px;
  box-shadow:
    0 0 0 3px rgba(55, 36, 15, 0.72),
    inset 0 0 0 1px rgba(255, 231, 170, 0.1),
    0 22px 54px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(9px) saturate(0.86);
}

.attract-actions button {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: 4px;
  padding: 10px 14px;
  color: #fff4d6;
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 0, rgba(245, 194, 94, 0.18), transparent 58%),
    linear-gradient(180deg, rgba(44, 41, 31, 0.98), rgba(12, 16, 15, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.72);
  border-radius: 9px 2px 9px 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 179, 0.08);
}

.attract-actions button:hover,
.attract-actions button:focus-visible {
  color: #fff8e7;
  background: linear-gradient(180deg, rgba(100, 72, 34, 0.96), rgba(29, 28, 23, 0.98));
  border-color: #f0c36e;
  transform: translateY(-1px);
}

.attract-actions button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.58;
  transform: none;
}

.attract-actions strong {
  font-family: "Cinzel Decorative", "Cinzel", Georgia, serif;
  font-size: clamp(13px, 1.15vw, 17px);
  text-transform: uppercase;
}

.attract-actions span,
.attract-status {
  color: #c9c2af;
  font-size: 10px;
  font-weight: 650;
}

.attract-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #ffe2a2;
  text-align: center;
  text-shadow: 0 2px 5px #000;
}

.attract-audio-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 4px auto 0;
  padding: 7px 14px;
  color: #fff1c8;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(8, 12, 11, 0.84);
  border: 1px solid rgba(231, 183, 100, 0.72);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 235, 179, 0.07);
}

.attract-audio-start:hover,
.attract-audio-start:focus-visible {
  color: #fff8e7;
  background: rgba(75, 54, 27, 0.94);
  border-color: #f0c36e;
}

.attract-audio-start > span[aria-hidden] {
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.game-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  padding: 18px;
}

.save-modal-card {
  width: min(760px, 100%);
  max-height: min(880px, calc(100vh - 36px));
  padding: 18px;
}

.save-slot-section {
  margin-top: 16px;
}

.save-slot-section h3 {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-slot-list {
  display: grid;
  gap: 6px;
}

.save-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px 2px 8px 2px;
}

.save-slot.empty {
  opacity: 0.68;
}

.save-slot-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.save-slot-copy strong {
  color: var(--text);
  font-size: 12px;
}

.save-slot-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-slot-actions {
  display: flex;
  gap: 6px;
}

.save-slot-actions button,
.save-modal-footer button {
  min-width: 76px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px 2px 6px 2px;
  font-size: 10px;
  font-weight: 800;
}

.save-slot-actions .primary,
.save-modal-footer .primary {
  background: rgba(228, 179, 99, 0.14);
  border-color: rgba(228, 179, 99, 0.5);
}

.save-overwrite,
.save-message,
.save-loading {
  margin: 12px 0 0;
  padding: 10px;
  color: var(--muted);
  background: rgba(231, 183, 100, 0.08);
  border: 1px solid rgba(231, 183, 100, 0.28);
  border-radius: 7px;
  font-size: 11px;
}

.save-overwrite {
  display: grid;
  gap: 5px;
}

.manual-save-editor,
.save-delete-confirmation {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 13px;
  background:
    radial-gradient(circle at 0 0, rgba(231, 183, 100, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(231, 183, 100, 0.38);
  border-radius: 10px 3px 10px 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 174, 0.04);
}

.manual-save-editor > div:first-child,
.save-delete-confirmation {
  color: var(--muted);
}

.manual-save-editor span,
.save-delete-confirmation > span {
  display: block;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-save-editor strong,
.save-delete-confirmation > strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
}

.manual-save-editor label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.manual-save-editor input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--text);
  background: rgba(5, 8, 7, 0.86);
  border: 1px solid rgba(231, 183, 100, 0.42);
  border-radius: 7px 2px 7px 2px;
  outline: none;
}

.manual-save-editor input:focus {
  border-color: rgba(240, 195, 110, 0.9);
  box-shadow: 0 0 0 2px rgba(231, 183, 100, 0.14);
}

.manual-save-editor p,
.save-delete-confirmation p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.manual-save-editor .modal-actions,
.save-delete-confirmation .modal-actions {
  justify-content: flex-end;
}

.save-slot-actions .danger {
  color: #ffc9bd;
  border-color: rgba(216, 111, 92, 0.44);
  background: rgba(105, 42, 32, 0.16);
}

.save-overwrite strong,
.save-message {
  color: var(--text);
}

.save-message.error {
  color: #ffc4b9;
  border-color: rgba(216, 111, 92, 0.5);
}

.save-modal-footer {
  justify-content: flex-end;
  margin-top: 16px;
}

.save-empty-card {
  width: min(680px, 100%);
}

.save-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: clamp(28px, 6vw, 54px) 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(231, 183, 100, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(231, 183, 100, 0.24);
  border-radius: 12px 3px 12px 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 174, 0.025);
}

.save-empty-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(231, 183, 100, 0.44);
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 0 24px rgba(231, 183, 100, 0.1);
}

.save-empty-state > strong {
  color: var(--text);
  font-size: 18px;
}

.save-empty-state > p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.save-empty-state .save-modal-footer {
  margin-top: 8px;
}

.save-toast {
  position: fixed;
  top: 112px;
  left: 50%;
  z-index: 300;
  width: max-content;
  min-width: 150px;
  min-height: 0;
  padding: 9px 22px;
  color: #f7e4b5;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -5px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.save-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .attract-menu {
    top: 12px;
    width: calc(100vw - 24px);
  }

  .attract-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .attract-actions button {
    grid-column: span 2;
  }

  .attract-actions button:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .attract-actions button {
    min-height: 42px;
    padding: 6px 8px;
  }

  .attract-actions span {
    display: none;
  }

  .attract-status {
    margin-top: 4px;
    font-size: 8px;
  }

  .attract-version {
    right: 12px;
    bottom: 9px;
    font-size: 8px;
  }

  .attract-actions strong {
    font-size: clamp(10px, 3vw, 13px);
  }

  .save-slot { grid-template-columns: 1fr; }
  .save-slot-copy span { white-space: normal; }
  .save-slot-actions { justify-content: flex-end; }
}

body {
  font-family: "Cinzel", Georgia, serif;
}

button,
input,
select,
textarea {
  font-family: "Cinzel", Georgia, serif;
}

.topbar {
  display: block;
}

.city-plate {
  position: absolute;
  top: 0;
  left: 0;
  width: 230px;
}

.stats-left,
.stats-right,
.topbar-brand {
  position: absolute;
  top: 0;
}

.stats-left {
  left: 236px;
  right: calc(50% + 118px);
}

.topbar-brand {
  left: 50%;
  width: 236px;
  margin: -10px 0;
  transform: translateX(-50%);
}

.stats-right {
  left: calc(50% + 118px);
  right: 0;
}

.city-plate,
.stats,
.panel,
.build-popup,
.command-dock,
.overlay-bar,
.intel-actions,
.modal-card {
  border-color: rgba(226, 168, 68, 0.95);
  border-radius: 14px 4px 14px 4px;
  background:
    radial-gradient(circle at 0 0, rgba(243, 191, 84, 0.18), transparent 34px),
    radial-gradient(circle at 100% 0, rgba(243, 191, 84, 0.14), transparent 34px),
    radial-gradient(circle at 0 100%, rgba(243, 191, 84, 0.14), transparent 34px),
    radial-gradient(circle at 100% 100%, rgba(243, 191, 84, 0.18), transparent 34px),
    linear-gradient(180deg, rgba(18, 22, 20, 0.97), rgba(4, 7, 7, 0.97));
  box-shadow:
    0 0 0 1px rgba(255, 224, 145, 0.16),
    0 0 0 3px rgba(95, 59, 20, 0.76),
    inset 0 0 0 1px rgba(255, 226, 151, 0.22),
    inset 0 0 24px rgba(228, 158, 54, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.52);
}

.city-plate::before,
.stats::before,
.panel::before,
.command-dock::before,
.overlay-bar::before {
  inset: 6px;
  border-color: rgba(239, 184, 82, 0.44);
  border-radius: 10px 3px 10px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(92, 61, 28, 0.78),
    inset 0 0 20px rgba(0, 0, 0, 0.48);
}

.city-plate::after,
.panel::after,
.command-dock::after {
  position: absolute;
  inset: 3px;
  pointer-events: none;
  content: "";
  border-radius: 13px 4px 13px 4px;
  background:
    linear-gradient(90deg, #d99b3d 0 18px, transparent 18px calc(100% - 18px), #d99b3d calc(100% - 18px)) top left / 100% 2px no-repeat,
    linear-gradient(90deg, #d99b3d 0 18px, transparent 18px calc(100% - 18px), #d99b3d calc(100% - 18px)) bottom left / 100% 2px no-repeat,
    linear-gradient(180deg, #d99b3d 0 18px, transparent 18px calc(100% - 18px), #d99b3d calc(100% - 18px)) top left / 2px 100% no-repeat,
    linear-gradient(180deg, #d99b3d 0 18px, transparent 18px calc(100% - 18px), #d99b3d calc(100% - 18px)) top right / 2px 100% no-repeat;
  opacity: 0.82;
}

.stat,
.category-button,
.tool-button,
.selected-tool-summary,
.guidance-card,
.intel-action-button,
.speed-button,
.icon-button,
.overlay-button {
  border-color: rgba(204, 143, 49, 0.86);
  border-radius: 9px 3px 9px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 139, 0.12),
    0 0 0 1px rgba(74, 47, 18, 0.62);
}

.intel-actions {
  overflow: hidden;
}

.intel-action-button {
  border-radius: 0;
}

.intel-action-button:first-child {
  border-radius: 10px 3px 0 0;
}

.intel-action-button:last-child {
  border-radius: 0 0 10px 3px;
}

.panel-header h2,
.city-plate strong,
.intel-action-button span,
.category-button,
.tool-copy strong,
.selected-tool-summary strong,
.guidance-card strong,
.season-chip,
.date-badge {
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.topbar-logo {
  filter:
    drop-shadow(0 13px 18px rgba(0, 0, 0, 0.86))
    drop-shadow(0 0 8px rgba(226, 168, 68, 0.32));
}

/* Unified bottom command bar. */
.command-dock {
  position: absolute;
  right: auto;
  bottom: 12px;
  left: 50%;
  z-index: 26;
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(1620px, calc(100vw - 28px));
  min-height: 66px;
  padding: 9px 13px;
  overflow: visible;
  transform: translateX(-50%);
}

.command-dock::before,
.command-dock::after {
  z-index: 0;
}

.dock-group {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.dock-group + .dock-group::before {
  width: 1px;
  height: 38px;
  margin-right: 12px;
  flex: 0 0 auto;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(223, 164, 65, 0.78), transparent);
  box-shadow: 1px 0 rgba(255, 226, 151, 0.08);
}

.dock-file-controls,
.dock-time-controls {
  gap: 7px;
}

.dock-file-controls {
  z-index: 30;
}

.dock-overlay-controls {
  justify-content: center;
  gap: 7px;
}

.dock-time-controls {
  justify-content: flex-end;
}

.dock-label {
  color: #d8c99b;
  font-family: "Cinzel", Georgia, serif;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.dock-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0;
  flex: 0 0 42px;
  overflow: hidden;
  color: #f0d898;
  background:
    radial-gradient(circle at 50% 30%, rgba(231, 183, 100, 0.14), transparent 54%),
    linear-gradient(180deg, rgba(26, 31, 28, 0.98), rgba(6, 9, 8, 0.98));
  border: 1px solid rgba(204, 143, 49, 0.88);
  border-radius: 9px 3px 9px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 139, 0.1),
    0 0 0 1px rgba(74, 47, 18, 0.7);
  cursor: pointer;
}

.dock-icon-button:hover,
.dock-icon-button:focus-visible,
.dock-icon-button.active {
  border-color: #f1bd5b;
  background:
    radial-gradient(circle at 50% 40%, rgba(241, 189, 91, 0.25), transparent 60%),
    linear-gradient(180deg, rgba(52, 45, 31, 0.98), rgba(18, 17, 13, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 233, 177, 0.2),
    0 0 13px rgba(220, 157, 55, 0.22);
  outline: none;
}

.dock-icon-button img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7)) saturate(1.08) brightness(1.05);
}

.dock-file-controls .dock-icon-button img,
.pause-button img {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
}

.dock-campaign-button span {
  color: #f4cf79;
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.75));
}

.dock-undo-button span,
.dock-restart-button span {
  color: #f4cf79;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.75));
}

.dock-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.8);
}

.dock-icon-button:disabled:hover {
  border-color: rgba(204, 143, 49, 0.88);
  background:
    radial-gradient(circle at 50% 30%, rgba(231, 183, 100, 0.14), transparent 54%),
    linear-gradient(180deg, rgba(26, 31, 28, 0.98), rgba(6, 9, 8, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 139, 0.1),
    0 0 0 1px rgba(74, 47, 18, 0.7);
}

.audio-button span {
  color: #f4cf79;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.75));
}

.audio-button.muted span {
  color: #cf816a;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.audio-panel {
  position: fixed;
  bottom: 90px;
  left: max(14px, calc(50vw - 710px));
  z-index: 400;
  width: min(290px, calc(100vw - 28px));
  padding: 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(25, 29, 26, 0.98), rgba(7, 10, 9, 0.99));
  border: 1px solid rgba(231, 183, 100, 0.72);
  border-radius: 10px 4px 10px 4px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 225, 153, 0.08),
    0 20px 55px rgba(0, 0, 0, 0.66);
}

.audio-panel[hidden] {
  display: none;
}

.audio-panel header {
  display: grid;
  gap: 1px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(231, 183, 100, 0.22);
}

.audio-panel header span,
.audio-panel label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-panel header strong {
  color: #f1d899;
  font-family: "Cinzel", Georgia, serif;
  font-size: 16px;
}

.audio-panel label {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.audio-panel label > span {
  display: flex;
  justify-content: space-between;
}

.audio-panel output {
  color: #ebc876;
  font-variant-numeric: tabular-nums;
}

.audio-panel input[type="range"] {
  width: 100%;
  accent-color: #d9a64d;
  cursor: pointer;
}

.audio-mute-button {
  width: 100%;
  min-height: 34px;
  margin-top: 13px;
  color: #f0d898;
  background: rgba(231, 183, 100, 0.08);
  border: 1px solid rgba(231, 183, 100, 0.48);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.audio-mute-button:hover,
.audio-mute-button.active {
  color: #fff0d0;
  background: rgba(176, 72, 48, 0.2);
  border-color: rgba(216, 111, 92, 0.74);
}

.audio-panel small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

@media (max-width: 620px) {
  .audio-panel {
    bottom: 72px;
    left: 7px;
  }
}

.labels-button {
  width: 38px;
  flex-basis: 38px;
}

.labels-button span {
  color: #f0d898;
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 900;
}

.guidance-alert.actionable {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
}

.guidance-alert.actionable:focus-within {
  border-color: rgba(244, 202, 117, 0.96);
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 183, 100, 0.2), transparent 46%),
    linear-gradient(180deg, rgba(32, 36, 31, 0.98), rgba(9, 12, 11, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 235, 180, 0.16), 0 0 16px rgba(231, 183, 100, 0.18);
  outline: none;
}

.guidance-alert-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.guidance-alert-meta > span {
  min-width: 0;
  overflow: hidden;
  color: #aaa997;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.guidance-carousel-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 2px;
  background: rgba(7, 10, 9, 0.64);
  border: 1px solid rgba(231, 183, 100, 0.34);
  border-radius: 5px 2px 5px 2px;
}

.guidance-carousel-nav span {
  min-width: 28px;
  color: #e6cd92;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.guidance-card .guidance-carousel-nav button {
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  place-items: center;
  color: #f2bd5f;
  background: transparent;
  border: 0;
  border-radius: 3px 1px 3px 1px;
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.guidance-card .guidance-carousel-nav button:hover,
.guidance-card .guidance-carousel-nav button:focus-visible {
  color: #fff0bd;
  background: rgba(231, 183, 100, 0.16);
  outline: none;
}

.guidance-alert > strong {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.28;
}

.guidance-alert > p {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.42;
}

.guidance-alert .guidance-locate {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding-top: 8px;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  color: #f0d898;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(231, 183, 100, 0.26);
  font-size: 10px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.guidance-locate b {
  color: #f2bd5f;
  font-size: 16px;
  line-height: 1;
}

.guidance-locate i {
  margin-left: auto;
  color: #f2bd5f;
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}

.camera-follow-chip {
  position: absolute;
  bottom: 92px;
  left: 50%;
  z-index: 27;
  display: grid;
  grid-template-columns: auto auto 24px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px 6px 13px;
  color: #f5e7bd;
  background:
    radial-gradient(circle at 0% 50%, rgba(231, 183, 100, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(23, 28, 24, 0.97), rgba(7, 10, 9, 0.98));
  border: 2px solid rgba(167, 113, 43, 0.94);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 165, 0.18), 0 12px 28px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-family: "Cinzel", Georgia, serif;
  transform: translateX(-50%);
}

.camera-follow-chip[hidden] { display: none; }
.camera-follow-chip span { display: flex; align-items: center; gap: 5px; color: #c9b984; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.camera-follow-chip span b { color: #efbb5f; font-size: 16px; }
.camera-follow-chip strong { font-size: 12px; text-transform: uppercase; }
.camera-follow-chip i { color: #e7c474; font-size: 20px; font-style: normal; line-height: 1; }
.camera-follow-chip:hover,
.camera-follow-chip:focus-visible { border-color: #f0c66f; box-shadow: inset 0 0 0 1px rgba(255, 228, 165, 0.25), 0 0 18px rgba(231, 183, 100, 0.22); outline: none; }

.labels-button.off {
  opacity: 0.52;
  filter: grayscale(0.72);
}

.labels-button.off::after {
  position: absolute;
  width: 28px;
  height: 2px;
  content: "";
  background: #d86f5c;
  box-shadow: 0 0 4px rgba(216, 111, 92, 0.52);
  transform: rotate(-42deg);
}

.pause-button.active {
  border-color: rgba(117, 194, 76, 0.92);
  background:
    radial-gradient(circle at 50% 70%, rgba(117, 194, 76, 0.28), transparent 62%),
    linear-gradient(180deg, rgba(13, 25, 16, 0.98), rgba(37, 62, 32, 0.98));
  box-shadow: inset 0 4px 9px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(173, 234, 118, 0.2), 0 0 14px rgba(83, 181, 64, 0.28);
  transform: translateY(2px);
}

.pause-button.active::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  content: "";
  background: #8ccd7f;
  border: 1px solid rgba(222, 255, 205, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(140, 205, 127, 0.85);
}

.command-dock .overlay-bar {
  position: static;
  display: flex;
  gap: 5px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.command-dock .overlay-bar::before {
  display: none;
}

.command-dock .overlay-button {
  position: relative;
  width: 37px;
  height: 42px;
  overflow: hidden;
  color: #ded8c5;
  background: linear-gradient(180deg, rgba(27, 32, 29, 0.98), rgba(6, 9, 8, 0.98));
  border-color: rgba(137, 96, 39, 0.88);
}

.command-dock .overlay-button:hover,
.command-dock .overlay-button:focus-visible,
.command-dock .overlay-button.active {
  color: #fff4d4;
  border-color: var(--overlay-color);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--overlay-color) 28%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(44, 43, 34, 0.98), rgba(10, 12, 10, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 236, 183, 0.12), 0 0 10px color-mix(in srgb, var(--overlay-color) 24%, transparent);
  outline: none;
}

.overlay-glyph {
  font-family: "Cinzel", Georgia, serif;
  font-size: 15px;
  font-weight: 900;
}

.overlay-swatch {
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  height: 3px;
  background: var(--overlay-color);
  box-shadow: 0 0 5px color-mix(in srgb, var(--overlay-color) 48%, transparent);
  opacity: 0.55;
}

.overlay-button.active .overlay-swatch {
  height: 4px;
  opacity: 1;
}

.dock-overlay-controls .overlay-legend {
  position: absolute;
  bottom: calc(100% + 19px);
  left: 50%;
  width: min(320px, calc(100vw - 32px));
  max-width: none;
  padding: 10px 13px;
  color: #bdb9aa;
  background: linear-gradient(180deg, rgba(18, 22, 20, 0.97), rgba(5, 8, 7, 0.97));
  border: 1px solid rgba(218, 158, 59, 0.82);
  border-radius: 10px 3px 10px 3px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255, 224, 145, 0.1);
  transform: translateX(-50%);
}

.dock-overlay-controls .overlay-legend strong {
  color: #f2dca9;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.command-dock .season-chip {
  min-width: 128px;
  padding: 0 5px;
  font-size: 11px;
  white-space: nowrap;
}

.command-dock .speed-row {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 5px;
}

.command-dock .speed-button {
  width: 48px;
  min-height: 42px;
  height: 42px;
  padding: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.stop-modal-card {
  width: min(560px, calc(100vw - 28px));
}

.stop-modal-card > p {
  margin: 18px 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.game-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.game-menu-grid button,
.ui-scale-options button {
  min-height: 40px;
  color: #f4e4bd;
  background: linear-gradient(180deg, rgba(42, 48, 42, 0.98), rgba(16, 19, 18, 0.98));
  border: 1px solid rgba(231, 183, 100, 0.42);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 800;
}

.game-menu-grid button:hover,
.ui-scale-options button:hover,
.ui-scale-options button.active {
  color: #1b160d;
  background: linear-gradient(180deg, #f0c66f, #b97b2f);
  border-color: #ffe0a0;
}

.game-menu-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 13px;
  background: rgba(255, 241, 198, 0.045);
  border: 1px solid rgba(231, 183, 100, 0.18);
  border-radius: 5px;
}

.game-menu-setting strong {
  display: block;
  color: #f2dca9;
  font-family: "Cinzel", Georgia, serif;
}

.game-menu-setting span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ui-scale-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(68px, 1fr));
  gap: 6px;
}

.modal-actions .danger {
  color: #ffe0bf;
  border-color: rgba(210, 102, 65, 0.82);
  background: linear-gradient(180deg, rgba(93, 43, 29, 0.82), rgba(45, 23, 18, 0.92));
}

@media (max-width: 1080px) {
  .command-dock {
    grid-template-columns: auto minmax(250px, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .dock-label {
    display: none;
  }

  .dock-group + .dock-group::before {
    margin-right: 8px;
  }

  .command-dock .season-chip {
    min-width: 102px;
    font-size: 9px;
  }

  .command-dock .overlay-button {
    width: 34px;
  }

  .command-dock .speed-row {
    grid-template-columns: repeat(3, 43px);
  }

  .command-dock .speed-button {
    width: 43px;
  }
}

@media (max-width: 820px) {
  .command-dock {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 7px 9px;
  }

  .dock-icon-button {
    width: 36px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    flex-basis: 36px;
  }

  .labels-button {
    width: 34px;
    flex-basis: 34px;
  }

  .dock-icon-button img {
    width: 29px;
    height: 29px;
  }

  .dock-file-controls .dock-icon-button img,
  .pause-button img {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
  }

  .command-dock .overlay-bar {
    gap: 3px;
  }

  .command-dock .overlay-button {
    width: 29px;
    height: 38px;
  }

  .overlay-glyph {
    font-size: 12px;
  }

  .command-dock .season-chip {
    display: none;
  }

  .command-dock .speed-row {
    grid-template-columns: repeat(3, 36px);
    gap: 3px;
  }

  .command-dock .speed-button {
    width: 36px;
    height: 38px;
    min-height: 38px;
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .command-dock {
    bottom: 7px;
    gap: 5px;
    width: calc(100vw - 14px);
    padding-inline: 7px;
  }

  .dock-file-controls,
  .dock-time-controls {
    gap: 3px;
  }

  .dock-file-controls {
    max-width: 168px;
    overflow: hidden;
  }

  .dock-group + .dock-group::before {
    display: none;
  }

  .dock-icon-button {
    width: 31px;
    flex-basis: 31px;
  }

  .labels-button {
    width: 28px;
    flex-basis: 28px;
  }

  .command-dock .overlay-button {
    width: 26px;
  }

  .command-dock .speed-row {
    grid-template-columns: repeat(3, 31px);
  }

  .command-dock .speed-button {
    width: 31px;
    font-size: 10px;
  }
}

/* Screen-wide status bar and collapsible side rails. */
.topbar {
  top: 8px;
  right: 14px;
  left: 14px;
  width: auto;
  height: 80px;
  min-height: 80px;
}

.stats-left,
.stats-right,
.topbar-brand {
  position: absolute;
  top: 0;
}

.stats-left {
  right: calc(50% + 106px);
  left: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.stats-right {
  right: 0;
  left: calc(50% + 106px);
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.stats-left::after,
.stats-right::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 18px;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, #754714, #e4a83e 48%, #ffe09a 68%, #7c4a13);
  filter: drop-shadow(0 0 2px rgba(255, 203, 99, 0.42)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.78));
}

.stats-left::after {
  right: 0;
  clip-path: polygon(0 0, 3px 0, 18px 38px, 18px 42px, 3px 80px, 0 80px, 15px 40px);
}

.stats-right::after {
  left: 0;
  clip-path: polygon(18px 0, 15px 0, 0 38px, 0 42px, 15px 80px, 18px 80px, 3px 40px);
}

.topbar-brand {
  left: 50%;
  width: 236px;
  transform: translateX(-50%);
}

.tools-panel,
.intel-panel {
  top: 100px;
  max-height: calc(100vh - 184px);
  transition: width 180ms ease, padding 180ms ease;
}

.tools-panel {
  width: 250px;
}

.tools-city {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  margin: -1px 0 7px;
  padding: 4px 5px 9px;
  border-bottom: 1px solid rgba(226, 168, 68, 0.34);
}

.tools-city span {
  color: #a9ad9e;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.tools-city strong {
  overflow: hidden;
  color: #f4dfae;
  font-family: "Cinzel", Georgia, serif;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tools-panel .panel-header,
.intel-panel-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.tools-panel .panel-header {
  min-height: 33px;
  margin-bottom: 7px;
  padding-bottom: 7px;
}

.tools-panel .panel-header h2 {
  padding-left: 5px;
}

.intel-panel-header {
  min-height: 32px;
}

.intel-panel-header h2 {
  margin: 0;
  color: #f4dfae;
  font-family: "Cinzel", Georgia, serif;
  font-size: 14px;
  text-transform: uppercase;
}

.panel-collapse-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #f0d898;
  background:
    radial-gradient(circle at 50% 30%, rgba(231, 183, 100, 0.14), transparent 56%),
    linear-gradient(180deg, rgba(28, 32, 29, 0.98), rgba(7, 10, 9, 0.98));
  border: 1px solid rgba(204, 143, 49, 0.88);
  border-radius: 8px 3px 8px 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 221, 139, 0.1), 0 0 0 1px rgba(74, 47, 18, 0.64);
  cursor: pointer;
}

.panel-collapse-button:hover,
.panel-collapse-button:focus-visible {
  color: #fff0c7;
  border-color: #efb957;
  background: linear-gradient(180deg, rgba(61, 49, 28, 0.98), rgba(18, 16, 11, 0.98));
  outline: none;
}

.panel-collapse-button span {
  margin-top: -2px;
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1;
}

.tools-panel:not(.collapsed) .category-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.tools-panel:not(.collapsed) .category-button {
  position: relative;
  min-height: 42px;
  height: 42px;
  padding: 3px 5px;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 4px;
  font-size: 7.5px;
  line-height: 1.2;
}

.tools-panel:not(.collapsed) .category-button.compact-label {
  font-size: 6.75px;
}

.tools-panel:not(.collapsed) .category-icon {
  width: 27px;
  height: 27px;
  max-width: 27px;
  max-height: 27px;
  object-fit: contain;
}

.tools-panel:not(.collapsed) .category-button > span {
  padding-right: 2px;
  overflow-wrap: normal;
  text-overflow: clip;
  word-break: normal;
  white-space: normal;
}

.tools-panel:not(.collapsed) .category-new-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  font-size: 8px;
}

.tools-panel:not(.collapsed) .selected-tool-summary {
  min-height: 66px;
  margin-top: 8px;
  padding-block: 7px;
}

.intel-panel {
  width: 276px;
  gap: 8px;
}

.intel-panel:not(.collapsed) .guidance-card {
  max-height: 132px;
}

.intel-panel:not(.collapsed) .intel-action-button {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  column-gap: 8px;
  min-height: 44px;
  height: 44px;
  padding: 4px 9px 4px 7px;
}

.intel-panel:not(.collapsed) .intel-action-button img {
  display: block;
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-position: center;
}

@media (max-height: 820px) {
  .intel-panel:not(.collapsed) .guidance-card {
    max-height: 70px;
  }

  .intel-panel:not(.collapsed) .intel-action-button {
    min-height: 42px;
    height: 42px;
  }
}

.tools-panel.collapsed,
.intel-panel.collapsed {
  width: 64px;
  padding: 10px 8px;
}

.tools-panel.collapsed .tools-city,
.tools-panel.collapsed .panel-header h2,
.tools-panel.collapsed .selected-tool-summary,
.intel-panel.collapsed .intel-panel-header h2,
.intel-panel.collapsed .intel-sticky-hint,
.intel-panel.collapsed .intel-action-button span,
.intel-panel.collapsed .intel-action-button strong {
  display: none;
}

.tools-panel.collapsed .panel-header,
.intel-panel.collapsed .intel-panel-header {
  display: flex;
  min-height: 34px;
  margin: 0 0 7px;
  padding: 0 0 7px;
  justify-content: center;
  border-bottom: 1px solid rgba(226, 168, 68, 0.32);
}

.tools-panel.collapsed .category-tabs {
  grid-template-columns: 1fr;
  gap: 3px;
  margin: 0;
}

.tools-panel.collapsed .category-button {
  display: grid;
  width: 46px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 2px 4px;
  grid-template-columns: 1fr;
  place-items: center;
}

.tools-panel.collapsed .category-button > span,
.tools-panel.collapsed .category-new-badge {
  display: none;
}

.tools-panel.collapsed .build-popup {
  display: none !important;
}

.tools-panel.collapsed .category-icon {
  width: 27px;
  height: 27px;
  max-width: 27px;
  max-height: 27px;
  object-fit: contain;
}

.intel-panel.collapsed .intel-actions {
  gap: 5px;
  overflow: visible;
  border: 0;
}

.intel-panel.collapsed .intel-action-button,
.intel-panel.collapsed .intel-action-button:first-child,
.intel-panel.collapsed .intel-action-button:last-child {
  display: grid;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 4px;
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px solid rgba(204, 143, 49, 0.86);
  border-radius: 9px 3px 9px 3px;
}

.intel-panel.collapsed .intel-action-button img {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  grid-row: auto;
}

.command-dock .season-chip {
  min-width: 196px;
}

@media (max-width: 1180px) {
  .stats-left {
    right: calc(50% + 88px);
  }

  .stats-right {
    left: calc(50% + 88px);
  }

  .topbar-brand {
    width: 196px;
  }

  .topbar-logo {
    width: 194px;
  }

  .command-dock .season-chip {
    min-width: 158px;
    font-size: 9px;
  }
}

@media (max-width: 820px) {
  .tools-panel,
  .intel-panel {
    top: 96px;
  }

  .tools-panel:not(.collapsed) {
    width: 220px;
  }

  .intel-panel:not(.collapsed) {
    width: 238px;
  }
}

/* Mobile gameplay pass: keep the map playable and turn side panels into touch sheets. */
@media (max-width: 760px), (pointer: coarse) and (max-width: 900px) {
  html,
  body,
  .shell,
  .play-area,
  .map-wrap,
  #gameCanvas {
    height: 100dvh;
    min-height: 100dvh;
  }

  #gameCanvas {
    touch-action: none;
  }

  .topbar {
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    align-content: center;
    height: auto;
    min-height: 0;
    max-height: 56px;
    padding: 5px 7px 0;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar::-webkit-scrollbar {
    display: none;
  }

  .topbar-brand {
    display: none;
  }

  .stats-left,
  .stats-right,
  .topbar-brand {
    position: static;
    inset: auto;
    transform: none;
  }

  .stats-left,
  .stats-right {
    display: contents;
    height: auto;
    min-height: 0;
    padding: 4px;
    clip-path: none;
    overflow-x: auto;
    pointer-events: auto;
    border: 1px solid rgba(113, 78, 33, 0.82);
    scrollbar-width: none;
  }

  .stats-left::-webkit-scrollbar,
  .stats-right::-webkit-scrollbar {
    display: none;
  }

  .stats-left::after,
  .stats-right::after {
    display: none;
  }

  .stat {
    flex: 0 0 82px;
    grid-template-columns: 20px minmax(0, 1fr);
    grid-template-rows: 30px 4px;
    min-height: 38px;
    height: 38px;
    padding: 4px;
    column-gap: 3px;
  }

  .stat-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .stat strong {
    font-size: 13px;
  }

  .stat .stat-label {
    font-size: 8px;
  }

  .stat em {
    display: none;
  }

  .tools-panel,
  .intel-panel {
    top: 86px;
    max-height: calc(100dvh - 158px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tools-panel.collapsed,
  .intel-panel.collapsed {
    width: 66px;
    max-height: calc(100dvh - 162px);
    padding: 7px 9px;
  }

  .tools-panel.collapsed {
    left: 7px;
  }

  .tools-panel.collapsed .build-popup,
  .tools-panel.collapsed .selected-tool-summary {
    display: none !important;
  }

  .intel-panel.collapsed {
    right: 7px;
  }

  .intel-panel.collapsed .intel-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    overflow: hidden;
  }

  .intel-panel.collapsed .intel-action-button,
  .intel-panel.collapsed .intel-action-button:first-child,
  .intel-panel.collapsed .intel-action-button:last-child {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-height: 44px;
    overflow: hidden;
    padding: 3px;
  }

  .intel-panel.collapsed .intel-action-button img {
    grid-column: 1;
    grid-row: 1;
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
  }

  .tools-panel:not(.collapsed),
  .intel-panel:not(.collapsed) {
    right: 8px;
    left: 8px;
    top: auto;
    bottom: 70px;
    width: auto;
    max-height: min(56dvh, 440px);
    padding: 11px;
    z-index: 46;
    border-radius: 13px 5px 13px 5px;
    box-shadow:
      0 0 0 1px rgba(255, 229, 166, 0.08),
      0 -18px 52px rgba(0, 0, 0, 0.58);
  }

  .tools-panel:not(.collapsed) .category-button,
  .intel-panel:not(.collapsed) .intel-action-button,
  .panel-collapse-button,
  .dock-icon-button,
  .command-dock .overlay-button,
  .command-dock .speed-button {
    min-height: 44px;
  }

  .panel-collapse-button {
    width: 44px;
    height: 44px;
  }

  .tools-panel:not(.collapsed) .tools-city {
    display: none;
  }

  .tools-panel:not(.collapsed) .panel-header {
    min-height: 44px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .tools-panel:not(.collapsed) .category-tabs {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin-bottom: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tools-panel:not(.collapsed) .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .tools-panel:not(.collapsed) .category-button {
    flex: 0 0 132px;
    height: 48px;
    min-height: 48px;
    font-size: 7.2px;
  }

  .tools-panel:not(.collapsed) .selected-tool-summary {
    display: none;
  }

  .tools-panel:not(.collapsed) .build-popup {
    position: static;
    z-index: auto;
    width: auto;
    max-height: min(38dvh, 330px);
    overflow: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-overflow-scrolling: touch;
  }

  .tools-panel:not(.collapsed) .build-popup .popup-header {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 0 8px;
    padding: 0 0 8px;
    background: linear-gradient(180deg, rgba(16, 20, 19, 0.98), rgba(16, 20, 19, 0.82));
    border-bottom: 1px solid rgba(226, 168, 68, 0.28);
  }

  .tool-list {
    grid-template-columns: 1fr;
  }

  .tool-button {
    min-height: 76px;
  }

  .intel-panel:not(.collapsed) .guidance-card {
    max-height: 118px;
  }

  .intel-panel:not(.collapsed) .intel-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    border: 0;
  }

  .intel-panel:not(.collapsed) .intel-action-button {
    grid-template-columns: 36px minmax(0, 1fr);
    height: 48px;
    min-height: 48px;
    border: 1px solid rgba(204, 143, 49, 0.62);
    border-radius: 9px 3px 9px 3px;
  }

  .intel-panel:not(.collapsed) .intel-action-button strong {
    display: none;
  }

  .command-dock {
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom));
    left: 6px;
    display: flex;
    width: auto;
    min-height: 56px;
    max-width: none;
    gap: 7px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    transform: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .command-dock::-webkit-scrollbar {
    display: none;
  }

  .command-dock .dock-group {
    flex: 0 0 auto;
  }

  .dock-file-controls,
  .dock-time-controls {
    max-width: none;
  }

  .dock-overlay-controls {
    min-width: max-content;
  }

  .dock-group + .dock-group::before,
  .dock-label,
  .command-dock .season-chip {
    display: none;
  }

  .dock-icon-button,
  .labels-button,
  .command-dock .overlay-button,
  .command-dock .speed-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .command-dock .speed-row {
    grid-template-columns: repeat(3, 44px);
  }

  .camera-follow-chip {
    right: 9px;
    bottom: 72px;
    left: auto;
  }

  .city-alerts {
    top: 88px;
    right: 66px;
    left: 66px;
    width: auto;
    max-width: none;
    transform: none;
  }

  body:has(.tools-panel:not(.collapsed)) .city-alerts:not([hidden]),
  body:has(.intel-panel:not(.collapsed)) .city-alerts:not([hidden]) {
    display: none;
  }

  .selection-modal,
  .intel-modal,
  .confirm-modal,
  .game-menu-modal,
  .campaign-overlay {
    padding: 8px;
  }

  .selection-card,
  .intel-modal-card,
  .confirm-card,
  .save-modal-card,
  .stop-modal-card,
  .campaign-card {
    width: min(100%, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
  }
}

/* Campaign chronicle: progression, replay ledger and end-of-level receipts. */
.campaign-overlay {
  position: fixed;
  inset: 0;
  z-index: 325;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: auto;
}

.campaign-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(153, 105, 40, 0.18), transparent 34%),
    rgba(2, 4, 4, 0.88);
  backdrop-filter: blur(5px);
}

.campaign-card {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(243, 191, 84, 0.15), transparent 100px),
    radial-gradient(circle at 100% 0, rgba(243, 191, 84, 0.1), transparent 120px),
    linear-gradient(180deg, rgba(22, 26, 23, 0.99), rgba(6, 9, 8, 0.99));
  border: 1px solid rgba(226, 168, 68, 0.9);
  border-radius: 18px 5px 18px 5px;
  box-shadow:
    0 0 0 1px rgba(255, 224, 145, 0.13),
    0 0 0 4px rgba(74, 47, 18, 0.75),
    inset 0 0 0 1px rgba(255, 226, 151, 0.15),
    0 28px 90px rgba(0, 0, 0, 0.72);
  scrollbar-color: rgba(226, 168, 68, 0.6) rgba(0, 0, 0, 0.25);
}

.campaign-map-card {
  padding: clamp(16px, 2.6vw, 30px);
}

.campaign-header,
.campaign-footer,
.campaign-outcome-actions,
.campaign-briefing-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.campaign-header {
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(226, 168, 68, 0.32);
}

.campaign-header span,
.campaign-outcome-heading > span,
.campaign-chapter > header > span,
.campaign-level-copy > span,
.campaign-chapter-receipt > span,
.campaign-summary-receipt > span,
.campaign-receipt-columns article > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.campaign-header h2,
.campaign-outcome-heading h2 {
  margin: 3px 0 4px;
  color: #f8e7bd;
  font-family: "Cinzel Decorative", "Cinzel", Georgia, serif;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.05;
  text-shadow: 0 2px 10px #000;
}

.campaign-header p,
.campaign-chapter header p,
.campaign-chapter-thesis,
.campaign-level-copy p,
.campaign-level-copy small,
.campaign-footer span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.campaign-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: #e9d7ae;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(226, 168, 68, 0.42);
  border-radius: 9px 3px 9px 3px;
  font-size: 25px;
}

.campaign-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 11px 13px;
  background: rgba(231, 183, 100, 0.075);
  border: 1px solid rgba(231, 183, 100, 0.22);
  border-radius: 9px 3px 9px 3px;
}

.campaign-progress strong {
  color: #f4d893;
  font-size: 12px;
}

.campaign-progress span {
  color: var(--muted);
  font-size: 10px;
}

.campaign-chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.campaign-chapter {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(192, 160, 102, 0.2);
  border-radius: 12px 3px 12px 3px;
}

.campaign-chapter.complete {
  border-color: rgba(144, 208, 127, 0.4);
  box-shadow: inset 0 0 24px rgba(101, 153, 89, 0.055);
}

.campaign-chapter > header {
  position: relative;
  padding-right: 64px;
}

.campaign-chapter h3 {
  margin: 2px 0;
  color: #f3e4be;
  font-family: "Cinzel Decorative", "Cinzel", Georgia, serif;
  font-size: 17px;
}

.campaign-chapter > header small {
  position: absolute;
  top: 2px;
  right: 0;
  color: #f4d893;
  font-size: 9px;
  font-style: normal;
}

.campaign-chapter-thesis {
  min-height: 45px;
  margin-top: 9px;
  padding: 8px 9px;
  color: #d5c59d;
  background: rgba(0, 0, 0, 0.19);
  border-left: 2px solid rgba(231, 183, 100, 0.45);
}

.campaign-level-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.campaign-level {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px 2px 8px 2px;
}

.campaign-level.completed {
  border-color: rgba(144, 208, 127, 0.28);
}

.campaign-level.locked {
  opacity: 0.54;
  filter: saturate(0.45);
}

.campaign-level-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #f0cd80;
  background: #111511;
  border: 1px solid rgba(231, 183, 100, 0.36);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.campaign-level-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.campaign-level-copy strong {
  color: var(--text);
  font-size: 11px;
}

.campaign-level-copy > small {
  color: #c9b982;
}

.campaign-level-copy > em {
  margin-top: 4px;
  color: #a9d59d;
  font-size: 9px;
  font-style: normal;
}

.campaign-level-requirements {
  margin-top: 5px;
  padding: 6px 8px;
  color: #d8cdaf;
  background: rgba(231, 183, 100, 0.055);
  border-left: 2px solid rgba(231, 183, 100, 0.5);
}

.campaign-level-requirements summary {
  color: #efcf87;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.campaign-level-requirements ul {
  margin: 7px 0 0;
  padding-left: 16px;
}

.campaign-level-requirements li {
  margin-top: 3px;
  color: #cfc5ae;
  font-size: 9px;
  line-height: 1.4;
}

.campaign-level-requirements p {
  margin: 7px 0 0;
  color: #9fd292;
  font-size: 8px;
  font-weight: 800;
}

.campaign-level > button,
.campaign-footer button,
.campaign-outcome-actions button,
.campaign-briefing-actions button {
  min-width: 74px;
  min-height: 34px;
  padding: 6px 10px;
  color: #f3e8ce;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(231, 183, 100, 0.34);
  border-radius: 7px 2px 7px 2px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.campaign-level > button:hover,
.campaign-footer button:hover,
.campaign-outcome-actions button:hover,
.campaign-briefing-actions button:hover,
.campaign-close:hover {
  color: #fff1c9;
  background: rgba(231, 183, 100, 0.14);
  border-color: rgba(231, 183, 100, 0.75);
}

.campaign-level > button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.campaign-level > button.primary {
  color: #fff0c2;
  background: rgba(231, 183, 100, 0.16);
  border-color: rgba(231, 183, 100, 0.65);
}

.campaign-briefing-card {
  width: min(780px, 100%);
  padding: clamp(22px, 4vw, 42px);
}

.campaign-briefing-heading {
  text-align: center;
}

.campaign-briefing-heading > span,
.campaign-briefing-objectives > div > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.campaign-briefing-heading h2 {
  margin: 5px 0 8px;
  color: #f4e2b7;
  font: 900 clamp(25px, 5vw, 44px)/1.05 "Cinzel Decorative", "Cinzel", Georgia, serif;
}

.campaign-briefing-heading strong {
  display: block;
  color: #e7b764;
  font: 800 13px/1.4 "Cinzel", Georgia, serif;
}

.campaign-briefing-heading p {
  max-width: 600px;
  margin: 8px auto 0;
  color: #c9c1ad;
  font-size: 11px;
  line-height: 1.55;
}

.campaign-map-choice,
.campaign-map-carry-note {
  display: grid;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
  background: rgba(44, 79, 65, 0.2);
  border: 1px solid rgba(130, 167, 122, 0.34);
  border-radius: 10px 3px 10px 3px;
}

.campaign-map-choice {
  grid-template-columns: 150px minmax(0, 1fr) auto;
}

.campaign-map-preview {
  height: 92px;
  overflow: hidden;
  background: #19201a;
  border: 1px solid rgba(225, 194, 126, 0.38);
  border-radius: 7px 2px 7px 2px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.42);
}

.campaign-map-preview svg {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.campaign-map-choice-copy > span,
.campaign-map-choice-copy > strong,
.campaign-map-choice-copy > small,
.campaign-map-carry-note > strong,
.campaign-map-carry-note > span {
  display: block;
}

.campaign-map-choice-copy > span {
  color: #9bc596;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.campaign-map-choice-copy > strong,
.campaign-map-carry-note > strong {
  margin-top: 2px;
  color: #f0dda9;
  font: 850 15px/1.25 "Cinzel", Georgia, serif;
}

.campaign-map-choice-copy > small,
.campaign-map-carry-note > span {
  margin-top: 4px;
  color: #bdb5a2;
  font-size: 9px;
  line-height: 1.45;
}

.campaign-map-choice > button {
  min-height: 36px;
  padding: 7px 11px;
  color: #eaddbd;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(155, 197, 150, 0.48);
  border-radius: 7px 2px 7px 2px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.campaign-map-choice > button:hover {
  color: #fff1c9;
  background: rgba(155, 197, 150, 0.12);
  border-color: rgba(155, 197, 150, 0.8);
}

.campaign-map-carry-note {
  grid-template-columns: 1fr;
  gap: 0;
}

.campaign-briefing-objectives {
  margin-top: 22px;
  padding: 16px;
  background: rgba(231, 183, 100, 0.055);
  border: 1px solid rgba(231, 183, 100, 0.26);
  border-radius: 10px 3px 10px 3px;
}

.campaign-briefing-objectives > div h3 {
  margin: 3px 0;
  color: #f0dda9;
  font: 850 16px/1.2 "Cinzel", Georgia, serif;
}

.campaign-briefing-objectives > div p {
  margin: 0;
  color: #bdb5a2;
  font-size: 10px;
  line-height: 1.45;
}

.campaign-briefing-objectives ol {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.campaign-briefing-objectives li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 2px solid rgba(231, 183, 100, 0.58);
}

.campaign-briefing-objectives li.campaign-objective-phase {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  padding: 7px 10px;
  color: #e7b764;
  background: rgba(231, 183, 100, 0.09);
  border-left: 0;
  border-bottom: 1px solid rgba(231, 183, 100, 0.28);
  font: 800 10px/1.2 "Cinzel", Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-briefing-objectives li.campaign-objective-phase small {
  color: #a9a18f;
  font: 700 8px/1.2 system-ui, sans-serif;
  letter-spacing: 0.05em;
}

.campaign-outcome-objective small {
  display: block;
  margin: 1px 0 2px;
  color: #9f9784;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.campaign-briefing-objectives li > i {
  display: grid;
  width: 26px;
  height: 26px;
  color: #f0cf83;
  place-items: center;
  border: 1px solid rgba(231, 183, 100, 0.55);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.campaign-briefing-objectives li strong,
.campaign-briefing-objectives li span {
  display: block;
}

.campaign-briefing-objectives li strong {
  color: #e9dec5;
  font-size: 11px;
}

.campaign-briefing-objectives li span {
  margin-top: 2px;
  color: #aaa38f;
  font-size: 9px;
  line-height: 1.45;
}

.campaign-briefing-actions {
  position: sticky;
  z-index: 3;
  bottom: -1px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 15px;
  padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(8, 11, 9, 0), rgba(8, 11, 9, 0.98) 24%);
  border-top: 1px solid rgba(226, 168, 68, 0.28);
}

.campaign-briefing-actions .primary {
  color: #fff0c2;
  background: rgba(231, 183, 100, 0.16);
  border-color: rgba(231, 183, 100, 0.65);
}

.campaign-attempt-history {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.campaign-attempt-history summary {
  width: max-content;
  color: #d8c48f;
  cursor: pointer;
}

.campaign-attempt-history > div {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.campaign-attempt-history article {
  display: grid;
  gap: 1px;
  padding: 6px 7px;
  background: rgba(0, 0, 0, 0.24);
  border-left: 2px solid var(--danger);
}

.campaign-attempt-history article.success {
  border-left-color: var(--good);
}

.campaign-attempt-history article span,
.campaign-attempt-history article small,
.campaign-attempt-history article p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.campaign-attempt-history article strong {
  color: #e7dbbf;
  font-size: 9px;
}

.campaign-chapter-receipt {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 9px;
  background: rgba(113, 169, 98, 0.08);
  border: 1px solid rgba(144, 208, 127, 0.25);
}

.campaign-chapter-receipt strong {
  color: #cce5c0;
  font-size: 10px;
}

.campaign-chapter-receipt p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.campaign-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 168, 68, 0.24);
}

.campaign-outcome-card {
  width: min(840px, 100%);
  padding: clamp(20px, 4vw, 42px);
  overflow: auto;
}

.campaign-outcome-card.open { --receipt-color: #90d07f; }
.campaign-outcome-card.controlled { --receipt-color: #d8785f; }
.campaign-outcome-card.contested { --receipt-color: #e7b764; }
.campaign-outcome-card.failure { --receipt-color: #d86f5c; }

.campaign-outcome-heading {
  text-align: center;
}

.campaign-outcome-heading > strong {
  display: block;
  margin-top: 8px;
  color: var(--receipt-color);
  font-size: clamp(13px, 2vw, 19px);
}

.campaign-result-banner {
  display: grid;
  width: min(360px, 100%);
  gap: 2px;
  margin: 14px auto 0;
  padding: 10px 16px;
  text-align: center;
  background: color-mix(in srgb, var(--receipt-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--receipt-color) 58%, transparent);
  border-radius: 5px 2px 5px 2px;
}

.campaign-result-banner > span {
  color: #bdb6a4;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.campaign-result-banner > strong {
  color: var(--receipt-color);
  font: 900 clamp(18px, 3vw, 28px)/1.1 "Cinzel", Georgia, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-outcome-objectives {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.campaign-outcome-objectives > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(231, 183, 100, 0.2);
}

.campaign-outcome-objectives > header strong {
  color: #f0dda9;
  font: 800 11px/1.25 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.campaign-outcome-objectives > header div {
  display: grid;
  gap: 3px;
}

.campaign-outcome-objectives > header small {
  color: #bdb6a4;
  font-size: 8px;
  line-height: 1.4;
}

.campaign-outcome-objectives > header span {
  color: var(--receipt-color);
  font-size: 9px;
  font-weight: 850;
}

.campaign-outcome-objective-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.campaign-outcome-objective {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  color: #c8c0ac;
  background: rgba(216, 111, 92, 0.045);
  border-left: 2px solid rgba(216, 111, 92, 0.62);
}

.campaign-outcome-objective > i {
  color: #d86f5c;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.campaign-outcome-objective strong,
.campaign-outcome-objective span {
  display: block;
}

.campaign-outcome-objective strong {
  color: #e3d8be;
  font-size: 10px;
}

.campaign-outcome-objective span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.campaign-outcome-objective.complete {
  background: rgba(101, 184, 117, 0.045);
  border-left-color: rgba(101, 184, 117, 0.7);
}

.campaign-outcome-objective.complete > i,
.campaign-outcome-objective.complete strong {
  color: #90d07f;
}

.campaign-receipt-message {
  max-width: 680px;
  margin: 14px auto 18px;
  color: #d6ceba;
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.campaign-failure-diagnosis {
  display: grid;
  gap: 4px;
  max-width: 680px;
  margin: 0 auto 14px;
  padding: 10px 12px;
  color: #d8cabb;
  background: rgba(216, 111, 92, 0.09);
  border: 1px solid rgba(216, 111, 92, 0.48);
  border-left-width: 3px;
}

.campaign-failure-diagnosis > span {
  color: #dca08f;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-failure-diagnosis > strong {
  color: #efc0b4;
  font: 800 11px/1.35 "Cinzel", Georgia, serif;
}

.campaign-failure-diagnosis > p {
  margin: 0;
  color: #c9bcaa;
  font-size: 9px;
  line-height: 1.45;
}

.campaign-failure-finance {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.campaign-failure-finance > div {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(216, 111, 92, 0.2);
}

.campaign-failure-finance span,
.campaign-failure-finance small {
  color: #ad9f8e;
  font-size: 7px;
  line-height: 1.3;
  text-transform: uppercase;
}

.campaign-failure-finance strong {
  color: #efd6c9;
  font: 800 9px/1.3 "Cinzel", Georgia, serif;
}

.campaign-failure-prevention {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(216, 111, 92, 0.28);
}

.campaign-failure-prevention > span {
  color: #edc776;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-failure-prevention ol {
  display: grid;
  gap: 5px;
  margin: 6px 0 0;
  padding-left: 18px;
}

.campaign-failure-prevention li {
  padding-left: 2px;
  color: #edc776;
  font-size: 8px;
}

.campaign-failure-prevention li strong,
.campaign-failure-prevention li span {
  display: block;
}

.campaign-failure-prevention li strong {
  color: #eadcca;
  font: 800 9px/1.35 "Cinzel", Georgia, serif;
}

.campaign-failure-prevention li span {
  margin-top: 1px;
  color: #bfb2a2;
  font-size: 8px;
  line-height: 1.4;
}

.association-finance-explanation ol {
  margin: 8px 0 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.association-finance-explanation li + li { margin-top: 3px; }

@media (max-width: 820px) {
  .campaign-failure-finance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.campaign-outcome-scores,
.campaign-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.campaign-outcome-scores {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.campaign-outcome-scores > div,
.campaign-dimensions > div {
  display: grid;
  gap: 3px;
  padding: 9px;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.campaign-outcome-scores span,
.campaign-dimensions span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.campaign-outcome-scores strong {
  color: var(--receipt-color);
  font-size: 14px;
}

.campaign-dimensions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 6px;
}

.campaign-dimensions strong {
  color: #eadbb7;
  font-size: 11px;
}

.campaign-receipt-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.campaign-receipt-columns article {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 2px solid var(--receipt-color);
}

.campaign-receipt-columns p {
  margin: 6px 0 0;
  color: #d2c9b5;
  font-size: 10px;
  line-height: 1.55;
}

.campaign-summary-receipt {
  margin-top: 10px;
  padding: 14px;
  background: rgba(231, 183, 100, 0.055);
  border: 1px solid rgba(231, 183, 100, 0.28);
  border-radius: 9px 2px 9px 2px;
}

.campaign-summary-receipt h3 {
  margin: 4px 0;
  color: #f0dda9;
  font-size: 13px;
}

.campaign-summary-receipt p,
.campaign-summary-receipt small {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.campaign-summary-receipt > div {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.campaign-summary-receipt > div strong {
  color: #dfe6d6;
  font-size: 9px;
}

.campaign-outcome-actions {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(226, 168, 68, 0.28);
  justify-content: flex-end;
}

.campaign-outcome-actions .primary {
  color: #fff0c2;
  background: rgba(231, 183, 100, 0.16);
  border-color: rgba(231, 183, 100, 0.65);
}

@media (max-width: 880px) {
  .campaign-overlay { padding: 8px; }
  .campaign-card { max-height: calc(100vh - 16px); }
  .campaign-chapters { grid-template-columns: 1fr; }
  .campaign-header p { max-width: 72vw; }
}

@media (max-width: 560px) {
  .campaign-progress,
  .campaign-footer,
  .campaign-outcome-actions,
  .campaign-briefing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .campaign-level { grid-template-columns: 30px minmax(0, 1fr); }
  .campaign-level > button { grid-column: 2; justify-self: start; }
  .campaign-outcome-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campaign-receipt-columns { grid-template-columns: 1fr; }
  .campaign-outcome-objective-list { grid-template-columns: 1fr; }
  .campaign-outcome-actions button { width: 100%; }
  .campaign-briefing-actions button { width: 100%; }
  .campaign-map-choice { grid-template-columns: 1fr; }
  .campaign-map-preview { height: 110px; }
  .campaign-map-choice > button { width: 100%; }
}

/* Shared modal chrome: the header and navigation stay visible while only content scrolls. */
.modal-shell-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(231, 183, 100, 0.1), transparent 56%),
    rgba(19, 23, 22, 0.99);
  border-bottom: 1px solid rgba(231, 183, 100, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.modal-shell-header > div {
  min-width: 0;
}

.modal-shell-header strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.2;
}

.modal-close-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(174, 182, 168, 0.28);
  border-radius: 9px 3px 9px 3px;
  font-size: 23px;
  line-height: 1;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  color: #fff1c9;
  background: rgba(231, 183, 100, 0.13);
  border-color: rgba(231, 183, 100, 0.8);
  outline: none;
}

.game-menu-modal .modal-card,
.confirm-modal .modal-card,
.intel-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.modal-scroll-region,
.intel-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(226, 168, 68, 0.58) rgba(0, 0, 0, 0.22);
}

.modal-scroll-region {
  padding: 0 18px 18px;
}

.confirm-modal .modal-scroll-region {
  padding: 0 14px 14px;
}

.save-modal-card {
  width: min(960px, calc(100vw - 36px));
}

.save-slot-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-slot-actions button,
.save-modal-footer button {
  display: inline-grid;
  place-items: center;
  line-height: 1.2;
  white-space: nowrap;
}

.stop-modal-card .modal-scroll-region > p {
  margin: 18px 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.intel-modal-card .modal-shell-header {
  padding-bottom: 0;
}

.intel-section-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 12px 0 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.intel-section-tabs button {
  display: inline-grid;
  min-width: max-content;
  min-height: 38px;
  flex: 1 0 auto;
  place-items: center;
  line-height: 1.15;
  white-space: nowrap;
}

.intel-modal-body {
  padding: 18px;
}

.selection-card {
  grid-template-rows: auto minmax(220px, 430px) minmax(0, 1fr);
}

.selection-chrome {
  position: relative;
  z-index: 2;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(231, 183, 100, 0.1), transparent 56%),
    rgba(19, 23, 22, 0.99);
  border-bottom: 1px solid rgba(231, 183, 100, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.selection-chrome .selection-header {
  background: transparent;
  border-bottom: 0;
}

.selection-chrome .selection-tabs {
  padding: 0 20px;
  border-bottom: 0;
}

.selection-hero {
  overflow: hidden;
}

.selection-hero-copy {
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.resource-selection-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.resource-selection-card .selection-header {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.city-alert,
.city-alert-kicker,
.city-alert-fact > span,
.city-alert-fact > small,
.city-alert-message,
.city-alert-action,
.city-alert-count {
  font-family: "Cinzel", Georgia, serif;
}

.city-alert {
  padding-right: 70px;
}

.city-alert-dismiss {
  display: grid;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(174, 182, 168, 0.28);
  border-radius: 9px 3px 9px 3px;
  font-size: 23px;
  line-height: 1;
}

.city-alert-dismiss:hover,
.city-alert-dismiss:focus-visible {
  color: #fff1c9;
  background: rgba(231, 183, 100, 0.13);
  border-color: rgba(231, 183, 100, 0.8);
  outline: none;
}

@media (max-width: 780px) {
  .selection-card {
    display: block;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .selection-chrome {
    position: sticky;
    top: 0;
  }

  .selection-body {
    overflow: visible;
  }

  .selection-header > .modal-close-button {
    grid-column: 2;
    grid-row: 1;
  }

  .selection-chrome .selection-tabs {
    padding-inline: 14px;
  }

  .city-alert {
    padding-right: 62px;
  }

  .city-alert-dismiss {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 560px) {
  .game-menu-modal,
  .intel-modal,
  .confirm-modal {
    padding: 8px;
  }

  .save-modal-card,
  .intel-modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-shell-header,
  .intel-modal-body {
    padding: 14px;
  }

  .intel-modal-card .modal-shell-header {
    padding-bottom: 0;
  }

  .modal-scroll-region {
    padding: 0 14px 14px;
  }

  .save-slot-actions button {
    flex: 1 1 96px;
  }
}

@media (max-width: 760px), (pointer: coarse) and (max-width: 900px) {
  .city-alert {
    max-height: none;
    overflow: visible;
    padding: 10px 52px 10px 12px;
  }

  .city-alert-header {
    padding-right: 0;
  }

  .city-alert-title {
    font-size: clamp(18px, 5.3vw, 23px);
    line-height: 1.08;
  }

  .city-alert-facts,
  .city-alert-message {
    display: none;
  }

  .city-alert-action {
    display: block;
    margin-top: 8px;
    max-height: 5.4em;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
  }

  .city-alert-action > span {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
  }

  .city-alert-dismiss {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
}
