:root {
  color-scheme: dark;
  --bg: #0d1115;
  --panel: #171d22;
  --panel-soft: #20272d;
  --line: rgba(224, 210, 179, 0.18);
  --text: #eee8db;
  --muted: #999b96;
  --gold: #c8a763;
  --gold-dark: #806536;
  --red: #7f2f29;
  --glass: rgba(24, 31, 36, .58);
  --glass-strong: rgba(28, 36, 42, .74);
  --glass-line: rgba(255, 255, 255, .18);
  --glass-glow: rgba(214, 231, 255, .16);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
}

button, a { font: inherit; }

button { color: inherit; }

.game-shell, .screen, .strategy-panel, canvas {
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

.game-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.screen { min-height: 0; }

.screen { display: none; }
.screen.active { display: flex; }

.main-screen {
  position: relative;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(30px, 7vw, 100px);
  background:
    linear-gradient(90deg, rgba(7, 10, 12, .97) 0%, rgba(7, 10, 12, .82) 38%, rgba(7, 10, 12, .25) 100%),
    url("assets/menu-background.jpg?v=20261007-181327") center/cover,
    radial-gradient(circle at 75% 35%, #5f5340, #12181c 55%, #090c0e);
}


.backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, .75));
}

.menu { position: relative; width: min(520px, 100%); z-index: 1; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(62px, 9vw, 128px);
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: .72;
  text-transform: uppercase;
  text-shadow: 0 8px 30px #000;
}

.subtitle { margin: 28px 0 36px; color: #c5c0b5; font-size: 19px; }

.menu-actions { display: grid; width: min(330px, 100%); gap: 10px; }

.primary-button, .menu-button {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 16px 36px rgba(0,0,0,.22);
  backdrop-filter: blur(16px) saturate(1.35);
}

.primary-button {
  border-color: #d2b36f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.04)),
    linear-gradient(#b08b47, #755827);
  color: #fff9ea;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-button {
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.035)),
    rgba(18, 23, 27, .62);
  color: var(--text);
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(12px);
}

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

#settingsModal { background: rgba(7, 10, 12, .97); }

.settings-card {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.04)),
    rgba(24, 31, 36, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 28px 80px rgba(0,0,0,.55);
  backdrop-filter: blur(22px) saturate(1.45);
}

.settings-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-card header strong {
  font-size: 22px;
}

.tutorial-modal { z-index: 70; }

.tutorial-card {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
}

.save-modal { z-index: 75; }
.save-card { width: min(820px, 100%); max-height: min(780px, calc(100vh - 44px)); background: linear-gradient(145deg, rgba(15,24,34,.98), rgba(24,35,44,.98)); }
.save-card header { align-items: flex-start; }
.save-slot-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid rgba(200,167,99,.28); border-radius: 12px; background: linear-gradient(135deg, rgba(200,167,99,.13), rgba(54,105,132,.12)); }
.save-slot-editor .primary-button { min-height: 42px; white-space: nowrap; }
.save-slots-list { display: grid; gap: 9px; min-height: 180px; max-height: min(470px, 52vh); overflow-y: auto; padding-right: 5px; }
.save-slot-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 11px 12px; border: 1px solid rgba(150,184,202,.25); border-radius: 11px; background: linear-gradient(105deg, rgba(30,55,70,.78), rgba(16,24,33,.88)); box-shadow: inset 0 1px rgba(255,255,255,.05), 0 8px 16px rgba(0,0,0,.18); transition: border-color .16s ease, transform .16s ease; }
.save-slot-card:hover { border-color: rgba(200,167,99,.65); transform: translateY(-1px); }
.save-slot-card.autosave { border-color: rgba(103,207,185,.42); background: linear-gradient(105deg, rgba(24,77,74,.72), rgba(15,30,37,.9)); }
.save-slot-flag { width: 58px; height: 42px; border: 2px solid rgba(226,198,132,.72); border-radius: 4px; background: linear-gradient(rgba(255,255,255,.12), rgba(0,0,0,.12)), var(--flag), #46596a; background-size: cover; box-shadow: 0 5px 11px rgba(0,0,0,.35); }
.save-slot-copy { display: grid; min-width: 0; gap: 3px; }
.save-slot-copy small { color: #8ed6c2; font: 700 9px Arial,sans-serif; letter-spacing: .1em; }
.save-slot-copy strong { overflow: hidden; color: #f6ead1; font: 700 16px Georgia,serif; text-overflow: ellipsis; white-space: nowrap; }
.save-slot-copy span, .save-slot-copy em { overflow: hidden; color: #a8bbc5; font: 11px Arial,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.save-slot-copy em { color: #718e9d; font-style: normal; }
.save-slot-actions { display: grid; justify-items: end; gap: 5px; }
.save-slot-actions .mini-button { min-width: 104px; }
.save-delete { color: #da9a94; font-size: 11px; }
.save-overwrite { color: #f0cd84; font-size: 11px; }
.save-empty { display: grid; align-content: center; gap: 8px; min-height: 170px; padding: 22px; border: 1px dashed rgba(200,167,99,.28); border-radius: 12px; color: #aebdc4; text-align: center; font: 13px/1.45 Arial,sans-serif; }
.save-empty strong { color: #f1d49a; font: 700 19px Georgia,serif; }
.save-modal-hint { color: #8fa5af; font: 11px/1.4 Arial,sans-serif; }

.tutorial-card header { align-items: flex-start; }
.tutorial-card .eyebrow { margin-bottom: 5px; }

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

.tutorial-progress span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}

.tutorial-progress span.active { background: var(--gold); box-shadow: 0 0 12px rgba(200,167,99,.5); }

.tutorial-content {
  min-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  color: #d6d2c8;
  font: 15px/1.55 Arial, sans-serif;
}

.tutorial-content h3 { margin: 0 0 10px; color: #fff7e5; font: 700 24px Georgia, serif; }
.tutorial-content p { margin: 0 0 12px; }
.tutorial-content ul { display: grid; gap: 8px; margin: 12px 0; padding-left: 20px; }
.tutorial-content strong { color: #f0d596; }
.tutorial-task { padding: 12px; border: 1px solid rgba(200,167,99,.3); border-radius: 12px; background: rgba(200,167,99,.1); color: #fff0c9; }
.tutorial-note { color: var(--muted); font-size: 13px; }

.tutorial-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.tutorial-actions .primary-button, .tutorial-actions .mini-button { min-height: 42px; }
.tutorial-actions .mini-button:empty { display: none; }

@media (max-width: 640px) {
  .tutorial-content { min-height: 190px; }
  .tutorial-actions { grid-template-columns: 1fr 1fr; }
  .tutorial-actions .primary-button { grid-column: span 2; }
}

.settings-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font: 12px Arial, sans-serif;
}

.settings-map-display { gap: 9px; }
.settings-native-select { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.map-display-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.map-display-option { display: grid; justify-items: start; gap: 7px; min-width: 0; min-height: 94px; padding: 10px 12px; border: 1px solid rgba(190, 206, 214, .2); border-radius: 12px; background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018)), rgba(11, 17, 21, .68); color: #dce3e5; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.map-display-option:hover { border-color: rgba(200, 167, 99, .58); transform: translateY(-1px); }
.map-display-option[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(145deg, rgba(200,167,99,.2), rgba(200,167,99,.06)), rgba(28, 29, 25, .82); box-shadow: inset 0 0 0 1px rgba(200,167,99,.2), 0 0 18px rgba(200,167,99,.1); }
.map-display-option strong { color: #f5e7c5; font: 700 13px Georgia, serif; }
.map-display-option small { color: #9aaab1; font: 10px Arial, sans-serif; }
.map-display-preview { display: flex; gap: 3px; width: 42px; height: 17px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; box-shadow: 0 2px 6px #0006; }
.map-display-preview i { flex: 1; background: #58745c; }
.preview-standard i:nth-child(2) { background: #9b7652; }
.preview-standard i:nth-child(3) { background: #506f91; }
.preview-flags i:nth-child(1) { background: linear-gradient(#f4f1e6 0 33%, #426b9a 33% 66%, #c44a42 66%); }
.preview-flags i:nth-child(2) { background: linear-gradient(#eee 0 50%, #bc3e42 50%); }
.preview-flags i:nth-child(3) { background: linear-gradient(90deg, #315c9a 0 35%, #f5f0da 35% 65%, #c74a40 65%); }

.settings-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.settings-actions .primary-button,
.settings-actions .mini-button {
  width: 100%;
  min-height: 42px;
}

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

footer {
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: rgba(255, 255, 255, .42);
  font: 12px Arial, sans-serif;
}

.setup-screen {
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 18% 5%, rgba(200, 167, 99, .12), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(88, 135, 165, .18), transparent 34%),
    linear-gradient(135deg, #0b1115, #10171b 48%, #0b1013);
}

.play-screen {
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #0d1215;
}

.game-topbar {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 68px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    rgba(18, 24, 28, .72);
  backdrop-filter: blur(18px) saturate(1.35);
}

.game-topbar > div:nth-child(2) {
  display: grid;
  gap: 3px;
  text-align: center;
}

.game-topbar span {
  color: var(--muted);
  font: 12px Arial, sans-serif;
}

.game-controls {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.time-controls,
.game-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-controls button,
.game-zoom button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.035)),
    rgba(23, 29, 34, .64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.time-controls button {
  width: auto;
  min-width: 38px;
  padding: 0 10px;
  font: 12px Arial, sans-serif;
}

.time-controls button.active,
.time-controls button:hover,
.game-zoom button:hover {
  border-color: var(--gold);
  background: #29271e;
}

.strategy-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.strategy-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 0%, rgba(214, 231, 255, .14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(13, 19, 23, .62);
  backdrop-filter: blur(22px) saturate(1.35);
  overflow: hidden;
}

.state-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), transparent 44%),
    linear-gradient(180deg, rgba(200, 167, 99, .08), rgba(255,255,255,.02)),
    rgba(17, 24, 29, .58);
}

.state-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: start;
  gap: 10px;
}

.state-title-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.state-title strong { font-size: 18px; }
.state-title span, .turn-controls span { color: var(--muted); font: 12px Arial, sans-serif; }

.state-flag {
  display: block;
  width: 132px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  box-shadow: 0 5px 14px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.16);
}

.state-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 16 / 9;
  object-position: center;
}

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

.resource-pill {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(224, 210, 179, .12);
  background: rgba(255,255,255,.035);
  font-family: Arial, sans-serif;
}

.resource-pill small { color: var(--muted); font-size: 10px; }
.resource-pill strong { color: #fff6df; font-size: 14px; }

.state-summary .resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.selected-region-summary {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(255,255,255,.035);
}

.selected-region-summary strong {
  font-size: 15px;
}

.selected-region-summary small {
  color: var(--muted);
  font: 12px Arial, sans-serif;
}

.strategy-tabs {
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.strategy-tabs button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid rgba(224, 210, 179, .12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)),
    rgba(21, 28, 33, .5);
  color: #c9c3b6;
  cursor: pointer;
  text-align: left;
  font: 12px Arial, sans-serif;
}

.strategy-tabs button:last-child { border-bottom: 0; }
.strategy-tabs button.active {
  background:
    linear-gradient(135deg, rgba(255,255,255,.2), rgba(200,167,99,.18) 45%, rgba(255,255,255,.04)),
    rgba(37, 35, 27, .68);
  color: #fff1bf;
  box-shadow: inset 3px 0 0 rgba(227, 193, 116, .85), inset 0 1px 0 rgba(255,255,255,.22);
}

.strategy-main {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.turn-indicator {
  padding: 9px 12px;
  border: 1px solid rgba(227, 193, 116, .52);
  border-radius: 10px;
  color: #fff0bd;
  background: rgba(64, 53, 25, .55);
  font: 700 12px Arial, sans-serif;
  letter-spacing: .02em;
}

.panel-fullscreen-button {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 8;
  width: 38px;
  height: 38px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.05)),
    rgba(18, 24, 28, .78);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 24px rgba(0,0,0,.28);
  cursor: pointer;
  font: 22px/1 Arial, sans-serif;
  backdrop-filter: blur(14px);
}

.panel-fullscreen-button:hover,
.panel-fullscreen-button.active {
  border-color: var(--gold);
  color: #fff1bf;
  background:
    linear-gradient(135deg, rgba(255,255,255,.2), rgba(200,167,99,.2)),
    rgba(37, 35, 27, .82);
}

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

.strategy-content {
  position: fixed;
  z-index: 30;
  top: 86px;
  right: 18px;
  bottom: 18px;
  left: 318px;
  min-height: 0;
  max-width: 1280px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.045) 42%, rgba(255,255,255,.08)),
    var(--glass);
  box-shadow:
    0 24px 70px rgba(0,0,0,.48),
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(22px) saturate(1.45);
}

.strategy-panel-fullscreen .strategy-layout {
  grid-template-columns: minmax(0, 1fr);
}

.strategy-panel-fullscreen .strategy-panel {
  display: none;
}

.strategy-panel-fullscreen .strategy-main {
  grid-column: 1 / -1;
}

.strategy-panel-fullscreen .strategy-content {
  top: 86px;
  right: 18px;
  bottom: 18px;
  left: 18px;
  max-width: none;
}

.strategy-panel-fullscreen .panel-fullscreen-button {
  top: 26px;
  right: 26px;
}

.play-screen .panel-fullscreen-button {
  position: fixed;
  z-index: 31;
  top: 94px;
  right: 26px;
}

.relation-map-active .strategy-panel,
.relation-map-active .strategy-content,
.relation-map-active .panel-fullscreen-button {
  display: none;
}

.relation-map-active .strategy-main {
  grid-column: 1 / -1;
}

.relation-map-back {
  position: fixed;
  top: 86px;
  left: 22px;
  z-index: 42;
  padding: 11px 14px;
  border: 1px solid rgba(224, 210, 179, .36);
  border-radius: 8px;
  background: rgba(23, 25, 28, .94);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
  font: 700 13px Arial, sans-serif;
  cursor: pointer;
}

.relation-map-back:hover {
  border-color: var(--gold);
  background: rgba(42, 38, 28, .96);
}

.relation-map-back[hidden] {
  display: none;
}

.strategy-content.hidden {
  display: none;
}

.tab-section {
  display: grid;
  gap: 12px;
}

.tab-section h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
}

.focus-section {
  min-width: max-content;
}

.focus-tree {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--focus-columns), var(--focus-cell-width));
  grid-template-rows: repeat(var(--focus-rows), var(--focus-cell-height));
  gap: var(--focus-row-gap) var(--focus-column-gap);
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(224, 210, 179, .1);
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #081014;
  background-size: 40px 40px;
}

.focus-tree::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  opacity: .4;
  background:
    linear-gradient(90deg, transparent 49%, rgba(200,167,99,.22) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(200,167,99,.14) 50%, transparent 51%);
  background-size: calc(100% / var(--focus-columns)) calc(100% / var(--focus-rows));
}

.focus-links {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.focus-links path {
  fill: none;
  stroke: rgba(227, 193, 116, .46);
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 5px rgba(0,0,0,.55));
}

.focus-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 7px minmax(0, 1fr) auto auto;
  width: var(--focus-cell-width);
  height: var(--focus-cell-height);
  padding: 12px;
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    #182027;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 30px rgba(0,0,0,.36);
  backdrop-filter: none;
}

.focus-card.active-focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(200, 167, 99, .55), 0 10px 26px rgba(0,0,0,.32);
}

.focus-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.focus-card strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.focus-card header small {
  white-space: nowrap;
  text-align: right;
  font-size: 11px;
}

.focus-card p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 12px;
}

.focus-card > small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.focus-card .mini-button {
  width: 100%;
  min-height: 32px;
  align-self: end;
}

.strategy-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.04)),
    rgba(23, 29, 34, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}

.strategy-card.accent-card {
  border-color: rgba(227, 193, 116, .38);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(135deg, rgba(200, 167, 99, .18), rgba(255,255,255,.055));
}

.strategy-card.done { border-color: rgba(116, 167, 104, .55); }
.strategy-card.locked { opacity: .55; }

.strategy-card.focus-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    #182027;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 30px rgba(0,0,0,.36);
  backdrop-filter: none;
}

.strategy-card.focus-card.locked {
  opacity: 1;
  filter: saturate(.72) brightness(.86);
}

.strategy-card.focus-card.done {
  background:
    linear-gradient(145deg, rgba(116,167,104,.16), rgba(255,255,255,.025)),
    #17241d;
}

.strategy-card.focus-card.expanded-focus-source {
  border-color: rgba(227, 193, 116, .72);
  box-shadow: 0 0 0 2px rgba(227, 193, 116, .24), 0 14px 30px rgba(0,0,0,.42);
}

.focus-expanded-card {
  position: sticky;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  grid-column: 1 / -1;
  justify-self: start;
  align-self: end;
  width: min(620px, calc(100vw - 76px));
  max-height: min(420px, calc(100vh - 170px));
  overflow: auto;
  padding: 16px 44px 16px 16px;
  border-color: rgba(227, 193, 116, .46);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.035)),
    #151d22;
  box-shadow: 0 22px 48px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: none;
}

.strategy-card.focus-expanded-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.strategy-card.focus-expanded-card strong {
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.strategy-card.focus-expanded-card p {
  color: #ddd5c8;
  font: 14px/1.55 Arial, sans-serif;
  white-space: pre-line;
}

.focus-expanded-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  font: 20px/1 Arial, sans-serif;
}

.strategy-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.strategy-card strong { font-size: 17px; }
.strategy-card p { margin: 0; color: #c9c3b6; font: 13px/1.42 Arial, sans-serif; }
.strategy-card small { color: var(--muted); font: 12px Arial, sans-serif; }

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

.organization-card-header {
  align-items: center;
}

.organization-card-header strong {
  min-width: 0;
  margin-right: auto;
}

.organization-emblem {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 3px 10px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.18);
}

.organization-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.organization-emblem-placeholder {
  color: #e3c174;
  font: 700 11px/1 Arial, sans-serif;
  letter-spacing: .08em;
  text-shadow: 0 1px 1px rgba(0,0,0,.55);
}

.map-mode-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-mode-grid .mini-button {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 58px;
  padding: 8px;
  text-align: left;
}

.map-mode-grid .mini-button strong {
  font: 700 12px Arial, sans-serif;
}

.map-mode-grid .mini-button small {
  color: var(--muted);
  font: 11px/1.25 Arial, sans-serif;
}

.map-mode-grid .mini-button.active {
  border-color: var(--gold);
  color: #fff1bf;
  background:
    linear-gradient(135deg, rgba(255,255,255,.2), rgba(200,167,99,.2)),
    rgba(37, 35, 27, .82);
}

.strategy-card.focus-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.strategy-card.focus-card strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.strategy-card.focus-card header small {
  white-space: nowrap;
  text-align: right;
  font-size: 11px;
}

.strategy-card.focus-card p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font: 12px/1.35 Arial, sans-serif;
}

.strategy-card.focus-card > small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-button,
.danger-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.04)),
    rgba(34, 42, 47, .58);
  color: var(--text);
  cursor: pointer;
  font: 12px Arial, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
}

.danger-button {
  border-color: rgba(173, 69, 57, .8);
  background: #4d201c;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.inline-actions .mini-button {
  width: 42px;
  padding: 0;
  font-size: 18px;
}

.map-country-actions,
.campaign-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.campaign-goals {
  padding-top: 8px;
  border-top: 1px solid rgba(224, 210, 179, .12);
}

.campaign-goals strong {
  width: 100%;
  font-size: 12px;
}

.peace-actions {
  flex-wrap: wrap;
}

.peace-actions .mini-button {
  width: auto;
  min-width: 154px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 12px;
}

.treaty-actions .mini-button {
  width: auto;
  min-width: 74px;
  padding: 0 10px;
  font-size: 12px;
}

.progress-bar {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(224, 210, 179, .12);
  background: #0c1114;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b48a3e, #e3c174);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
  gap: 8px;
}

.law-row,
.advisor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(224, 210, 179, .1);
  background: rgba(255,255,255,.025);
}

.law-row {
  grid-template-columns: 82px minmax(0, 1fr) auto;
}

.advisor-row span {
  display: grid;
  gap: 3px;
}

.formable-row {
  align-items: start;
}

.status-ok {
  color: #8ee0a0 !important;
}

.status-bad {
  color: #f1a287 !important;
}

.peace-region-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(224, 210, 179, .12);
  border-radius: 12px;
  background: rgba(0,0,0,.14);
}

.peace-region-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  font: 12px Arial, sans-serif;
}

.peace-region-option span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.strategy-select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.025)),
    rgba(15, 21, 24, .68);
  color: var(--text);
  font: 13px Arial, sans-serif;
  backdrop-filter: blur(10px);
}

.game-native-select { display: none !important; }
.game-select-control { display: block; width: 100%; min-width: 0; }
.game-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-width: 0; min-height: 42px; padding: 8px 12px; border: 1px solid rgba(190, 206, 214, .24); border-radius: 11px; background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.025)), rgba(13, 20, 24, .86); color: #e5e8e5; font: 13px/1.25 Arial, sans-serif; text-align: left; box-shadow: inset 0 1px rgba(255,255,255,.08), 0 5px 13px rgba(0,0,0,.16); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.game-select-trigger:hover, .game-select-control.is-open .game-select-trigger { border-color: rgba(200, 167, 99, .82); background: linear-gradient(180deg, rgba(200,167,99,.14), rgba(255,255,255,.025)), rgba(18, 24, 27, .94); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 0 16px rgba(200,167,99,.1); }
.game-select-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.game-select-trigger:disabled { opacity: .48; cursor: not-allowed; }
.game-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-select-chevron { flex: 0 0 auto; width: 8px; height: 8px; border-right: 1.5px solid #d9c38f; border-bottom: 1.5px solid #d9c38f; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.game-select-control.is-open .game-select-chevron { transform: rotate(225deg) translate(-1px, -1px); }
.game-select-menu { position: fixed; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 7px; padding: 8px; overflow: hidden; border: 1px solid rgba(200,167,99,.62); border-radius: 14px; background: radial-gradient(circle at 12% 0%, rgba(255,255,255,.1), transparent 36%), linear-gradient(145deg, rgba(27,35,40,.98), rgba(12,18,22,.985)); color: #e8e6df; box-shadow: inset 0 1px rgba(255,255,255,.1), 0 18px 54px rgba(0,0,0,.66), 0 0 22px rgba(200,167,99,.1); backdrop-filter: blur(20px) saturate(1.25); }
.game-select-search { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid rgba(190,206,214,.2); border-radius: 9px; outline: 0; background: rgba(5,10,13,.66); color: #f1eee5; font: 13px Arial,sans-serif; }
.game-select-search:focus { border-color: rgba(200,167,99,.78); box-shadow: 0 0 0 2px rgba(200,167,99,.12); }
.game-select-options { display: grid; align-content: start; gap: 5px; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: rgba(200,167,99,.6) rgba(255,255,255,.06); }
.game-select-menu-cards .game-select-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.game-select-option { display: flex; align-items: center; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid rgba(190,206,214,.13); border-radius: 9px; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.015)), rgba(8,14,18,.62); color: #d8e0e1; font: 12px/1.3 Arial,sans-serif; text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: border-color .14s ease, background .14s ease, color .14s ease, transform .14s ease; }
.game-select-menu-cards .game-select-option { min-height: 52px; padding: 9px 10px; border-radius: 10px; }
.game-select-option:hover, .game-select-option:focus-visible { border-color: rgba(200,167,99,.64); outline: 0; background: rgba(200,167,99,.12); color: #fff3d4; }
.game-select-option[aria-selected="true"] { border-color: rgba(200,167,99,.72); background: linear-gradient(120deg, rgba(200,167,99,.2), rgba(200,167,99,.055)); color: #ffe7ae; box-shadow: inset 0 0 0 1px rgba(200,167,99,.1); }
.game-select-option:disabled { opacity: .38; cursor: not-allowed; }
.game-select-empty { margin: 0; padding: 12px 8px; color: #91a0a7; font: 12px Arial,sans-serif; text-align: center; }

.event-log {
  display: grid;
  gap: 7px;
}

.event-log-item {
  padding: 9px 10px;
  border: 0;
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: #d5d0c4;
  cursor: pointer;
  text-align: left;
  font: 12px/1.4 Arial, sans-serif;
}

.peace-screen {
  min-height: 100vh;
  flex-direction: column;
  overflow: auto;
  background: radial-gradient(circle at 50% -20%, #7a5d36 0, #27201b 33%, #101417 76%);
}
.peace-screen { background: linear-gradient(180deg, rgba(4,8,13,.18), rgba(4,8,13,.74)), url("assets/versailles-conference-background.png?v=20261007-181327") center/cover fixed; }
.peace-screen::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 30%, transparent 20%, rgba(3,7,11,.22) 68%, rgba(2,5,8,.68)); z-index: 0; }
.peace-screen > * { position: relative; z-index: 1; }
.peace-screen .peace-3d-canvas,
.peace-screen .peace-hall,
.peace-screen .peace-backdrop-details { display: none !important; }
.peace-screen:has(.peace-hall) .peace-content { min-height: 100vh; height: 100vh; display: grid; place-items: center; padding: 74px 0 18px; }
.peace-screen:has(.peace-hall) .peace-workspace { position: fixed; z-index: 7; left: 50%; top: 50%; bottom: auto; width: min(980px, 92vw); max-height: calc(100vh - 96px); margin: 0; transform: translate(-50%, -50%) !important; }
@media (max-width: 760px) { .peace-screen:has(.peace-hall) .peace-workspace { width: 94vw; top: calc(50% + 22px); max-height: calc(100vh - 80px); } }

.peace-topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px clamp(20px, 5vw, 70px);
  border-bottom: 1px solid rgba(224, 210, 179, .2);
  background: rgba(8, 10, 12, .45);
}

.peace-topbar h2 { margin: 0; font-size: clamp(26px, 3vw, 42px); font-weight: 500; }
.peace-topbar .eyebrow { margin-bottom: 4px; }
.peace-content { width: min(1280px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 48px); }

/* The conference is a first-person scene: the hall fills the viewport and the papers sit on the table in front of the player. */
.peace-screen:has(.peace-hall) { position: relative; overflow: hidden; perspective: 1400px; perspective-origin: 50% 42%; }
.peace-3d-canvas { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: none; background: linear-gradient(180deg, #d9e1e2, #b89b78 58%, #68472f); cursor: grab; touch-action: none; }
.peace-3d-canvas.camera-dragging { cursor: grabbing; }
.peace-webgl-active .peace-3d-canvas { display: block; }
.peace-webgl-active .peace-hall { visibility: hidden; }
.peace-webgl-active .peace-backdrop-details { display: none; }
.peace-webgl-active .peace-content { position: relative; z-index: 1; }
.peace-screen:has(.peace-hall) .peace-topbar { position: absolute; z-index: 8; inset: 0 0 auto; width: 100%; background: linear-gradient(180deg, rgba(6,8,10,.86), transparent); border-bottom: 0; }
.peace-screen:has(.peace-hall) .peace-content { width: 100%; height: 100vh; padding: 0; transform-style: preserve-3d; }
.peace-screen:has(.peace-hall) .peace-hall { min-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
.peace-screen:has(.peace-hall) .peace-workspace { position: absolute; z-index: 7; left: 50%; bottom: 1.5vh; width: min(980px, 90vw); max-height: 76vh; transform: translateX(-50%); overflow: visible; padding: 0; }

.peace-hall {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(233, 205, 144, .34);
  border-radius: 22px 22px 4px 4px;
  background: linear-gradient(180deg, rgba(229, 190, 110, .19), rgba(27, 24, 21, .95) 72%);
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 24px 55px rgba(0,0,0,.32);
  transform-style: preserve-3d;
  isolation: isolate;
}

.peace-hall::before { content: ""; position: absolute; inset: 0; opacity: .54; background: radial-gradient(ellipse at 50% 4%, rgba(255,231,170,.3), transparent 42%), linear-gradient(180deg, rgba(7,10,15,.08), rgba(7,10,15,.72)), repeating-linear-gradient(90deg, transparent 0 13%, rgba(247,218,153,.14) 13.2% 14%, transparent 14.2% 26%); transform: translateZ(-80px) scale(1.08); transform-origin: center top; }
.peace-hall::after { content: ""; position: absolute; z-index: 3; left: 50%; bottom: -22px; width: 310px; height: 120px; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, #c98b5a 0 18%, #4b2d23 19% 31%, transparent 32%), linear-gradient(110deg, transparent 42%, rgba(203,143,91,.85) 43% 52%, transparent 53%), linear-gradient(70deg, transparent 42%, rgba(203,143,91,.85) 43% 52%, transparent 53%); filter: drop-shadow(0 -5px 10px rgba(0,0,0,.5)); pointer-events: none; }
.peace-backdrop-details { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.versailles-window-row, .versailles-mirror-row { position: absolute; top: 21%; height: 43%; display: flex; justify-content: space-between; gap: 1.1%; }
.versailles-window-row { left: 5%; right: 53%; }.versailles-mirror-row { left: 53%; right: 5%; }
.versailles-window, .versailles-mirror { position: relative; flex: 1; border: 7px solid #b28a48; border-bottom-width: 13px; border-radius: 54px 54px 5px 5px; box-shadow: inset 0 0 22px rgba(0,0,0,.32), 0 8px 16px rgba(0,0,0,.35); }
.versailles-window { background: linear-gradient(180deg, #9ed5ed 0 52%, #709c78 53% 73%, #c7b378 74%); }
.versailles-window::after { content: ""; position: absolute; inset: 0 48%; background: rgba(255,255,255,.45); box-shadow: -34px 0 rgba(255,255,255,.18), 34px 0 rgba(255,255,255,.18); }
.versailles-mirror-row { transform: translateY(8px) scaleX(.98); opacity: .94; }
.versailles-mirror { background: radial-gradient(ellipse at 50% 22%, rgba(255,255,255,.75), transparent 18%), linear-gradient(145deg, #b8d3d8, #648895 46%, #c8e0df 70%, #49626b); }
.versailles-mirror::after { content: ""; position: absolute; inset: 15% 10%; border: 2px solid rgba(255,255,255,.35); border-radius: 50%; }
.versailles-chandelier-row { position: absolute; top: 8%; left: 13%; right: 13%; display: flex; justify-content: space-between; }
.versailles-chandelier-row span { position: relative; width: 16px; height: 45px; background: #c9a653; box-shadow: 0 0 16px 5px rgba(255,219,123,.5); }
.versailles-chandelier-row span::before { content: ""; position: absolute; top: 35px; left: -16px; width: 48px; height: 16px; border-radius: 50%; background: #efc566; box-shadow: 0 0 28px 9px rgba(255,203,83,.42); }
.hall-flag { position: absolute; top: 16%; width: 180px; height: 116px; border: 7px solid #5c3b22; border-radius: 4px; background: linear-gradient(180deg, rgba(255,255,255,.12), transparent), var(--flag); background-size: 100% 100%; box-shadow: 0 16px 22px rgba(0,0,0,.48), inset 0 0 20px rgba(0,0,0,.25); transform: perspective(500px) rotateY(12deg); }
.hall-flag::before { content: ""; position: absolute; inset: -15px 50% auto; width: 2px; height: 15px; background: #b58a4f; box-shadow: 0 -2px 0 #e1c581; }.hall-flag span { position: absolute; bottom: -28px; left: 0; right: 0; color: #e7d5af; text-align: center; font: 700 10px Arial,sans-serif; text-shadow: 0 2px 4px #000; }.hall-flag-left { left: 8%; }.hall-flag-right { right: 8%; transform: perspective(500px) rotateY(-12deg); }
.hall-chandelier { position: absolute; top: 5%; left: 50%; color: #ffe7a5; font-size: 42px; text-shadow: 0 0 24px #ffd978, 0 10px 30px rgba(255,191,76,.45); transform: translateX(-50%); }.hall-clock { position: absolute; top: 12%; left: 50%; padding: 5px 12px; border: 1px solid rgba(214,178,105,.5); border-radius: 20px; background: rgba(8,12,18,.68); color: #e8cf97; font: 11px Arial,sans-serif; transform: translateX(-50%); }
.hall-panel { position: absolute; top: 34%; width: 15%; height: 27%; border: 2px solid rgba(190,153,87,.35); background: linear-gradient(135deg, rgba(103,75,39,.4), rgba(12,20,28,.45)); box-shadow: inset 0 0 28px rgba(0,0,0,.5), 0 15px 24px rgba(0,0,0,.28); }.hall-panel-left { left: 28%; transform: perspective(500px) rotateY(13deg); }.hall-panel-right { right: 28%; transform: perspective(500px) rotateY(-13deg); }
.hall-lamp { position: absolute; top: 23%; width: 7px; height: 85px; background: #987543; box-shadow: 0 0 12px #ffd471; }.hall-lamp::after { content: ""; position: absolute; top: 72px; left: -17px; width: 40px; height: 22px; border-radius: 50%; background: #e3ad51; box-shadow: 0 0 32px 12px rgba(239,170,66,.28); }.hall-lamp-left { left: 22%; }.hall-lamp-right { right: 22%; }
.hall-plant { position: absolute; bottom: 20%; width: 42px; height: 105px; border-radius: 50% 50% 12% 12%; background: linear-gradient(90deg, transparent 44%, #704b2d 45% 54%, transparent 55%), radial-gradient(ellipse at 20% 36%, #3e855d 0 24%, transparent 25%), radial-gradient(ellipse at 78% 26%, #5c9a6c 0 25%, transparent 26%), radial-gradient(ellipse at 26% 62%, #356d4f 0 24%, transparent 25%), radial-gradient(ellipse at 76% 57%, #4f8b62 0 25%, transparent 26%); filter: drop-shadow(0 10px 10px rgba(0,0,0,.5)); opacity: .82; }.hall-plant-left { left: 4%; }.hall-plant-right { right: 4%; transform: scaleX(-1); }
.hall-flag { z-index: 3; }.hall-panel { z-index: 1; }
.peace-delegates { position: absolute; inset: 13% 3% auto; height: 42%; display: flex; justify-content: space-around; align-items: start; transform-style: preserve-3d; }
.delegate { position: relative; z-index: 1; display: grid; justify-items: center; width: 110px; color: #f5e5bd; text-align: center; animation: delegate-arrive .45s both; animation-delay: var(--delay); }
.delegate { transform: translateZ(90px); filter: drop-shadow(0 18px 12px rgba(0,0,0,.34)); }
.delegate:nth-child(2n) { transform: translateZ(145px) scale(1.05); }
.delegate:nth-child(3n) { transform: translateZ(55px) scale(.94); }
.delegate-head { width: 40px; height: 46px; border-radius: 48% 48% 45% 45%; background: linear-gradient(100deg, #4c2c20 0 20%, #d49a72 22% 77%, #72442d 79%); box-shadow: 0 0 0 4px #202126; }
.delegate-body { position: relative; width: 104px; height: 154px; margin-top: -2px; border: 4px solid #17191e; border-radius: 33px 33px 7px 7px; background: linear-gradient(90deg, #18202b, #344052 45%, #151b24); box-shadow: inset 0 0 25px rgba(0,0,0,.38), 0 10px 18px rgba(0,0,0,.32); }
.delegate-lapel { position: absolute; left: 8px; top: 3px; width: 82px; height: 66px; clip-path: polygon(0 0, 45% 34%, 50% 100%, 0 66%, 100% 66%, 55% 100%, 50% 34%, 100% 0); background: linear-gradient(90deg, #b9c4d0 0 7%, transparent 8% 92%, #b9c4d0 93%); opacity: .8; }
.delegate-territory { position: absolute; left: 16px; top: 24px; width: 43px; height: 52px; clip-path: polygon(18% 0, 72% 8%, 100% 34%, 75% 47%, 84% 78%, 48% 100%, 22% 76%, 0 52%, 13% 29%); background: var(--flag); background-size: 100% 100%; border: 2px solid rgba(255,255,255,.82); box-shadow: 0 0 0 2px rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.35); }
.delegate small { margin-top: 7px; font: 700 11px Arial, sans-serif; text-shadow: 0 1px 3px #000; }
.delegate-speech { position: absolute; top: -42px; z-index: 4; width: 190px; padding: 8px 11px; border: 1px solid rgba(67,52,33,.45); border-radius: 14px; background: #fff7dc; color: #423421; font: 700 11px/1.25 Arial,sans-serif; box-shadow: 0 4px 12px rgba(0,0,0,.32); }
.delegate-speech::after { content: ""; position: absolute; left: 50%; bottom: -9px; border: 9px solid transparent; border-top-color: #fff7dc; border-bottom: 0; transform: translateX(-50%); }
.mediator-delegate { transform: translateZ(125px) scale(1.08); filter: drop-shadow(0 0 12px rgba(241,208,126,.38)); }
.mediator-delegate .delegate-territory { background: linear-gradient(135deg, #597ca5 0 34%, #f0d37b 35% 67%, #9a4f4a 68%); }
.player-delegate { display: grid; }
.player-delegate .delegate-body { box-shadow: 0 0 0 2px var(--gold), inset 0 0 25px rgba(0,0,0,.38); }
.peace-table { position: absolute; z-index: 2; bottom: -18%; left: 50%; width: 92%; height: 58%; transform: translateX(-50%) translateZ(10px) perspective(500px) rotateX(55deg); border: 13px solid #4a2719; border-radius: 50% 50% 14% 14%; background: repeating-linear-gradient(8deg, rgba(255,255,255,.04) 0 3px, transparent 3px 14px), radial-gradient(ellipse at 50% 18%, #c58443, #71421f 70%, #321b12); box-shadow: 0 -12px 32px rgba(0,0,0,.58), inset 0 5px 25px rgba(255,225,153,.24), 0 40px 60px rgba(0,0,0,.52); text-align: center; transform-style: preserve-3d; }
.peace-table span { display: inline-block; margin-top: 30px; color: #f0d99f; font: 700 12px Arial, sans-serif; letter-spacing: .3em; }
.peace-delegates { justify-content: space-between; align-items: end; padding: 0 9%; }
.delegation-side { position: relative; z-index: 3; display: flex; width: 34%; justify-content: center; }
.delegation-player { align-self: end; transform: translateY(50px); }
.delegation-opponent { align-self: start; transform: translateY(-12px) scale(.9); }
.delegation-player .delegate { transform: translateZ(180px) scale(1.14); }
.delegation-opponent .delegate { transform: translateZ(80px) scale(.96); }
.player-delegate .delegate-body { background: linear-gradient(90deg, #101c30, #244c7a 45%, #0c1727); box-shadow: 0 0 0 2px #d9b46c, inset 0 0 25px rgba(0,0,0,.38); }
.opponent-delegate .delegate-body { background: linear-gradient(90deg, #33151b, #74323c 45%, #251118); box-shadow: 0 0 0 2px #c69a64, inset 0 0 25px rgba(0,0,0,.38); }
.delegate em { margin-top: 3px; color: #dcbf82; font: 700 9px Arial,sans-serif; font-style: normal; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 3px #000; }
.peace-delegates > .mediator-delegate { position: absolute; left: 50%; top: 2%; transform: translateX(-50%) translateZ(125px) scale(.84); }
.peace-help { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid rgba(117,194,216,.35); border-left: 4px solid #67cddd; border-radius: 8px; background: rgba(13,42,57,.74); color: #c6e4eb; font: 11px/1.35 Arial,sans-serif; }
.peace-help strong { color: #78dcec; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.interface-hint { margin: 10px 0 0; padding: 9px 11px; border: 1px solid rgba(200,167,99,.28); border-left: 3px solid var(--gold); border-radius: 8px; background: rgba(26,35,48,.58); color: #dce8ef; font: 11px/1.4 Arial,sans-serif; }
.interface-hint strong { display: block; margin-bottom: 3px; color: #f2ce84; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.peace-workspace { display: block; margin-top: 18px; }
.peace-paper { position: relative; display: grid; align-content: start; gap: 12px; padding: clamp(16px, 2.5vw, 28px); border: 1px solid rgba(229, 209, 166, .7); border-radius: 3px 5px 2px 4px; background: linear-gradient(135deg, rgba(255,249,224,.98), rgba(221,202,157,.98)); color: #312b23; box-shadow: 0 14px 25px rgba(0,0,0,.48), inset 0 0 35px rgba(126,88,37,.12); }
.peace-document { transform: rotateX(7deg); transform-origin: 50% 100%; box-shadow: 0 22px 18px rgba(42,22,10,.48), 0 2px 0 #b89b68, inset 0 0 35px rgba(126,88,37,.12); }
.peace-document::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(111,76,35,.28); pointer-events: none; }
.peace-document::after { content: ""; position: absolute; inset: 104px 22px 18px; background: repeating-linear-gradient(180deg, transparent 0 30px, rgba(111,76,35,.11) 31px 32px); opacity: .45; pointer-events: none; mix-blend-mode: multiply; }
.peace-document > * { position: relative; z-index: 1; }
.peace-laptop { min-height: 430px; max-height: 76vh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 18px; border: 2px solid #66788a; border-radius: 20px 20px 30px 30px; background: linear-gradient(145deg, #1d2b3b, #080e17 55%, #263544); color: #dbe8f0; box-shadow: 0 30px 24px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.28), inset 0 -14px 30px rgba(0,0,0,.52); transform: none; }
.laptop-statusbar { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; margin: -2px -4px 14px; padding: 7px 10px; border: 1px solid rgba(111,214,234,.22); border-radius: 6px; background: rgba(4,12,20,.72); color: #8fb8c5; font: 10px/1.2 Arial,sans-serif; letter-spacing: .08em; }
.laptop-statusbar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.laptop-status-online { color: #83e0b3; }.laptop-status-online i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #62d998; box-shadow: 0 0 8px #62d998; }
.laptop-parties { position: relative; z-index: 2; display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; padding: 9px 11px; border: 1px solid rgba(111,214,234,.2); border-radius: 8px; background: rgba(7,20,31,.64); color: #a6c5cf; font: 11px/1.3 Arial,sans-serif; }
.laptop-parties b { display: block; margin-bottom: 3px; color: #66c9dc; font-size: 9px; letter-spacing: .12em; }
.peace-laptop::after { content: ""; position: absolute; z-index: 0; left: 8%; right: 8%; bottom: 14px; height: 30%; border: 1px solid #4a5868; border-radius: 9px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.09) 0 8px, transparent 8px 17px), repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 7px, transparent 7px 15px), #101722; box-shadow: inset 0 3px 12px #000, 0 2px 0 #080b10; opacity: .72; }
.laptop-screen-glow { position: absolute; z-index: 0; inset: 10px 12px 46%; border: 6px solid #0a1018; border-radius: 9px; background: radial-gradient(circle at 50% 30%, rgba(73,203,226,.18), transparent 55%), linear-gradient(145deg, #102d3e, #07111c 72%); box-shadow: inset 0 0 35px rgba(34,190,219,.18), 0 0 0 1px #607286; }
.peace-laptop header, .peace-laptop .peace-field, .peace-laptop .scheduled-note, .peace-laptop .peace-terms, .peace-laptop .peace-offer-row, .peace-laptop .peace-region-list, .peace-laptop > button { z-index: 2; }
.peace-laptop header { border-color: rgba(117,194,216,.35); }.peace-laptop .eyebrow { color: #6fd5e8; }.peace-laptop header small { color: #a4c1ca; }.peace-laptop .peace-title { color: #e7fbff; border-color: rgba(111,214,234,.6); text-shadow: 0 0 12px rgba(68,202,229,.3); }
.peace-laptop .strategy-select, .peace-laptop .peace-region-list { border-color: #4d6675; background: rgba(8,18,28,.86); color: #dbeef3; }.peace-laptop .peace-region-option { border-color: #354c59; background: rgba(36,78,91,.3); color: #dbeef3; }.peace-laptop .peace-terms { max-height: 82px; overflow: auto; }.peace-laptop .peace-term { background: rgba(11,27,37,.74); border-left-color: #46bdd1; padding: 6px 8px; }.peace-laptop .peace-term small { color: #83b8c2; }.peace-laptop .peace-term strong { color: #e1f2f3; }.peace-laptop .speech-bubble { background: #d9f6f4; color: #173237; }.peace-laptop .peace-seal { border-color: #71d7e9; color: #71d7e9; text-shadow: 0 0 10px #42b9d0; }
.peace-laptop.peace-document::after { display: none; }
.peace-laptop .peace-region-list { max-height: 105px; overflow-y: auto; }
.peace-title { width: min(600px, 100%); border: 0; border-bottom: 2px solid rgba(87,62,30,.45); background: transparent; color: #3b2b1b; font: 500 clamp(23px, 3vw, 38px) Georgia,serif; outline: none; }
.peace-seal { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid #a34732; border-radius: 50%; color: #a34732; font-size: 26px; transform: rotate(-12deg); }
.peace-offer-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.peace-laptop .peace-offer-row .mini-button { min-height: 38px; white-space: normal; }
.peace-laptop > .primary-button { position: sticky; bottom: 0; z-index: 4; width: 100%; min-height: 44px; margin-top: 10px; box-shadow: 0 -8px 18px rgba(5,12,20,.9); }
.peace-laptop .peace-help { padding: 8px 10px; border: 1px solid rgba(111,214,234,.2); border-radius: 8px; background: rgba(7,20,31,.5); font-size: 11px; line-height: 1.35; }
.peace-laptop-map { display: grid; gap: 7px; margin: 10px 0; padding: 10px; border: 1px solid rgba(111,214,234,.38); border-radius: 9px; background: rgba(4,14,24,.82); }
.peace-laptop-map header { display: flex; align-items: center; justify-content: space-between; border: 0; padding: 0; font-size: 12px; }
#peaceAllocationMap { display: block; width: 100%; max-height: 300px; object-fit: contain; cursor: crosshair; border: 1px solid #557180; background: #102534; image-rendering: auto; }
.peace-laptop-map small { color: #a8c6cf; font: 11px/1.35 Arial,sans-serif; }
.peace-paper header { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(79,57,33,.28); padding-bottom: 10px; }
.peace-paper h3 { margin: 0; font-size: 24px; font-weight: 500; }.peace-paper .eyebrow { color: #876629; margin-bottom: 5px; }.peace-paper header small { max-width: 170px; color: #665b4a; font: 11px/1.35 Arial,sans-serif; }.peace-field { display: grid; gap: 5px; font: 700 12px Arial,sans-serif; }.peace-paper .strategy-select { border-color: rgba(76,57,32,.45); background: rgba(255,255,255,.6); color: #30291f; }.peace-paper .peace-region-list { border-color: rgba(76,57,32,.25); background: rgba(255,255,255,.38); }.peace-paper .peace-region-option { border-color: rgba(76,57,32,.2); background: rgba(255,255,255,.28); color: #312b23; }.peace-paper .mini-button { min-height: 36px; }
.peace-terms { display: grid; gap: 8px; }.peace-term { display: grid; gap: 5px; padding: 11px; border-left: 4px solid #a88652; background: rgba(91,69,36,.1); }.peace-term.accepted { border-left-color: #4d8a60; }.peace-term.rejected { border-left-color: #ad5548; opacity: .7; }.peace-term small { color: #655a4b; font: 11px Arial,sans-serif; }.peace-term-actions { display: flex; gap: 7px; margin-top: 3px; }.peace-term-actions button { width: auto !important; min-width: 100px; padding: 0 12px; }.peace-offer .primary-button { min-height: 42px; }
.speech-bubble { position: relative; margin-top: 5px; padding: 8px 10px; border: 1px solid rgba(85,64,37,.35); border-radius: 12px; background: #fff5d8; color: #493b2c; font: 12px/1.25 Arial,sans-serif; box-shadow: 0 4px 9px rgba(0,0,0,.18); }
.speech-bubble::before { content: ""; position: absolute; left: 18px; top: -8px; border: 8px solid transparent; border-bottom-color: #fff5d8; border-top: 0; }
@keyframes delegate-arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) { .peace-workspace { grid-template-columns: 1fr; }.peace-hall { min-height: 210px; }.delegate { width: 68px; }.delegate-body { width: 58px; height: 95px; }.delegate-head { width: 32px; height: 36px; }.delegate small { font-size: 8px; }.peace-delegates { inset-inline: 3%; } }

@media (max-width: 760px) {
  .peace-screen:has(.peace-hall) .peace-workspace { width: 94vw; max-height: 68vh; }
  .peace-laptop { min-height: 390px; max-height: 78vh; padding-inline: 14px; transform: none; }
  .peace-offer-row { grid-template-columns: 1fr; }
  .laptop-statusbar { gap: 5px; font-size: 8px; }
  .laptop-parties { grid-template-columns: 1fr; gap: 6px; }
}

.event-log-item.warning { border-left-color: #d69c45; }
.peace-laptop .peace-terms { max-height: 120px; overflow-y: auto; scrollbar-color: #4fc8db #0b1620; }
.peace-laptop .peace-region-list { max-height: 90px; overflow-y: auto; scrollbar-color: #4fc8db #0b1620; }
.delegate-body::before { content: ""; position: absolute; left: 47px; top: 5px; width: 8px; height: 80px; border-radius: 4px; background: linear-gradient(#141b28, #6c7d8e 45%, #141b28); box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.delegate-body::after { content: "•\A•\A•"; white-space: pre; position: absolute; right: 12px; top: 77px; color: #d9c28b; font: 18px/18px Georgia,serif; text-shadow: 0 1px #000; }
.delegate-lapel { border-bottom: 2px solid #d3dbe1; }
.event-log-item.success { border-left-color: #74a768; }
.event-log-item.active {
  background: rgba(200, 167, 99, .16);
  color: #fff4d6;
}

.event-detail.warning { border-color: rgba(214, 156, 69, .56); }
.event-detail.success { border-color: rgba(116, 167, 104, .58); }

.map-legend-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-legend-card header {
  grid-column: 1 / -1;
}

.map-legend-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d5d0c4;
  font: 12px/1.3 Arial, sans-serif;
}

.map-legend-card i {
  width: 18px;
  height: 12px;
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.geo-feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.geo-feature-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.geo-feature-row strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.geo-feature-row small {
  white-space: nowrap;
}

.equipment-designer {
  grid-template-columns: 1fr;
}

.design-field {
  display: grid;
  gap: 5px;
}

.design-field small {
  text-transform: uppercase;
  letter-spacing: .08em;
}

.notification-stack {
  position: fixed;
  top: 86px;
  right: 22px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: min(260px, calc(100vw - 32px));
}

.game-notification {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(224, 210, 179, .28);
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(23, 25, 28, .94);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
  font: 700 17px/1 Arial, sans-serif;
  cursor: pointer;
  animation: notification-in .18s ease-out;
}

.game-notification.warning { border-color: #e6b44c; }
.game-notification.danger { border-color: #df6c64; }
.game-notification:hover { transform: translateY(-2px) scale(1.06); }

.notification-details {
  position: fixed;
  inset: 92px 22px auto auto;
  width: min(390px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(224, 210, 179, .35);
  border-radius: 9px;
  background: rgba(23, 25, 28, .97);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
}

.notification-details::backdrop { background: rgba(0, 0, 0, .22); }

.notification-details header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-details p { margin: 10px 0; }


@keyframes notification-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.turn-controls {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(18, 24, 28, .62);
}

.game-map-viewport {
  position: relative;
  display: grid;
  place-items: start;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 24px;
  overflow: auto;
  background: #090d0f;
  cursor: grab;
  z-index: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.game-map-viewport.dragging-map {
  cursor: grabbing;
}

.game-loading {
  place-self: center;
  color: var(--muted);
  font-family: Arial, sans-serif;
}

.game-canvas-stack {
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 16px 45px #000;
  cursor: crosshair;
}

.game-map-viewport.dragging-map .game-canvas-stack {
  cursor: grabbing;
}

.game-world-strip {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
}

.game-world-strip .game-canvas-stack {
  box-shadow: none;
}

.game-world-strip[hidden] {
  display: none;
}

.game-canvas-clone {
  pointer-events: none;
  opacity: .98;
}

.game-canvas-stack[hidden] { display: none; }

.game-canvas-stack canvas {
  position: absolute;
  inset: 0;
  display: block;
  image-rendering: pixelated;
}

.smoothing-msaa canvas,
.smoothing-ssaa canvas {
  image-rendering: auto;
}

.smoothing-ssaa canvas {
  filter: saturate(1.04) contrast(1.02);
}

#gameOverlayCanvas { pointer-events: none; }

.topbar {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  padding: 22px clamp(22px, 5vw, 70px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.025)),
    rgba(18, 24, 28, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(20px) saturate(1.4);
}

.topbar > div { text-align: center; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar h2 { margin: 0; font-size: 28px; font-weight: 500; }

.text-button {
  justify-self: start;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: #c9c3b6;
  cursor: pointer;
}

.setup-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 46px 28px 120px;
}

.selection-block + .selection-block { margin-top: 46px; }

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

.section-heading span, .section-heading strong {
  color: var(--gold);
  font: 12px Arial, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-heading h3 { margin: 5px 0 0; font-size: 25px; font-weight: 500; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 360px)); gap: 18px; }

.map-card,
.scenario-card,
.country-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.035)),
    rgba(23, 29, 34, .58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 18px 42px rgba(0,0,0,.22);
  backdrop-filter: blur(18px) saturate(1.35);
  text-align: left;
  cursor: pointer;
}

.map-card.selected,
.scenario-card.selected,
.country-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dark); }

.scenario-card {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  min-height: 118px;
  color: var(--text);
  cursor: pointer;
}

.country-card {
  position: relative;
  display: grid;
  grid-template-columns: calc(94px * 16 / 9) minmax(0, 1fr);
  height: 94px;
  color: var(--text);
}

.army-text-layer {
  position: absolute;
  inset: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.army-text-layer text {
  font-family: Arial, sans-serif;
  font-weight: 800;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, .94);
  stroke-width: 1.5px;
  stroke-linejoin: round;
}

.historical-chronicle summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.historical-chronicle summary small {
  color: var(--muted);
}

.historical-chronicle-list {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 6px;
}

.historical-chronicle-list small {
  display: block;
  line-height: 1.35;
}

.warning-text {
  color: #e2ad72;
}

.country-flag {
  display: grid;
  place-items: center;
  align-self: stretch;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #20282d;
  color: var(--muted);
  font: 700 20px Arial, sans-serif;
}

.country-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 16 / 9;
  object-position: center;
  image-rendering: pixelated;
}

.scenario-year {
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.04)),
    linear-gradient(145deg, #7d6539, #30291e);
  color: #fff3d6;
  font-size: 28px;
  font-weight: 700;
}

.scenario-card .card-copy {
  align-content: center;
}

.map-preview {
  display: grid;
  place-items: center;
  height: 180px;
  background:
    linear-gradient(rgba(13, 20, 24, .15), rgba(13, 20, 24, .72)),
    url("assets/europe-preview.jpg?v=20261007-181327") center/cover,
    radial-gradient(circle at 45% 45%, #8a896c, #465b5e 48%, #1c3038 70%);
}

.map-preview span { color: rgba(255,255,255,.72); font: 700 18px Arial, sans-serif; letter-spacing: .3em; }

.card-copy { display: grid; gap: 5px; padding: 16px 18px; }
.card-copy strong { font-size: 20px; }
.card-copy small { color: var(--muted); font-family: Arial, sans-serif; }

.check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #17130d;
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.map-card:not(.selected) .check,
.scenario-card:not(.selected) .check,
.country-card:not(.selected) .check {
  display: none;
}

.empty-state {
  padding: 30px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.02);
  text-align: center;
}

.empty-state strong { font-size: 20px; }
.empty-state p { margin: 10px auto 18px; max-width: 560px; color: var(--muted); font-family: Arial, sans-serif; }
.empty-state a { color: var(--gold); }

.setup-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 16px clamp(22px, 5vw, 70px);
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.025)),
    rgba(14, 18, 21, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 -18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(20px) saturate(1.45);
}

.setup-footer span { color: var(--muted); font-family: Arial, sans-serif; font-size: 13px; }

@media (max-width: 650px) {
  .topbar { grid-template-columns: auto 1fr; }
  .topbar > div { text-align: right; }
  .section-heading { align-items: start; flex-direction: column; }
  .game-topbar { grid-template-columns: 1fr; }
  .game-controls { justify-self: stretch; flex-wrap: wrap; }
  .strategy-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(480px, 1fr); }
  .strategy-panel { max-height: 58vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .strategy-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-tabs button { text-align: center; padding: 0 8px; }
  .strategy-content { inset: 10px; max-width: none; }
  .panel-fullscreen-button { top: 18px; right: 18px; }
  .strategy-panel-fullscreen .strategy-layout { grid-template-rows: minmax(480px, 1fr); }
  .strategy-panel-fullscreen .strategy-content { inset: 10px; }
  footer { display: none; }
}
.simulation-notice {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 5;
  width: min(38rem, calc(100vw - 32px));
  margin: 0;
  color: rgba(235, 240, 244, 0.72);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
  pointer-events: none;
}

.legal-details {
  margin-top: 1rem;
  color: rgba(235, 240, 244, 0.72);
  font-size: 0.78rem;
  line-height: 1.5;
}

.legal-details summary {
  cursor: pointer;
  color: rgba(235, 240, 244, 0.9);
}

.legal-details p {
  margin: 0.65rem 0 0;
}


.recognition-dossier { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.recognition-dossier > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recognition-panel .geo-feature-row.active { border-color: var(--gold, #c8a763); background: rgba(200,167,99,.12); }

.mobile-map-button { display: none; }

@media (max-width: 980px) {
  html, body { width: 100%; min-height: 100%; overflow: hidden; }
  .game-shell { width: 100%; height: 100dvh; }
  .main-screen { justify-content: flex-start; overflow-y: auto; padding: max(32px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
  .main-screen.active { display: grid; grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; }
  .main-screen h1 { font-size: clamp(44px, 11vw, 76px); }
  .menu { display: grid; grid-template-rows: auto minmax(0, 1fr); align-self: stretch; width: 100%; height: 100%; min-height: 0; margin: 0; }
  .menu-actions { max-height: none; }
  .menu-actions { align-self: end; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .simulation-notice { position: relative; right: auto; bottom: auto; grid-row: 2; justify-self: end; width: min(42rem, 100%); margin: 12px 0 0; text-align: right; }
  .setup-screen, .play-screen { height: 100dvh; }
  .topbar { grid-template-columns: auto 1fr; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .topbar > div { text-align: right; }
  .topbar h2 { font-size: 22px; }
  .setup-content { padding: 22px 14px 100px; }
  .selection-block + .selection-block { margin-top: 26px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
  .setup-footer { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); justify-content: space-between; gap: 10px; }
  .setup-footer span { font-size: 11px; }
  .setup-footer .primary-button { min-width: 124px; }

  .game-topbar { display: flex; gap: 8px; min-height: 54px; padding: max(5px, env(safe-area-inset-top)) 8px 5px; }
  .game-topbar > div:nth-child(2) { flex: 1; min-width: 0; text-align: left; }
  .game-topbar > div:nth-child(2) strong, .game-topbar > div:nth-child(2) span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .game-topbar > div:nth-child(2) strong { font-size: 14px; }
  .game-topbar > div:nth-child(2) span { font-size: 10px; }
  .game-topbar .text-button { min-height: 42px; padding: 6px; font: 12px Arial, sans-serif; white-space: nowrap; }
  .game-controls { flex: 0 0 auto; gap: 4px; }
  .game-controls .turn-indicator, #gameGuideButton { display: none; }
  #gameSettingsButton { width: 42px; font-size: 0; }
  #gameSettingsButton::before { content: "⚙"; font-size: 20px; }
  .game-zoom { gap: 2px; }
  .game-zoom button { width: 40px; height: 40px; font-size: 21px; }
  #gameZoomLabel { display: none; }

  .strategy-layout, .strategy-panel-fullscreen .strategy-layout { display: block; position: relative; min-height: 0; overflow: hidden; }
  .strategy-main { position: absolute; inset: 0; display: block; }
  .strategy-panel, .strategy-panel-fullscreen .strategy-panel { position: fixed; z-index: 35; right: 0; bottom: 0; left: 0; display: block; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); max-height: none; border: 0; border-top: 1px solid var(--line); background: rgba(12, 20, 25, .98); }
  .state-summary, .selected-region-summary { display: none; }
  .strategy-tabs { display: flex; flex-wrap: nowrap; width: calc(100% - 112px); height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; }
  .strategy-tabs::-webkit-scrollbar { display: none; }
  .strategy-tabs button { flex: 0 0 auto; min-width: 76px; min-height: 54px; padding: 0 12px; border-right: 1px solid rgba(224,210,179,.12); border-bottom: 0; text-align: center; font-size: 12px; scroll-snap-align: start; }
  .turn-controls { position: absolute; top: 0; right: 0; width: 112px; height: 62px; padding: 7px; border: 0; }
  .turn-controls .primary-button { width: 100%; min-width: 0; height: 47px; padding: 4px; font: 700 12px/1.1 Arial, sans-serif; }
  #turnStatus { display: none; }
  .game-map-viewport { width: 100%; height: 100%; padding: 0; overscroll-behavior: contain; }
  .strategy-content, .strategy-panel-fullscreen .strategy-content { position: fixed; z-index: 30; top: auto; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); left: 0; width: 100%; max-width: none; height: min(62dvh, calc(100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); max-height: none; padding: 52px 14px 18px; border-radius: 18px 18px 0 0; background: rgba(15, 24, 29, .97); overscroll-behavior: contain; }
  .strategy-content.hidden { display: none; }
  .mobile-map-button { display: none; position: fixed; z-index: 36; right: 14px; bottom: calc(62px + min(62dvh, 100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) - 44px + env(safe-area-inset-bottom)); min-width: 84px; min-height: 40px; padding: 7px 12px; border: 1px solid var(--gold); border-radius: 20px; background: #30291e; color: #fff1bf; font: 700 13px Arial, sans-serif; box-shadow: 0 6px 20px #0009; }
  .mobile-sheet-open .mobile-map-button { display: block; }
  .play-screen .panel-fullscreen-button { display: none; }
  .relation-map-active .mobile-map-button { display: none; }
  .relation-map-active .strategy-panel, .relation-map-active .strategy-content { display: none; }
  .relation-map-back { top: calc(62px + env(safe-area-inset-top)); left: 10px; }
  .notification-stack { top: calc(60px + env(safe-area-inset-top)); right: 8px; width: min(160px, 45vw); }
  .notification-details { inset: calc(64px + env(safe-area-inset-top)) 8px auto auto; width: min(390px, calc(100vw - 16px)); }
  .settings-card, .tutorial-card, .save-card { width: min(100%, 520px); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .strategy-card, .tab-section { min-width: 0; }
  .focus-expanded-card { width: min(620px, calc(100vw - 52px)); max-height: 46dvh; }
  .peace-screen { height: 100dvh; overflow-y: auto; }
  .peace-topbar { padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  .peace-topbar h2 { font-size: 22px; }
  .peace-screen:has(.peace-hall) .peace-content, .peace-screen:has(.peace-hall) .peace-hall { min-height: 100dvh; height: 100dvh; }
  .peace-screen:has(.peace-hall) .peace-workspace { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; width: calc(100% - 16px); max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); transform: none !important; }
  .peace-laptop { min-height: 0; max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 12px; }
  .peace-laptop .peace-offer-row { flex-wrap: wrap; }
}

@media (max-width: 980px) and (max-height: 520px) {
  .strategy-content, .strategy-panel-fullscreen .strategy-content { height: calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .mobile-map-button { bottom: calc(100dvh - 102px - env(safe-area-inset-top)); }
}

@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  .main-screen.active {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-content: stretch;
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: max(12px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  }
  .main-screen .menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    margin: 0;
  }
  .main-screen .eyebrow { margin-bottom: 8px; font-size: 10px; }
  .main-screen h1 { font-size: clamp(34px, 5vw, 54px); line-height: .82; }
  .main-screen .subtitle { margin: 8px 0 0; font-size: 13px; line-height: 1.35; }
  .main-screen .menu-actions { grid-column: 1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); align-self: end; gap: 7px; width: 100%; min-width: 0; }
  .main-screen .menu-actions .primary-button,
  .main-screen .menu-actions .menu-button { min-width: 0; min-height: 42px; padding: 5px 9px; border-radius: 10px; font: 12px/1.2 Arial, sans-serif; text-align: left; }
  .main-screen .menu-actions .primary-button { font-weight: 700; }
  .main-screen .simulation-notice { flex: 0 0 auto; width: 100%; margin: 12px 0 0; font-size: 10px; line-height: 1.3; }
}

.mobile-fullscreen-prompt {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 10, .74);
  backdrop-filter: blur(10px);
}

.mobile-fullscreen-prompt[hidden] { display: none; }

.mobile-fullscreen-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 22px 22px;
  border: 1px solid var(--gold);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(32, 42, 48, .98), rgba(15, 21, 25, .98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .56);
  text-align: center;
}

.mobile-fullscreen-card h2 { margin: 0 0 10px; font-size: clamp(24px, 6vw, 34px); }
.mobile-fullscreen-card p:not(.eyebrow) { margin: 0 auto 20px; color: var(--muted); font: 15px/1.45 Arial, sans-serif; }
.mobile-fullscreen-card .primary-button,
.mobile-fullscreen-card .mini-button { width: 100%; }
.mobile-fullscreen-card .mini-button { margin-top: 8px; }
.mobile-fullscreen-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
