:root {
  color-scheme: dark;
  --bg: #0c1418;
  --panel: #121e23;
  --line: #2b373b;
  --text: #e7e9df;
  --muted: #8a9b9b;
  --gold: #dbb777;
  --green: #87b5a0;
  --red: #d77c6e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px 'Segoe UI',
    sans-serif;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 5px;
  padding: 10px 14px;
  transition: 0.18s;
}
button:hover:not(:disabled) {
  background: #263438;
  border-color: #70827d;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.4%;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--text);
  font-size: 25px;
  letter-spacing: 6px;
  font-weight: 700;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 5px;
  color: var(--gold);
  margin-top: 3px;
}
.brand-mark {
  position: relative;
  font-family: Georgia, serif;
  border: 1px solid var(--gold);
  color: var(--gold);
  width: 41px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 28px;
  letter-spacing: 0;
}
.brand-mark span {
  position: absolute;
  font-size: 8px;
  bottom: -6px;
  background: var(--bg);
  padding: 0 5px;
}
.edition {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
.edition span {
  border-left: 1px solid var(--line);
  margin-left: 16px;
  padding-left: 16px;
  color: var(--gold);
}
.header-actions {
  display: flex;
  gap: 8px;
}
.header-actions button {
  font-size: 12px;
  padding: 8px 12px;
}
.ticker {
  height: 37px;
  background: #142024;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 0 3.4%;
  font-size: 10px;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--line);
}
.ticker > span:first-child {
  color: var(--gold);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
}
.ticker p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a8b5b2;
}
.ticker-end {
  margin-left: auto;
  white-space: nowrap;
  color: #627673;
}
.ticker i,
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px #87b5a045;
  margin-right: 7px;
}
main {
  max-width: 1680px;
  margin: auto;
  padding: 28px 3.4%;
}
.command {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}
h1 {
  font:
    normal 31px Georgia,
    serif;
  margin: 9px 0 0;
  letter-spacing: -0.6px;
}
h1 span {
  color: var(--gold);
}
h2 {
  font:
    normal 20px Georgia,
    serif;
  margin: 6px 0 0;
}
.clock {
  display: flex;
  align-items: center;
  gap: 24px;
}
.clock strong {
  font:
    15px 'Courier New',
    monospace;
  letter-spacing: 1px;
}
.clock small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.speeds {
  display: flex;
  background: #172328;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px;
}
.speeds button {
  border: 0;
  font-size: 12px;
  padding: 9px 11px;
}
.speeds button.active {
  color: #151e20;
  background: var(--gold);
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(115deg, #19262b, #121e23);
  padding: 16px 18px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.stat-top b {
  font-size: 15px;
  color: var(--gold);
  font-weight: 400;
}
.stat strong {
  font-size: 25px;
  font-weight: 500;
  display: block;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
.stat small {
  color: var(--muted);
  font-size: 10px;
}
.stat .bar {
  margin-top: 9px;
  height: 3px;
  background: #2c373b;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 0.5s;
}
.stat.danger .bar > i {
  background: var(--red);
}
.stat.gold strong {
  color: var(--gold);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}
.map-panel,
.decision-panel,
.projects-panel,
.journal-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  overflow: hidden;
}
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  gap: 10px;
}
.map-tabs {
  display: flex;
  gap: 3px;
}
.map-tabs button {
  padding: 7px 10px;
  font-size: 10px;
  border-color: transparent;
}
.map-tabs .active {
  color: var(--gold);
  border-color: #6e6047;
  background: #d9b5730b;
}
.map-wrap {
  position: relative;
  background: #101e23;
  overflow: hidden;
  border-top: 1px solid #223439;
  border-bottom: 1px solid #223439;
}
#map {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}
#land path {
  fill: #293c3e;
  stroke: #102024;
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  transition: fill 0.3s;
}
#land path.playable {
  fill: #3c5251;
  cursor: pointer;
}
#land path.playable:hover {
  fill: #a18c64;
}
#land path.home {
  fill: #d9b779;
}
#land path.ally {
  fill: #719d8b;
}
#land path.selected {
  stroke: #f5d399;
  stroke-width: 1.6;
}
.ocean-label {
  font:
    8px 'Segoe UI',
    sans-serif;
  letter-spacing: 3px;
  fill: #486264;
}
.map-marker {
  cursor: pointer;
}
.map-marker circle {
  fill: #d7b576;
  stroke: #15282a;
  stroke-width: 2;
}
.map-marker .ring {
  fill: none;
  stroke: #e1bd7d;
  stroke-width: 0.8;
  opacity: 0.4;
}
.map-marker text {
  font:
    8px 'Segoe UI',
    sans-serif;
  fill: #dfdbc9;
  paint-order: stroke;
  stroke: #15272c;
  stroke-width: 3;
  stroke-linejoin: round;
}
.map-marker.home circle {
  fill: #fff0ca;
}
.map-caption {
  position: absolute;
  bottom: 16px;
  left: 20px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  pointer-events: none;
}
.map-zoom {
  position: absolute;
  bottom: 14px;
  right: 15px;
  display: flex;
  gap: 4px;
}
.map-zoom button {
  background: #14252be8;
  font-size: 18px;
  width: 30px;
  padding: 2px;
}
.map-bottom {
  display: flex;
  gap: 16px;
  padding: 13px 22px;
  font-size: 9px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.legend {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 1px;
}
.legend.home {
  background: var(--gold);
}
.legend.ally {
  background: var(--green);
}
.legend.neutral {
  background: #4a6361;
}
.map-note {
  margin-left: auto;
}
.country-strip {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 22px 0;
}
.country-strip label {
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--muted);
}
select {
  background: #17272c;
  border: 1px solid #40514f;
  border-radius: 4px;
  padding: 7px 9px;
  color: var(--text);
  max-width: 200px;
}
.country-strip > span {
  margin-left: auto;
  font-size: 10px;
  color: var(--gold);
}
#country-detail {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px 20px;
}
.country-metrics {
  display: flex;
  gap: 20px;
  flex: 1;
}
.country-metrics small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 5px;
}
.country-metrics b {
  font-size: 14px;
  font-weight: 500;
}
.country-actions {
  display: flex;
  gap: 6px;
}
.country-actions button {
  font-size: 10px;
  padding: 9px 10px;
}
.pill {
  font-size: 8px;
  letter-spacing: 1px;
  border: 1px solid #806c43;
  color: var(--gold);
  padding: 5px 7px;
  border-radius: 3px;
}
.decision-panel {
  background: linear-gradient(160deg, #1d292c, #152024 55%);
}
.decision-panel .panel-top {
  padding-bottom: 15px;
}
.dossier {
  margin: 0 20px 20px;
  border: 1px solid #3d4642;
  border-radius: 5px;
  overflow: hidden;
  background: #202c2d;
  touch-action: pan-y;
  position: relative;
}
.portrait {
  height: 170px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 20%, #626750, #273d39 60%, #22332f);
}
.portrait svg {
  display: block;
  width: 100%;
  height: 100%;
}
.portrait:after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, #0000000a 4px);
  pointer-events: none;
}
.dossier-number {
  position: absolute;
  top: 12px;
  left: 12px;
  font: 9px monospace;
  color: #d0d2b2;
}
.classified {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #c5b484;
  font-size: 8px;
  letter-spacing: 1.2px;
  border: 1px solid #af9d6360;
  padding: 3px 5px;
  transform: rotate(4deg);
}
.person {
  padding: 14px 16px;
  border-bottom: 1px solid #465046;
}
.person strong {
  display: block;
  font:
    19px Georgia,
    serif;
}
.person small {
  font-size: 10px;
  color: #a5b4a8;
  display: block;
  margin-top: 5px;
}
.person .loyalty {
  float: right;
  color: var(--gold);
  font-size: 9px;
  margin-top: 4px;
}
.card-content {
  padding: 16px;
}
.card-content h3 {
  font:
    21px Georgia,
    serif;
  margin: 0 0 12px;
  line-height: 1.18;
}
.card-content p {
  font-size: 12px;
  line-height: 1.7;
  color: #bdc6bc;
  margin: 0;
}
.card-hint {
  font-size: 9px !important;
  line-height: 1.6 !important;
  color: #849b92 !important;
  margin-top: 14px !important;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 16px 16px;
}
.choices button {
  font-size: 10px;
  line-height: 1.4;
  text-align: left;
  padding: 11px 9px;
  border-color: #566052;
}
.choices button:last-child {
  background: var(--gold);
  color: #1f2924;
  border-color: var(--gold);
}
.choices button span {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.swipe-help {
  text-align: center;
  color: #748b84;
  font-size: 9px;
  margin: 0 0 16px;
  letter-spacing: 0.5px;
}
.waiting {
  padding: 36px 25px;
  text-align: center;
}
.waiting .seal {
  font-size: 50px;
  color: var(--gold);
  margin-bottom: 25px;
}
.waiting h3 {
  font:
    24px Georgia,
    serif;
}
.waiting p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 12px;
}
.waiting button {
  margin-top: 15px;
  background: var(--gold);
  color: #1b2925;
}
.lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  margin-top: 20px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 20px 20px;
}
.project {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #172429;
}
.project .icon {
  display: block;
  color: var(--gold);
  font:
    25px Georgia,
    serif;
  margin-bottom: 12px;
}
.project h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 7px;
}
.project p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  min-height: 47px;
  margin: 0 0 12px;
}
.project button {
  width: 100%;
  padding: 8px 4px;
  font-size: 10px;
  border-color: #45514b;
  color: var(--gold);
}
.project progress {
  width: 100%;
  height: 5px;
  accent-color: var(--gold);
}
.project .progress-label {
  font-size: 10px;
  color: var(--gold);
}
#journal {
  padding: 0 20px 15px;
  max-height: 390px;
  overflow: auto;
}
.log-entry {
  border-left: 1px solid #4c594e;
  padding: 0 0 18px 13px;
  position: relative;
}
.log-entry:before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  position: absolute;
  left: -3px;
  top: 4px;
}
.log-entry small {
  font: 9px monospace;
  color: #7f948c;
}
.log-entry p {
  font-size: 11px;
  line-height: 1.6;
  margin: 5px 0 0;
  color: #bac5bc;
}
.muted {
  font-size: 10px;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  margin: 0 3.4%;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 8px;
  letter-spacing: 0.7px;
  color: #6e8480;
}
dialog {
  color: var(--text);
  border: 1px solid #66705b;
  background: #152326;
  border-radius: 9px;
  padding: 34px;
  max-width: 660px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #061013cc;
  backdrop-filter: blur(6px);
}
dialog h2 {
  font-size: 35px;
  margin: 12px 0 18px;
}
dialog p {
  line-height: 1.8;
  color: #aebfb6;
  font-size: 13px;
}
dialog .primary {
  background: var(--gold);
  color: #17251f;
  border-color: var(--gold);
  margin-top: 18px;
  width: 100%;
  font-weight: 600;
}
dialog .setup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.setup-country {
  text-align: left;
  padding: 13px;
}
.setup-country strong {
  font-size: 12px;
  display: block;
}
.setup-country small {
  font-size: 9px;
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.setup-country.active {
  border-color: var(--gold);
  background: #3b3b2c;
}
dialog ul {
  padding-left: 20px;
  color: #b7c8bc;
  font-size: 13px;
  line-height: 1.9;
}
.setup-note {
  font-size: 10px !important;
}
.resume {
  width: 100%;
  margin-top: 10px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #e0c28d;
  color: #172522;
  padding: 14px 24px;
  border-radius: 6px;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  z-index: 9;
  max-width: 90%;
  font-size: 12px;
  box-shadow: 0 10px 30px #0005;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 1500px) {
  .workspace,
  .lower {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .portrait {
    height: 210px;
  }
  .card-content {
    padding: 20px;
  }
  .card-content p {
    font-size: 14px;
  }
  .choices button {
    font-size: 12px;
  }
}
@media (max-width: 1100px) {
  .edition {
    display: none;
  }
  .workspace,
  .lower {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 13px;
  }
  .stat-top {
    font-size: 8px;
  }
  .stat strong {
    font-size: 22px;
  }
  .country-metrics {
    gap: 12px;
  }
  #country-detail {
    flex-wrap: wrap;
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-tabs button {
    padding: 7px;
  }
  .map-note {
    display: none;
  }
}
@media (max-width: 780px) {
  header {
    height: 73px;
    padding: 0 18px;
  }
  .brand {
    font-size: 20px;
  }
  .header-actions button {
    font-size: 10px;
    padding: 8px;
  }
  .header-actions #help span {
    display: none;
  }
  .ticker {
    padding: 0 18px;
    gap: 15px;
  }
  .ticker-end {
    display: none;
  }
  main {
    padding: 23px 16px;
  }
  .command {
    align-items: flex-start;
    gap: 15px;
  }
  .command h1 {
    font-size: 25px;
    max-width: 230px;
  }
  .clock {
    gap: 8px;
    flex-direction: column;
    align-items: flex-end;
  }
  .clock strong {
    font-size: 12px;
  }
  .clock small {
    font-size: 9px;
  }
  .speeds button {
    padding: 7px 9px;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }
  .stat {
    padding: 12px 10px;
  }
  .stat:nth-child(4),
  .stat:nth-child(5) {
    grid-column: auto;
  }
  .stat strong {
    font-size: 20px;
  }
  .stat small {
    font-size: 8px;
  }
  .workspace,
  .lower {
    grid-template-columns: 1fr;
  }
  .map-panel .panel-top {
    padding: 18px 14px;
  }
  .map-tabs button {
    font-size: 9px;
    padding: 7px;
  }
  .panel-top h2 {
    font-size: 19px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.6px;
  }
  #map {
    min-height: 230px;
  }
  .map-bottom {
    padding: 12px;
    gap: 12px;
  }
  .country-strip {
    padding: 14px 14px 0;
    gap: 8px;
    flex-wrap: wrap;
  }
  .country-strip label {
    display: none;
  }
  .country-strip > span {
    font-size: 9px;
  }
  #country-detail {
    padding: 15px 14px;
  }
  .decision-panel .portrait {
    height: 185px;
  }
  .dossier {
    max-width: 460px;
    margin: 0 auto 20px;
    width: calc(100% - 36px);
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 14px 15px;
  }
  .panel-top {
    padding: 18px;
  }
  .muted {
    display: none;
  }
  footer {
    flex-direction: column;
    font-size: 8px;
    gap: 8px;
  }
  .setup-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  dialog {
    padding: 25px;
  }
  .country-actions button {
    padding: 10px;
  }
  .project p {
    min-height: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.setup-modes {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.setup-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #2c4a46;
  border-radius: 8px;
  cursor: pointer;
}
.setup-mode small {
  grid-column: 2;
  opacity: 0.75;
}
.setup-mode:has(input:checked) {
  border-color: #c9a45c;
  background: rgba(201, 164, 92, 0.08);
}
