/* RESOLUTION — "Think-tank strategic briefing" visual identity */
:root {
  --bg: #0b1622;
  --panel: #121f2d;
  --raised: #1b2a3a;
  --raised-2: #223345;
  --line: #2a3b4d;
  --line-soft: #1f2e3e;
  --text: #e6edf3;
  --muted: #8b9bab;
  --faint: #5d6e80;
  --accent: #d4a24c;
  --accent-soft: rgba(212, 162, 76, 0.12);
  --good: #4caf7d;
  --bad: #d9534f;
  --warn: #c9893a;
  --info: #6d97c4;
  --land: #1e2b38;
  --ocean: #0b1622;
  --radius: 6px;
  --radius-sm: 4px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
input, select { font: inherit; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243446; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2f4257; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.accent { color: var(--accent); }
.ico { display: inline-block; vertical-align: -0.15em; flex: none; }
.ico-fallback { line-height: 1; }

/* Labels */
.label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.label.accent { color: var(--accent); }
.footnote { font-size: 11px; color: var(--faint); line-height: 1.45; }
.footnote::before { content: ''; }
.rule { height: 1px; background: var(--line); border: 0; margin: 12px 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--raised-2); border-color: #3a4e63; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1205; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #dfb05c; border-color: #dfb05c; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(217, 83, 79, .5); color: #e8908d; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 14px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 34px; padding: 0; }
.btn.block { width: 100%; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-h .footnote { white-space: nowrap; }
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.panel-b { padding: 12px 14px; }
.panel-f { padding: 10px 14px; border-top: 1px solid var(--line); }

/* Chips (effects) */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px;
  border-radius: 3px; font-size: 11.5px; font-family: var(--mono); font-variant-numeric: tabular-nums;
  background: rgba(139, 155, 171, .08); border: 1px solid var(--line-soft); color: var(--muted); white-space: nowrap;
}
.chip.good { color: #7cc79f; background: rgba(76, 175, 125, .08); border-color: rgba(76, 175, 125, .22); }
.chip.bad { color: #e48a87; background: rgba(217, 83, 79, .08); border-color: rgba(217, 83, 79, .22); }
.chip.neutral { color: var(--muted); }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: rgba(212, 162, 76, .3); }
.chip .lbl { font-family: var(--font); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 3px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
}
.tag.good { color: var(--good); border-color: rgba(76, 175, 125, .35); }
.tag.bad { color: var(--bad); border-color: rgba(217, 83, 79, .35); }
.tag.accent { color: var(--accent); border-color: rgba(212, 162, 76, .4); }
.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }

/* Bars */
.bar { position: relative; height: 4px; background: #1a2836; border-radius: 2px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--info); border-radius: 2px; transition: width .4s var(--ease); }
.statrow { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 8px; padding: 5px 0; }
.statrow .nm { font-size: 12.5px; color: var(--text); }
.statrow .val { font-family: var(--mono); font-size: 13px; min-width: 26px; text-align: right; }
.statrow .dlt { font-family: var(--mono); font-size: 11px; min-width: 34px; text-align: right; color: var(--faint); }
.statrow .bar { grid-column: 2 / 5; margin-top: -1px; }
.statrow .ico { color: var(--muted); }
.trend-up { color: var(--good); }
.trend-down { color: var(--bad); }

/* Pips */
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 8px; height: 8px; border-radius: 1px; background: #233244; display: inline-block; }
.pips i.on { background: var(--accent); }
.pips.blue i.on { background: var(--info); }

/* ==================== App frame ==================== */
#app { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  flex: none; height: 56px; display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: #0d1926;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-right: 1px solid var(--line); min-width: 210px; }
.brand .mark { width: 22px; height: 22px; border: 1.5px solid var(--accent); border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.brand .nm { font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.brand .sub { font-size: 10px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.roundbox { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-right: 1px solid var(--line); min-width: 150px; }
.roundbox .v { font-family: var(--mono); font-size: 13px; }
.meters { display: flex; flex: 1; min-width: 0; }
.meter {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px;
  padding: 8px 14px; border-right: 1px solid var(--line); cursor: help; align-content: center;
}
.meter .label { grid-column: 1; letter-spacing: .07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter .v { grid-column: 1; font-family: var(--mono); font-size: 15px; display: flex; align-items: baseline; gap: 6px; }
.meter .d { font-family: var(--mono); font-size: 11px; }
.meter svg.spark { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.meter.alert .v { color: #e48a87; }
.topbar .tools { display: flex; align-items: center; gap: 6px; padding: 0 12px; }

.game {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 390px; gap: 12px; padding: 12px;
}
.col { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.col.scroll { overflow-y: auto; padding-right: 2px; }
.col-center { overflow-y: auto; }

/* Leader card */
.leader-h { display: flex; gap: 12px; align-items: center; }
.leader-badge {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600; flex: none;
}
.leader-h .nm { font-weight: 600; font-size: 15px; line-height: 1.25; }
.leader-h .ar { font-size: 12px; color: var(--muted); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); }
.xpbar { height: 3px; background: #1a2836; border-radius: 2px; overflow: hidden; margin-top: 6px; }
.xpbar i { display: block; height: 100%; background: var(--accent); transition: width .4s var(--ease); }
.skillgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.skill { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.skill .n { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.skill .v { font-family: var(--mono); }
.skill .v small { color: var(--good); font-size: 10.5px; }
.advisor { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.advisor:first-child { border-top: 0; }
.advisor .av { width: 28px; height: 28px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--muted); }
.advisor .nm { font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.advisor .rl { font-size: 11px; color: var(--muted); }
.advisor .loy { width: 46px; text-align: right; }
.advisor .loy .num { font-size: 11px; }

/* Center: map */
.mapwrap { position: relative; width: 100%; aspect-ratio: 2 / 1; background: var(--ocean); overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.mapwrap img.base { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; pointer-events: none; transform-origin: 0 0; }
.mapwrap svg.vec { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapwrap .country { fill: transparent; stroke: rgba(160, 180, 200, .22); stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill .2s var(--ease), fill-opacity .2s; }
.mapwrap.vector-only .country { fill: var(--land); stroke: #2c3e50; }
.mapwrap .country.playable { stroke: rgba(200, 215, 230, .35); }
.mapwrap .country.hover { stroke: #c9d6e2; stroke-width: 1; }
.mapwrap .country.active { stroke-width: 1.4; }
.mapwrap:not(.vector-only) { background: #071c2d; }
.mapwrap:not(.vector-only) .graticule { display: none; }
.mapwrap .graticule { stroke: rgba(139, 155, 171, .07); stroke-width: .5; vector-effect: non-scaling-stroke; fill: none; }
.mapwrap .lbl { font-family: var(--font); font-weight: 600; font-size: calc(10px * var(--u, 3.6)); letter-spacing: .12em; fill: #c6d2dd; paint-order: stroke; stroke: rgba(11, 22, 34, .85); stroke-width: calc(3px * var(--u, 3.6)); pointer-events: none; text-transform: uppercase; }
.mapwrap .lbl.active { fill: #fff; }
.mapwrap .arc { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .85; }
.mapwrap .arc.trade { stroke: #c9a54e; stroke-dasharray: 2 4; }
.mapwrap .arc.pact { stroke: #6d97c4; }
.mapwrap .arc.climate { stroke: #4caf7d; stroke-dasharray: 6 3; }
.mapwrap .arc.sanction { stroke: #d9534f; stroke-dasharray: 5 4; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -18; } }
.mapwrap .capital { fill: #e6edf3; stroke: var(--bg); stroke-width: 1.5; vector-effect: non-scaling-stroke; r: calc(2.2px * var(--u, 3.6)); }
.mapwrap .hot { cursor: pointer; }
.mapwrap .hot .core { stroke: var(--bg); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mapwrap .hot .ring { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s var(--ease) infinite; }
.mapwrap .hot.t0 .ring, .mapwrap .hot.t1 .ring { animation-duration: 4s; }
.mapwrap .hot.t5 .ring { animation-duration: 1.4s; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.mapwrap .hotlbl { font-family: var(--mono); font-weight: 600; font-size: calc(10px * var(--u, 3.6)); fill: #e9c88a; paint-order: stroke; stroke: rgba(11, 22, 34, .9); stroke-width: calc(3px * var(--u, 3.6)); pointer-events: none; }
.maptip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 200px; max-width: 260px;
  background: rgba(18, 31, 45, .97); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12px; opacity: 0; transition: opacity .12s; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.maptip.on { opacity: 1; }
.maptip .t { font-weight: 600; font-size: 13px; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.maptip .s { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.maptip .g { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; font-size: 11.5px; }
.maptip .g span:nth-child(odd) { color: var(--muted); }
.maptip .g span:nth-child(even) { font-family: var(--mono); text-align: right; }
.maplegend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); }
.maplegend .ln { display: inline-block; width: 18px; height: 0; border-top: 1.5px solid; vertical-align: middle; margin-right: 5px; }

.hot-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hot-table td { padding: 7px 8px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.hot-table tr:first-child td { border-top: 0; }
.hot-table tr { cursor: pointer; }
.hot-table tr:hover td { background: rgba(255, 255, 255, .015); }
.tension { display: inline-flex; gap: 2px; }
.tension i { width: 14px; height: 6px; border-radius: 1px; background: #1f2f40; display: inline-block; }
.dispatch { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.dispatch:first-child { border-top: 0; }
.dispatch .dt { font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding-top: 2px; text-transform: uppercase; }

/* Right column: tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 11px 6px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tabbody { flex: 1; min-height: 0; overflow-y: auto; }
.rightpanel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.turnbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.turnbar .pc { display: flex; align-items: center; gap: 8px; flex: 1; }

.actcat { padding: 12px 14px 4px; display: flex; align-items: center; gap: 8px; }
.act {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
  margin: 0 8px; padding: 9px 8px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s;
}
.act:hover { background: var(--raised); border-color: var(--line); }
.act.disabled { opacity: .42; cursor: not-allowed; }
.act.disabled:hover { background: transparent; border-color: transparent; }
.act .ic { width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.act:hover:not(.disabled) .ic { color: var(--accent); border-color: rgba(212, 162, 76, .4); }
.act .nm { font-size: 13px; font-weight: 500; line-height: 1.25; }
.act .ds { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.act .why { font-size: 11px; color: var(--warn); margin-top: 2px; }
.act .cost { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--muted); line-height: 1.5; white-space: nowrap; }
.act .cost b { color: var(--text); font-weight: 600; }

.nation { padding: 12px 14px; border-top: 1px solid var(--line); }
.nation:first-child { border-top: 0; }
.nation-h { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nation-h .nm { font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.mini-stats div { text-align: center; }
.mini-stats .num { font-size: 13px; display: block; }
.mini-stats .label { font-size: 9px; }
.trustbar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; margin-top: 8px; }
.trustbar .bar { flex: 1; }

.obj { padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.obj:first-child { border-top: 0; }
.obj .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.obj .nm { font-weight: 600; font-size: 13px; }
.obj .tx { font-size: 12px; color: var(--muted); margin-top: 2px; }
.obj .pr { font-family: var(--mono); font-size: 11.5px; margin-top: 6px; color: #b9c6d2; }
.obj.secret { background: repeating-linear-gradient(135deg, rgba(212, 162, 76, .035) 0 10px, transparent 10px 20px); }
.chron { padding: 8px 14px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 74px 1fr; gap: 10px; font-size: 12.5px; }
.chron .dt { font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding-top: 2px; text-transform: uppercase; }
.chron.major .tx { color: var(--text); font-weight: 500; }
.chron .tx { color: #b9c6d2; }

/* ==================== Modals ==================== */
#modal-root:empty { display: none; }
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(6, 12, 19, .72);
  display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal {
  width: min(720px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); animation: rise .22s var(--ease);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.modal.wide { width: min(980px, 100%); }
.modal.narrow { width: min(520px, 100%); }
.modal-h { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-h h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.modal-f .spacer { flex: 1; }

/* Cable / brief */
.cable-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 20px; background: #0f1b28; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.cable-strip .cls { color: var(--accent); font-weight: 600; }
.cable-strip .cls.red { color: #e48a87; }
.cable-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.cable-meta b { color: var(--faint); font-weight: 400; }
.headline { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.005em; }
.lede { font-size: 14.5px; line-height: 1.6; color: #cfd8e1; margin: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.adv-note { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.adv-note:first-child { border-top: 0; }
.adv-note .av { width: 26px; height: 26px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--muted); }
.adv-note q { color: #cfd8e1; font-style: italic; quotes: '“' '”'; }
.adv-note .rec { color: var(--accent); font-size: 11.5px; }

.option {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.option:hover { border-color: rgba(212, 162, 76, .55); background: rgba(212, 162, 76, .03); }
.option.disabled { opacity: .5; cursor: not-allowed; }
.option .ix { font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid rgba(212, 162, 76, .45); border-radius: 3px; width: 24px; height: 24px; display: grid; place-items: center; }
.option .nm { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.option .tr { display: grid; grid-template-columns: 92px 1fr; gap: 4px 8px; align-items: center; font-size: 11.5px; }
.option .tr .k { color: var(--faint); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.option .recs { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.option .recs span { display: inline-flex; align-items: center; gap: 4px; }
.prob { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--muted); white-space: nowrap; }
.prob b { display: block; font-size: 15px; color: var(--text); }

/* Probability assessment (dice) */
.assess { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin: 14px 0; background: #0f1b28; }
.assess .die { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: 20px; font-weight: 600; }
.assess .eq { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.assess .verdict { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; }
.assess .verdict.ok { color: var(--good); border: 1px solid rgba(76, 175, 125, .4); }
.assess .verdict.no { color: var(--bad); border: 1px solid rgba(217, 83, 79, .4); }
.assess.rolling .die { color: var(--muted); }
.assess.rolling .verdict { visibility: hidden; }

.outcome { font-size: 14.5px; line-height: 1.6; color: #cfd8e1; border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; margin: 4px 0 14px; }

/* Picker grid */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pick {
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; text-align: left; background: transparent;
  transition: border-color .15s, background .15s; display: flex; flex-direction: column; gap: 3px;
}
.pick:hover:not(.disabled) { border-color: rgba(212, 162, 76, .55); background: rgba(212, 162, 76, .03); }
.pick.sel { border-color: var(--accent); background: var(--accent-soft); }
.pick.disabled { opacity: .42; cursor: not-allowed; }
.pick .nm { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.pick .sb { font-size: 11.5px; color: var(--muted); }

/* ==================== Full-screen pages ==================== */
.page { flex: 1; overflow-y: auto; }
.page-inner { max-width: 1120px; margin: 0 auto; padding: 40px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.page-head h1 { font-family: var(--serif); font-size: 34px; margin: 6px 0 0; font-weight: 700; line-height: 1.15; }

/* Title */
.title-screen { position: relative; flex: 1; overflow: hidden; }
.title-screen .bgmap { position: absolute; inset: 0; opacity: .5; display: flex; align-items: center; justify-content: center; }
.title-screen .bgmap .mapwrap { width: 140vw; max-width: none; border-radius: 0; flex: none; }
.title-screen .shade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(11, 22, 34, .9) 38%, rgba(11, 22, 34, .35) 75%, rgba(11, 22, 34, .6) 100%); }
.title-content { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 8vw; max-width: 760px; }
.title-content h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(54px, 7vw, 92px); line-height: 1; margin: 14px 0 18px; letter-spacing: -.01em; }
.title-content .intro { font-size: 16px; line-height: 1.65; color: #c3cfda; max-width: 560px; margin: 0 0 30px; }
.title-content .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.title-foot { position: absolute; left: 8vw; right: 8vw; bottom: 28px; display: flex; justify-content: space-between; gap: 20px; }

/* Setup */
.form-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; }
.input {
  width: 100%; height: 36px; padding: 0 12px; background: #0f1b28; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { background: transparent; border: 0; border-left: 1px solid var(--line); padding: 7px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.player-row { display: grid; grid-template-columns: 28px 1fr 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.player-row .n { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.pool label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; }
.pool label.off { opacity: .45; }
.pool input { accent-color: var(--accent); }

/* Handover */
.handover { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fade .2s var(--ease); padding: 24px; }
.handover .banner {
  position: absolute; top: 0; left: 0; right: 0; padding: 9px; text-align: center; font-family: var(--mono); font-size: 11px;
  letter-spacing: .3em; color: var(--accent); border-bottom: 1px solid rgba(212, 162, 76, .3); background: rgba(212, 162, 76, .05);
}
.handover .banner.bottom { top: auto; bottom: 0; border-bottom: 0; border-top: 1px solid rgba(212, 162, 76, .3); }
.handover .card { width: min(520px, 100%); text-align: center; }
.handover .seal { width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; }
.handover h1 { font-family: var(--serif); font-size: 34px; margin: 10px 0 6px; font-weight: 700; }
.handover p { color: var(--muted); margin: 0 0 26px; }

/* Dossier */
.dossier { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.dossier .flagbar { height: 3px; border-radius: 2px; margin-bottom: 14px; }
.classified { border: 1px dashed rgba(212, 162, 76, .45); border-radius: var(--radius-sm); padding: 12px 14px; background: rgba(212, 162, 76, .04); }
.classified .label { color: var(--accent); }
.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.arch { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: transparent; text-align: left; transition: border-color .15s, background .15s; }
.arch:hover { border-color: #3a4e63; }
.arch.sel { border-color: var(--accent); background: var(--accent-soft); }
.arch .nm { font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.arch .bl { font-size: 12px; color: var(--muted); line-height: 1.45; min-height: 52px; }
.arch .ab { font-size: 11.5px; margin-top: 8px; color: #b9c6d2; }
.arch .sk { display: flex; gap: 8px; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* Newspaper / situation report */
.sitrep { width: min(1000px, 100%); }
.sitrep .mast { text-align: center; padding: 22px 24px 14px; border-bottom: 1px solid var(--line); }
.sitrep .mast .t { font-family: var(--serif); font-weight: 900; font-size: 34px; letter-spacing: .01em; margin: 6px 0 4px; }
.sitrep .grid { display: grid; grid-template-columns: 1.6fr 1fr; }
.sitrep .lead { padding: 20px 24px; border-right: 1px solid var(--line); }
.sitrep .lead h3 { font-family: var(--serif); font-size: 30px; line-height: 1.15; margin: 8px 0 12px; }
.sitrep .items { padding: 14px 24px; }
.sitrep .item { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sitrep .item:first-child { border-top: 0; }
.sitrep .item h4 { margin: 3px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.3; font-weight: 700; }
.indic { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.indic > div { padding: 12px 16px; border-left: 1px solid var(--line); }
.indic > div:first-child { border-left: 0; }
.indic .v { font-family: var(--mono); font-size: 18px; }

/* UN */
.un-head { background: linear-gradient(180deg, rgba(109, 151, 196, .07), transparent); }
.res-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: transparent; text-align: left; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; transition: border-color .15s, background .15s; width: 100%; }
.res-card:hover { border-color: #3a4e63; }
.res-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.res-card .ic { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--info); }
.res-card .nm { font-weight: 600; font-size: 14px; }
.res-card .sm { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.res-list { display: grid; gap: 8px; }
.lobby-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lobby-table th { text-align: center; font-weight: 600; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.lobby-table th:first-child { text-align: left; }
.lobby-table td { padding: 10px 6px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: middle; }
.lobby-table td:first-child { text-align: left; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stepper button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { color: var(--text); background: var(--raised); }
.stepper .num { min-width: 26px; text-align: center; font-size: 12px; }
.stepper .num.pos { color: var(--good); }
.stepper .num.neg { color: var(--bad); }
.forecast { display: flex; height: 6px; border-radius: 2px; overflow: hidden; background: #1a2836; }
.forecast i { display: block; height: 100%; }
.vote-btns { display: inline-flex; gap: 6px; }
.vote-btns .btn.sel-yes { background: rgba(76, 175, 125, .18); border-color: var(--good); color: #9fdabb; }
.vote-btns .btn.sel-no { background: rgba(217, 83, 79, .16); border-color: var(--bad); color: #efaaa7; }
.vote-btns .btn.sel-abs { background: rgba(139, 155, 171, .16); border-color: var(--muted); }
.hemicycle { width: 100%; max-width: 560px; display: block; margin: 0 auto; }
.tally { display: flex; height: 10px; border-radius: 2px; overflow: hidden; background: #1a2836; margin: 10px 0 6px; }
.tally i { display: block; height: 100%; transition: width .8s var(--ease); }
.verdict-stamp { display: inline-block; font-family: var(--mono); font-weight: 700; letter-spacing: .25em; font-size: 15px; padding: 7px 14px; border: 1.5px solid; border-radius: 3px; animation: rise .3s var(--ease); }
.verdict-stamp.ok { color: var(--good); }
.verdict-stamp.no { color: var(--bad); }
.quote { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: #dfe6ec; border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 14px 0; }

/* Final assessment */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rank-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.rank-table .rk { font-family: var(--mono); font-size: 18px; color: var(--muted); width: 40px; }
.rank-table tr.first .rk { color: var(--accent); }
.rank-table .tot { font-family: var(--mono); font-size: 18px; text-align: right; }
.brief { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: var(--panel); }
.brief .bh { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brief .bb { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; padding: 14px 16px; }
.brief .bb p { margin: 0 0 10px; color: #cfd8e1; font-size: 13.5px; line-height: 1.6; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 12px; }
.score-row:first-child { border-top: 0; }
.score-row .d { color: var(--faint); font-size: 11px; }
.score-row .v { font-family: var(--mono); }
.outlook { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; border: 1px solid; }
.outlook.Positive { color: var(--good); }
.outlook.Stable { color: var(--info); }
.outlook.Negative { color: var(--bad); }
.award { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.award .ic { color: var(--accent); }

/* Toasts */
#toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 12.5px; max-width: 340px; animation: rise .2s var(--ease); }

/* Help */
.help h3 { font-size: 14px; margin: 18px 0 6px; }
.help p, .help li { color: #c3cfda; font-size: 13px; line-height: 1.6; }
.help ul { padding-left: 18px; margin: 6px 0; }


/* Language switch */
.lang-seg button { padding: 5px 10px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; }
.title-lang { position: absolute; top: 20px; right: 24px; z-index: 2; }
.ico.flip { transform: scaleX(-1); }

/* Demo round coach */
#coach-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.coach-block { position: absolute; inset: 0; pointer-events: auto; background: transparent; }
.coach-spot {
  position: absolute; border: 1.5px solid var(--accent); border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5, 10, 16, .58); transition: left .25s var(--ease), top .25s var(--ease), width .25s var(--ease), height .25s var(--ease);
}
.coach-card {
  position: absolute; pointer-events: auto; background: var(--panel); border: 1px solid rgba(212, 162, 76, .55);
  border-radius: var(--radius); padding: 12px 16px 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  transition: left .25s var(--ease), top .25s var(--ease); animation: rise .22s var(--ease);
}
.coach-h { display: flex; align-items: center; justify-content: space-between; }
.coach-prog { height: 2px; background: #1a2836; border-radius: 1px; margin: 8px 0 12px; overflow: hidden; }
.coach-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.coach-card h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 8px; line-height: 1.25; }
.coach-b { font-size: 13px; line-height: 1.6; color: #cfd8e1; }
.coach-b b { color: var(--text); }
.coach-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }

/* Responsive */
@media (max-width: 1360px) {
  .game { grid-template-columns: 270px minmax(0, 1fr) 350px; }
  .meter { padding: 8px 10px; }
  .meter svg.spark { display: none; }
}
@media (max-width: 1100px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  .game { grid-template-columns: 1fr; }
  .col.scroll, .col-center, .tabbody { overflow: visible; }
  .topbar { height: auto; flex-wrap: wrap; }
  .meters { flex-wrap: wrap; width: 100%; order: 3; border-top: 1px solid var(--line); }
  .meter { min-width: 33%; }
  .form-grid, .dossier, .sitrep .grid, .brief .bb { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page-inner { padding: 24px 16px 48px; }
  .arch-grid { grid-template-columns: 1fr; }
  .indic { grid-template-columns: repeat(2, 1fr); }
  .brand { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
