/* Layout idea: the map is the page. A thin bar on top, one panel on the left,
   and marble steles for the moments that stop the clock. */
:root {
  --ink: #0f1c33;        /* deep Aegean: bars and panels */
  --ink-2: #19294a;      /* raised surfaces on ink */
  --ink-3: #253a63;
  --marble: #efede7;     /* Pentelic white: text on ink, stele ground */
  --marble-2: #d8d5cb;
  --marble-3: #a9a698;
  --lapis: #3563c2;      /* Egyptian blue: actions */
  --lapis-hi: #9bb8f2;
  --ochre: #dba63c;      /* silver and standing */
  --cinnabar: #cf4632;   /* war */
  --malachite: #47a676;  /* peace, allies */
  --display: 'GFS Didot', Didot, 'Bodoni MT', 'Palatino Linotype', Palatino, Georgia, serif;
  --ui: 'GFS Neohellenic', Optima, Candara, 'Gill Sans', 'Trebuchet MS', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: #c9d9e3; color: var(--marble); font: 15px/1.45 var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.dragging { cursor: grabbing; }
#map.target { cursor: crosshair; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(12, 22, 40, .34) 100%); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---- map labels ---- */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; text-align: center; }
.lbl-city { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; justify-items: start; padding: 3px 9px 4px 7px; background: rgba(15, 28, 51, .80); border-radius: 3px; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 2px 8px rgba(0, 0, 0, .28); }
.lbl-city .pip { grid-row: 1 / span 2; width: 9px; height: 22px; border-radius: 2px; background: #888; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.lbl-city .gr { font: 400 12px/1.1 var(--display); letter-spacing: .2em; color: var(--marble); }
.lbl-city .en { font-size: 11.5px; line-height: 1.1; color: var(--marble-2); grid-column: 2; }
.lbl-city .st { display: none; }
.lbl-city.siege { background: rgba(120, 28, 20, .9); }
.lbl-city.mine { box-shadow: 0 0 0 1.5px var(--ochre), 0 2px 8px rgba(0, 0, 0, .28); }
.lbl-city.small .gr { display: none; }
.lbl-city.small { padding: 2px 7px 2px 5px; }
.lbl-city.small .pip { height: 11px; grid-row: 1; }
.lbl-mark { font: italic 12px var(--display); color: #2a2418; text-shadow: 0 0 3px rgba(255, 250, 235, .95), 0 0 6px rgba(255, 250, 235, .8); }
.lbl-region { font: 400 13px var(--display); letter-spacing: .42em; text-transform: uppercase; color: rgba(46, 36, 20, .62); text-shadow: 0 0 5px rgba(255, 250, 235, .6); }
.lbl-sea { font: italic 15px var(--display); letter-spacing: .14em; color: rgba(235, 246, 255, .78); text-shadow: 0 1px 4px rgba(6, 32, 70, .7); }
.lbl-sea.s3 { font-size: 22px; letter-spacing: .3em; }
.lbl-sea.s1 { font-size: 13px; }
.lbl-force { font-size: 12px; padding: 1px 7px 2px; border-radius: 9px; background: rgba(15, 28, 51, .86); color: var(--marble); border: 1px solid rgba(255, 255, 255, .28); }
.lbl-force.mine { border-color: var(--ochre); }
.lbl-force.foe { border-color: var(--cinnabar); }

/* ---- top bar ---- */
.top { position: absolute; left: 0; right: 0; top: 0; min-height: 58px; display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; padding: 6px 14px 9px; background: linear-gradient(#13233f, var(--ink)); box-shadow: 0 2px 14px rgba(0, 0, 0, .35); z-index: 5; }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; opacity: .55; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='5'%3E%3Cpath d='M0 4.5h4v-4h12v4h4M8 4.5v-2h4' fill='none' stroke='%23dba63c' stroke-width='1'/%3E%3C/svg%3E") repeat-x; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 2px 6px 2px 0; text-align: left; border-radius: 4px; }
.who:hover { background: rgba(255, 255, 255, .06); }
.shield { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--display); color: #fbf6e6; box-shadow: 0 0 0 2px #e2c26a, 0 0 0 4px #9b7a34; }
.shield.one { font-size: 22px; }
.who b { display: block; font: 400 19px/1.1 var(--display); letter-spacing: .02em; }
.who small { display: block; color: var(--marble-3); font-size: 12.5px; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: flex; gap: 4px; flex-wrap: wrap; }
.stat { background: none; border: 0; padding: 3px 9px; border-radius: 4px; text-align: left; line-height: 1.15; }
.stat:hover { background: rgba(255, 255, 255, .07); }
.stat span { display: block; font-size: 11.5px; color: var(--marble-3); }
.stat b { font-weight: 400; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat i { font-style: normal; font-size: 12.5px; margin-left: 5px; font-variant-numeric: tabular-nums; }
.pos { color: #8fd3ad; } .neg { color: #f0907f; } .warn { color: var(--ochre); }
.stat b .tal { display: inline; font: 400 15px var(--display); color: var(--ochre); margin-right: 3px; }
.clock { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.date { text-align: right; line-height: 1.15; }
.date b { font: 400 17px var(--display); }
.date span { display: block; font-size: 11.5px; color: var(--marble-3); }
.date .bar { height: 2px; background: rgba(255, 255, 255, .16); margin-top: 3px; border-radius: 2px; overflow: hidden; }
.date .bar i { display: block; height: 100%; background: var(--ochre); }
.regent { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; } .regent p { flex: 1 1 260px; font-size: 14px; } .regent .btn[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
#bmini { position: fixed; right: 12px; z-index: 6; border: 1px solid rgba(255, 255, 255, .35); border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, .45); cursor: crosshair; touch-action: none; } #bmini[hidden] { display: none; }
.bdeploy .lie { font-size: 13.5px; opacity: .9; } .tbtn[aria-disabled="true"] { opacity: .55; } .tbtn small { opacity: .8; margin-left: 4px; }
.worldclock { display: grid; justify-items: end; line-height: 1.15; font-size: 12.5px; color: var(--marble-3); } .worldclock b { font-size: 20px; font-weight: 400; color: var(--marble); font-variant-numeric: tabular-nums; }
.speed { display: flex; border: 1px solid rgba(255, 255, 255, .22); border-radius: 5px; overflow: hidden; }
.speed button { background: none; border: 0; padding: 6px 10px; min-width: 36px; font-size: 13px; border-left: 1px solid rgba(255, 255, 255, .14); }
.speed button:first-child { border-left: 0; }
.speed button:hover { background: rgba(255, 255, 255, .09); }
.speed button[aria-pressed="true"] { background: var(--marble); color: var(--ink); }
.speed button.unmet[aria-pressed="true"] { background: rgba(255, 255, 255, .28); color: var(--marble); } /* asked for, but the world is not running at it */
.nav { display: flex; gap: 4px; }
.nav button { background: none; border: 1px solid transparent; border-radius: 5px; padding: 6px 10px; font-size: 14px; }
.nav button:hover { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); }
.nav .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cinnabar); margin-left: 5px; vertical-align: 2px; }
.nav .dot.gold { background: var(--ochre); }

/* ---- side panel ---- */
.panel { position: absolute; left: 12px; top: calc(var(--bar, 58px) + 14px); bottom: 14px; width: 368px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; background: rgba(15, 28, 51, .93); border: 1px solid rgba(255, 255, 255, .13); border-radius: 6px; box-shadow: 0 12px 40px rgba(4, 10, 24, .45); z-index: 4; overflow: hidden; }
@supports (backdrop-filter: blur(6px)) { .panel { background: rgba(15, 28, 51, .84); backdrop-filter: blur(9px) saturate(1.2); } }
.panel header { padding: 14px 16px 11px; border-bottom: 1px solid rgba(255, 255, 255, .11); display: flex; gap: 12px; align-items: flex-start; }
.panel header .t { min-width: 0; flex: 1; }
.panel header .gr { font: 400 12px var(--display); letter-spacing: .3em; color: var(--ochre); }
.panel header h2 { font: 400 25px/1.12 var(--display); text-wrap: balance; }
.panel header p { color: var(--marble-2); font-size: 13.5px; margin-top: 2px; }
.x { flex: none; background: none; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; width: 28px; height: 28px; line-height: 1; font-size: 16px; }
.x:hover { background: rgba(255, 255, 255, .1); }
.body { padding: 13px 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.note { color: var(--marble-2); font-size: 14.5px; line-height: 1.5; max-width: 62ch; }
.sec > h3 { font: 400 13px var(--ui); color: var(--marble-3); margin-bottom: 7px; display: flex; justify-content: space-between; gap: 10px; }
.sec > h3 em { font-style: normal; color: var(--marble-2); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; font-size: 14.5px; }
.kv dt { color: var(--marble-2); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
dl { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 1px 9px 2px 5px; font-size: 13px; background: none; color: inherit; }
button.chip:hover { background: rgba(255, 255, 255, .09); }
.chip::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #888); }
.chip.war { border-color: var(--cinnabar); } .chip.ally { border-color: var(--malachite); } .chip.sub { border-color: var(--ochre); }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.row:first-of-type { border-top: 0; }
.row .nm { font-size: 15px; } .row .nm small { color: var(--marble-3); font-size: 12.5px; margin-left: 6px; }
.row .ds { grid-column: 1 / -1; color: var(--marble-3); font-size: 12.5px; line-height: 1.35; }
.pips { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: 1px; }
.pips i.q { background: repeating-linear-gradient(45deg, var(--marble-3) 0 2px, transparent 2px 4px); }
.plan { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin: 2px 0 6px; font-size: 13px; color: var(--marble-3); }
.plan button { background: var(--ink-3); border: 1px solid rgba(255, 255, 255, .16); border-radius: 3px; color: var(--marble); padding: 3px 7px 4px; font-size: 13px; }
.plan button b { color: var(--marble-3); margin-left: 3px; }
.ledger { margin-top: 14px; overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { padding: 7px 10px 7px 0; text-align: right; white-space: nowrap; border-top: 1px solid rgba(0, 0, 0, .1); font-weight: 400; }
.ledger th, .ledger td.l { text-align: left; }
.ledger thead td, .ledger thead th { border-top: 0; color: #6d6a5f; font-size: 12.5px; }
.ledger tbody th { font-weight: 700; }
.ledger tbody tr { cursor: pointer; } .ledger tbody tr:hover { background: rgba(0, 0, 0, .05); }
.ledger tfoot th, .ledger tfoot td { border-top: 2px solid rgba(0, 0, 0, .25); font-weight: 700; }
.ledger small { color: #6d6a5f; font-size: 12.5px; } .ledger em { font-style: normal; } .ledger .neg { color: #a8321f; } .ledger .idle { color: #8a6410; }
.pips i { width: 8px; height: 8px; border: 1px solid var(--marble-3); border-radius: 1px; } .pips i.on { background: var(--marble); border-color: var(--marble); }
.btn { background: var(--lapis); border: 1px solid #5b84d8; color: #fff; border-radius: 4px; padding: 5px 11px 6px; font-size: 13.5px; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: #4573d2; }
.btn.ghost { background: none; border-color: rgba(255, 255, 255, .3); color: var(--marble); }
.btn.ghost:hover { background: rgba(255, 255, 255, .09); }
.btn.red { background: #a8321f; border-color: var(--cinnabar); }
.btn.red:hover { background: #bf3b26; }
.btn[disabled] { opacity: .42; cursor: not-allowed; }
.btn.wide { width: 100%; padding: 8px 12px; font-size: 14.5px; }
.acts { display: flex; flex-wrap: wrap; gap: 7px; }
.prog { height: 4px; background: rgba(255, 255, 255, .13); border-radius: 2px; overflow: hidden; margin-top: 4px; grid-column: 1 / -1; }
.prog i { display: block; height: 100%; background: var(--ochre); }
.prog.red i { background: var(--cinnabar); }
.alert { border-left: 3px solid var(--cinnabar); background: rgba(207, 70, 50, .14); padding: 8px 11px; border-radius: 0 4px 4px 0; font-size: 14px; }
.alert.gold { border-color: var(--ochre); background: rgba(219, 166, 60, .12); }
.units { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 14.5px; }
.units span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.muster { display: grid; grid-template-columns: 96px 1fr 62px; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.muster input[type=range] { width: 100%; accent-color: var(--ochre); }
.muster output { text-align: right; font-variant-numeric: tabular-nums; }
.msg { font-size: 13.5px; color: var(--ochre); min-height: 1.3em; }
.list button { display: flex; width: 100%; justify-content: space-between; gap: 10px; align-items: baseline; background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .08); padding: 7px 2px; text-align: left; }
.list button:first-child { border-top: 0; }
.list button:hover { background: rgba(255, 255, 255, .06); }
.list small { color: var(--marble-3); font-size: 12.5px; text-align: right; }

/* ---- dock, feed, hint ---- */
.dock { position: absolute; right: 14px; top: calc(var(--bar, 58px) + 16px); display: flex; gap: 8px; z-index: 3; }
.seg { display: flex; background: rgba(15, 28, 51, .86); border: 1px solid rgba(255, 255, 255, .2); border-radius: 5px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--marble); color: var(--ink); }
.feed { position: absolute; right: 14px; bottom: 14px; width: min(400px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.feed button { text-align: left; background: rgba(15, 28, 51, .86); border: 1px solid rgba(255, 255, 255, .13); border-left: 3px solid var(--marble-3); border-radius: 0 4px 4px 0; padding: 6px 11px 7px; font-size: 13.5px; line-height: 1.35; }
.feed button:hover { background: rgba(25, 41, 74, .95); }
.feed button small { display: block; color: var(--marble-3); font-size: 11.5px; }
.feed .k-war, .feed .k-battle { border-left-color: var(--cinnabar); } .feed .k-peace, .feed .k-dip { border-left-color: var(--malachite); } .feed .k-eco { border-left-color: var(--ochre); } .feed .k-city { border-left-color: var(--lapis-hi); }
.hint { position: absolute; left: 50%; top: calc(var(--bar, 58px) + 22px); transform: translateX(-50%); background: var(--marble); color: var(--ink); padding: 8px 16px; border-radius: 4px; font-size: 14.5px; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); z-index: 6; max-width: calc(100vw - 28px); text-align: center; }
.paused { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font: 400 13px var(--display); letter-spacing: .5em; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 6px rgba(0, 20, 50, .8); pointer-events: none; z-index: 2; }

/* ---- stele (modal) ---- */
.modal-root { position: absolute; inset: 0; display: none; z-index: 20; }
.modal-root.on { display: grid; place-items: center; background: rgba(8, 16, 32, .5); padding: 16px; overflow-y: auto; }
.stele { position: relative; width: min(560px, 100%); color: #20242c; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .5)); margin: auto; }
.stele.wide { width: min(880px, 100%); }
.stele .ped { height: 42px; background: linear-gradient(#f7f5ef, #e6e3da); clip-path: polygon(50% 0, 100% 100%, 0 100%); display: grid; place-items: end center; font: 400 11px var(--display); letter-spacing: .6em; color: #8a8576; padding-bottom: 5px; text-indent: .6em; }
.stele .slab { background: linear-gradient(175deg, #f4f2ec 0%, #e9e6dd 60%, #dedbd0 100%); border-top: 3px solid #cfcbbd; padding: 22px 28px 24px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), inset 0 0 0 7px #ebe8df, inset 0 0 0 8px #c9c5b6; }
.stele h2 { font: 400 27px/1.15 var(--display); text-wrap: balance; color: #1a2030; }
.stele .formula { font: 400 10.5px var(--display); letter-spacing: .34em; color: #8a8576; margin-bottom: 8px; }
.stele p { margin-top: 12px; font-size: 16px; line-height: 1.55; max-width: 64ch; }
.stele .opts { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
.stele .opt { text-align: left; background: #1d2f55; color: #f2f0ea; border: 0; border-radius: 3px; padding: 10px 15px 11px; font-size: 15.5px; }
.stele .opt:hover { background: #2b447a; }
.stele .opt small { display: block; color: #b9c4dc; font-size: 13px; line-height: 1.35; margin-top: 2px; }
.stele .opt.alt { background: none; color: #1d2f55; box-shadow: inset 0 0 0 1.5px #1d2f55; }
.stele .opt.alt small { color: #5a6680; }
.stele .opt.alt:hover { background: rgba(29, 47, 85, .08); }
.stele .close { position: absolute; right: 16px; top: 54px; background: none; border: 1px solid #9a9686; color: #55524a; border-radius: 50%; width: 30px; height: 30px; font-size: 17px; line-height: 1; }
.stele .close:hover { background: rgba(0, 0, 0, .06); }
.stele table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.stele th { text-align: left; font-weight: 400; color: #6d6a5f; font-size: 13px; padding: 4px 8px 4px 0; border-bottom: 1px solid #c9c5b6; }
.stele td { padding: 6px 8px 6px 0; border-bottom: 1px solid #d9d5c8; font-variant-numeric: tabular-nums; vertical-align: top; }
.stele td.r, .stele th.r { text-align: right; padding-right: 0; }
.dip .det td:first-child { white-space: nowrap; color: #55524a; padding-right: 18px; }
.battle { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; margin-top: 16px; align-items: start; }
.battle .side h3 { font: 400 18px var(--display); }
.battle .side.r { text-align: right; }
.battle .vs { font: italic 15px var(--display); color: #8a8576; padding-top: 4px; }
.battle .side small { display: block; color: #6d6a5f; font-size: 13px; }
.battle .won { color: #2f7a52; } .battle .lost { color: #a8321f; }
.bar2 { height: 9px; background: #a8321f; border-radius: 2px; overflow: hidden; margin-top: 14px; }
.bar2 i { display: block; height: 100%; background: #2f5fb3; }
.pw { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; }
.pw .b { grid-column: 2 / -1; height: 5px; background: #d3cfc2; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.pw .b i { display: block; height: 100%; }
.sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: -1px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.dip { display: grid; grid-template-columns: 250px 1fr; gap: 22px; margin-top: 14px; min-height: 380px; }
.dip .lst { max-height: 60vh; overflow-y: auto; border-right: 1px solid #c9c5b6; padding-right: 10px; scrollbar-width: thin; }
.dip .lst h4 { font: 400 12.5px var(--ui); color: #6d6a5f; margin: 12px 0 4px; }
.dip .lst h4:first-child { margin-top: 0; }
.dip .lst button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; padding: 4px 6px; border-radius: 3px; color: #20242c; font-size: 15px; text-align: left; }
.dip .lst button:hover { background: rgba(0, 0, 0, .06); }
.dip .lst button[aria-current="true"] { background: #1d2f55; color: #f2f0ea; }
.dip .lst button span:last-child { font-variant-numeric: tabular-nums; opacity: .75; }
.dip .det h3 { font: 400 23px var(--display); }
.dip .det .acts { margin-top: 14px; }
.dip .det .btn.ghost { color: #1d2f55; border-color: #1d2f55; }
.dip .det .btn.ghost:hover { background: rgba(29, 47, 85, .08); }
.dip .det .msg { color: #8a5a10; margin-top: 10px; }
.chron { max-height: 62vh; overflow-y: auto; margin-top: 12px; scrollbar-width: thin; }
.chron div { padding: 6px 0; border-bottom: 1px solid #d9d5c8; font-size: 15px; }
.chron small { color: #6d6a5f; display: block; font-size: 12.5px; }
.cols { columns: 2 260px; column-gap: 28px; margin-top: 6px; }
.cols p { break-inside: avoid; }
kbd { font: 12px var(--ui); border: 1px solid #a9a698; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; background: #f8f7f2; }

/* ---- start screen ---- */
.start { position: absolute; inset: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 620px) 1fr; background: linear-gradient(90deg, rgba(11, 21, 40, .94) 0%, rgba(11, 21, 40, .86) 38%, rgba(11, 21, 40, .25) 72%, rgba(11, 21, 40, 0) 100%); overflow-y: auto; }
.start .col { padding: clamp(22px, 5vh, 56px) clamp(18px, 4vw, 56px); display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.stoich { font: 400 clamp(15px, 2.1vw, 21px) var(--display); color: var(--ochre); display: grid; grid-template-columns: repeat(6, 1.9em); line-height: 1.75; text-align: center; width: max-content; }
.start h1 { font: 400 clamp(40px, 6.4vw, 72px)/.98 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.lede { font-size: 18.5px; line-height: 1.5; color: var(--marble-2); max-width: 46ch; }
.eras { display: flex; flex-direction: column; gap: 10px; }
.era { display: grid; grid-template-columns: 92px 1fr; gap: 2px 16px; text-align: left; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .16); border-radius: 5px; padding: 12px 16px 13px; }
.era:hover { background: rgba(255, 255, 255, .1); border-color: var(--ochre); }
.era .yr { grid-row: 1 / span 2; font: 400 21px/1.2 var(--display); color: var(--ochre); align-self: center; }
.era b { font: 400 20px var(--display); }
.era span { color: var(--marble-2); font-size: 14.5px; }
.start .back { align-self: flex-start; background: none; border: 0; color: var(--marble-2); padding: 0; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.start .back:hover { color: var(--marble); }
.start h2 { font: 400 clamp(28px, 4vw, 40px)/1.05 var(--display); }
.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.state { text-align: left; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .16); border-left: 5px solid var(--c); border-radius: 4px; padding: 8px 12px 9px; }
.state:hover { background: rgba(255, 255, 255, .1); }
.state[aria-pressed="true"] { background: var(--marble); color: var(--ink); }
.state b { font: 400 18px var(--display); display: block; }
.state span { font-size: 12.5px; opacity: .78; }
.brief { border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.brief h3 { font: 400 25px var(--display); }
.brief .gr { font: 400 12px var(--display); letter-spacing: .3em; color: var(--ochre); }
.go { align-self: flex-start; background: var(--ochre); color: #1a1408; border: 0; border-radius: 4px; padding: 11px 24px 12px; font-size: 17px; }
.go:hover { background: #ebb955; }
.load { color: var(--marble-2); font-size: 15px; }
.cont { align-self: flex-start; }
.credit { margin-top: auto; font-size: 12.5px; color: var(--marble-3); max-width: 60ch; }
.worlds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.worlds > span { font-size: 12.5px; color: var(--marble-3); margin-right: 4px; }
.worlds .btn { display: grid; gap: 1px; text-align: left; padding: 7px 12px 8px; }
.worlds .btn b { font: 400 16px var(--display); }
.worlds .btn small { font-size: 12px; color: var(--marble-3); }

@media (max-width: 860px) {
  .panel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 46vh; }
  .feed { display: none; }
  .dock { top: auto; bottom: calc(46vh + 16px); right: 8px; }
  .panel.empty { display: none; } .panel.empty ~ .dock { bottom: 12px; }
  .clock { margin-left: 0; width: 100%; justify-content: space-between; }
  .who small { display: none; }
  .dip { grid-template-columns: 1fr; } .dip .lst { max-height: 26vh; border-right: 0; border-bottom: 1px solid #c9c5b6; }
  .start { grid-template-columns: 1fr; background: rgba(11, 21, 40, .88); }
  .battle { grid-template-columns: 1fr; } .battle .side.r { text-align: left; }
}
/* ---- peace terms: two columns of things that can change hands ---- */
.treaty { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; margin-top: 14px; }
.tcol { display: grid; gap: 7px; align-content: start; }
.tcol h4 { font: 400 17px var(--display); margin: 0 0 2px; color: #1a2030; }
.tcol .none { margin: 0; font-size: 14.5px; color: #6d6a5f; }
.tchip { display: grid; gap: 1px; text-align: left; background: rgba(255, 255, 255, .5); border: 1px solid #b9b5a6; border-radius: 4px; padding: 7px 11px 8px 34px; color: #20242c; position: relative; }
.tchip::before { content: ''; position: absolute; left: 10px; top: 11px; width: 14px; height: 14px; border: 1.5px solid #1d2f55; border-radius: 2px; background: #f8f7f2; }
.tchip[aria-pressed="true"] { background: #1d2f55; border-color: #1d2f55; color: #f2f0ea; }
.tchip[aria-pressed="true"]::before { border-color: var(--ochre); background: var(--ochre) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.8 7.4l2.9 2.9 5.5-6.2' fill='none' stroke='%231d2f55' stroke-width='2.2'/%3E%3C/svg%3E") center / 12px no-repeat; }
.tchip:hover { border-color: #1d2f55; }
.tchip b { font-weight: 400; font-size: 16px; }
.tchip small { font-size: 13px; color: #6d6a5f; }
.tchip[aria-pressed="true"] small { color: #b9c4dc; }
.tsilver { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; border: 1px solid #b9b5a6; border-radius: 4px; padding: 7px 11px 8px; background: rgba(255, 255, 255, .5); font-size: 16px; }
.tsilver small { grid-column: 1 / -1; font-size: 13px; color: #6d6a5f; }
.tsilver .stp { display: inline-flex; align-items: center; gap: 8px; }
.tsilver .stp b { min-width: 74px; text-align: center; font-weight: 400; }
.tsilver .stp button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #1d2f55; background: none; color: #1d2f55; font-size: 18px; line-height: 1; }
.tsilver .stp button:hover { background: rgba(29, 47, 85, .1); }
.tsilver .stp button[disabled] { opacity: .35; cursor: default; }
.verdict { margin-top: 16px; padding: 9px 13px 10px; border-left: 4px solid; font-size: 15.5px; background: rgba(255, 255, 255, .45); }
.verdict.yes { border-color: #2f7a52; color: #1f5a3b; }
.verdict.no { border-color: #a8321f; color: #8a2a1a; }
.tacts { margin-top: 14px; }
.tacts .btn.ghost { color: #1d2f55; border-color: #1d2f55; }
.tacts .btn.ghost:hover { background: rgba(29, 47, 85, .08); }
.stele .fine { font-size: 13.5px; color: #6d6a5f; margin-top: 10px; }

/* ---- the battlefield ----
   Same furniture as the map: one ink bar on top, one below with the army in it. The field keeps the middle. */
#map.battle { cursor: default; }
#map.battle.dragging { cursor: grabbing; }
.plates { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plate { position: absolute; left: 0; top: 0; display: grid; grid-template-columns: 11px 28px; align-items: center; gap: 2px 5px; padding: 3px 6px 3px 4px; border-radius: 10px; background: rgba(15, 28, 51, .84); border: 1px solid rgba(255, 255, 255, .25); will-change: transform; }
.plate i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); } /* a round shield: heavy foot */
.plate.k-light i { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); } /* a javelin point: light troops */
.plate.k-horse i { border-radius: 1px; transform: rotate(45deg) scale(.82); } /* a lozenge: horse */
.plate b { display: block; height: 4px; background: rgba(255, 255, 255, .22); border-radius: 2px; overflow: hidden; }
.plate s { display: block; height: 100%; background: var(--marble); }
.plate span { display: none; grid-column: 1 / -1; font-size: 11.5px; line-height: 1.15; white-space: nowrap; color: var(--marble); }
.plate.mine { border-color: rgba(219, 166, 60, .8); }
.plate.foe { border-color: rgba(207, 70, 50, .85); }
.plate.sel, .plate.hov { grid-template-columns: 11px minmax(28px, 1fr); z-index: 2; }
.plate.sel span, .plate.hov span { display: block; }
.plate.sel { box-shadow: 0 0 0 2px var(--ochre); }
.plate.waver s { background: var(--ochre); }
.plate.rout { background: rgba(239, 237, 231, .92); border-color: #fff; }
.plate.rout s { background: var(--cinnabar); }
.plate.rout span { color: var(--ink); }
.boxsel { position: absolute; border: 1px solid var(--ochre); background: rgba(219, 166, 60, .14); pointer-events: none; z-index: 4; }
.btip { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; width: max-content; max-width: 220px; display: grid; gap: 1px; padding: 6px 10px 7px; border-radius: 4px; background: rgba(15, 28, 51, .94); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.3; }
.btip b { font-weight: 700; font-size: 13.5px; }
.btip span { color: var(--marble-2); }
.btip em { font-style: normal; color: var(--ochre); }

.bhud { position: absolute; inset: 0; pointer-events: none; z-index: 5; display: flex; flex-direction: column; }
.bhud > * { pointer-events: auto; }
.btop { position: relative; flex: none; min-height: 58px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 6px 14px 10px; background: linear-gradient(#13233f, var(--ink)); box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.btop::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; opacity: .55; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='5'%3E%3Cpath d='M0 4.5h4v-4h12v4h4M8 4.5v-2h4' fill='none' stroke='%23dba63c' stroke-width='1'/%3E%3C/svg%3E") repeat-x; }
.btitle { min-width: 0; }
.btitle h1 { font: 400 20px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.btitle small { color: var(--marble-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bal { flex: 1 1 300px; display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; }
.bal .n { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bal .n i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.bal .n b { font-size: 15px; }
.bal .track { height: 10px; border-radius: 2px; overflow: hidden; background: var(--b); box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
.bal .track i { display: block; height: 100%; background: var(--a); border-right: 2px solid var(--marble); transition: width .4s linear; }
.bspeed button { min-width: 38px; }
.bspeed button[disabled] { opacity: .4; cursor: default; }
.tbtn { background: none; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; padding: 5px 11px 6px; font-size: 13.5px; white-space: nowrap; }
.tbtn:hover { background: rgba(255, 255, 255, .09); }
.tbtn[aria-pressed="true"] { background: var(--ochre); border-color: var(--ochre); color: #1c1608; }
.tbtn.warn { border-color: rgba(207, 70, 50, .8); }
.tbtn[disabled] { opacity: .4; cursor: default; }

.bmsgs { flex: none; align-self: flex-start; margin: 10px 0 0 12px; max-width: min(360px, calc(100vw - 24px)); display: grid; gap: 4px; pointer-events: none; }
.bmsgs p { background: rgba(15, 28, 51, .82); border-left: 3px solid var(--marble-3); padding: 4px 10px 5px; font-size: 13.5px; line-height: 1.3; border-radius: 0 3px 3px 0; }
.bmsgs .bad { border-color: var(--cinnabar); }
.bmsgs .good { border-color: var(--malachite); }
.bmsgs .note { border-color: var(--ochre); }
.bdeploy { flex: none; align-self: center; margin-top: 10px; max-width: min(860px, calc(100vw - 24px)); display: flex; align-items: center; gap: 8px 16px; background: rgba(15, 28, 51, .92); border-radius: 5px; padding: 8px 10px 8px 16px; box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
.bdeploy p { color: var(--marble-2); font-size: 14px; line-height: 1.4; }
.bdeploy p b { color: var(--marble); font-weight: 700; }
.bdeploy .btn { padding: 8px 16px 9px; font-size: 15px; }

.bbot { margin-top: auto; flex: none; background: linear-gradient(var(--ink), #0c1729); box-shadow: 0 -2px 14px rgba(0, 0, 0, .35); padding: 8px 12px 10px; display: grid; gap: 8px; }
.orders { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 32px; }
.orders .seg { background: none; }
.orders .seg button { border-left: 1px solid rgba(255, 255, 255, .14); padding: 5px 10px; font-size: 13px; }
.orders .seg button:first-child { border-left: 0; }
.orders .seg button:hover { background: rgba(255, 255, 255, .09); }
.selinfo { font-size: 14px; margin: 0 6px 0 4px; color: var(--marble-2); }
.selinfo b { color: var(--marble); font-weight: 700; margin-right: 4px; }
.selinfo.dim { color: var(--marble-3); }
.obtn { background: var(--ink-3); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; padding: 5px 11px 6px; font-size: 13.5px; white-space: nowrap; }
.obtn:hover { background: #2f4a7d; }
.obtn[aria-pressed="true"] { background: var(--marble); color: var(--ink); border-color: var(--marble); }
.obtn[disabled] { opacity: .4; cursor: default; }
.obtn.x { margin-left: auto; padding: 5px 10px 6px; }
.depth { display: inline-flex; align-items: center; gap: 6px; }
.depth b { font-size: 13.5px; min-width: 62px; text-align: center; font-weight: 400; color: var(--marble-2); }
.cards { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.ucard { flex: 0 0 132px; display: grid; gap: 3px; text-align: left; background: var(--ink-2); border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px; padding: 5px 8px 7px; }
.ucard:hover { background: var(--ink-3); }
.ucard .nm { font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 15px; position: relative; }
.ucard .nm::before { content: ''; position: absolute; left: 0; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--marble-2); }
.ucard.k-light .nm::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ucard.k-horse .nm::before { border-radius: 1px; transform: rotate(45deg) scale(.82); }
.ucard .rw { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ucard .rw b { font-size: 15px; }
.ucard .rw em { font-style: normal; font-size: 12px; color: var(--marble-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard .bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ucard .bar i { display: block; height: 100%; background: var(--malachite); }
.ucard .bar i.mid { background: var(--ochre); }
.ucard .bar i.lo { background: var(--cinnabar); }
.ucard.sel { border-color: var(--ochre); box-shadow: 0 0 0 1px var(--ochre); background: var(--ink-3); }
.ucard.waver .rw em { color: var(--ochre); }
.ucard.rout { border-color: rgba(207, 70, 50, .7); }
.ucard.rout .rw em { color: #f08a78; }
.ucard.gone { opacity: .45; }
.ucard[disabled] { cursor: default; }
.stele .sub { margin-top: 4px; color: #6d6a5f; font-size: 14.5px; }
@media (max-width: 860px) {
  .ledger { max-width: calc(100vw - 76px); } .ledger .x { display: none; } .ledger td.l { white-space: normal; } .ledger table { font-size: 13.5px; } .ledger th, .ledger td { padding-right: 8px; }
  .ledger thead td { white-space: normal; }
  .treaty { grid-template-columns: 1fr; }
  .btitle h1 { font-size: 17px; max-width: 70vw; }
  .bal { order: 5; flex-basis: 100%; }
  .ucard { flex-basis: 118px; }
  .bdeploy { flex-wrap: wrap; padding: 9px 12px 10px; }
  .btop { gap: 5px 10px; padding: 5px 10px 9px; }
  .btitle small { display: none; }
  .btop .tbtn { padding: 5px 9px 6px; }
  .bbot { padding: 6px 8px 8px; gap: 6px; }
  .orders { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .orders > * { flex: none; }
  .selinfo { white-space: nowrap; }
  .selinfo.dim { white-space: normal; flex: 1 1 auto; font-size: 13px; }
  .obtn.x { margin-left: 0; order: -1; }
}
/* a phone held sideways: the field is what matters, so the bars above and below it give up what height they can */
@media (max-height: 480px) {
  .btop { min-height: 0; padding: 3px 10px 7px; }
  .btitle small { display: none; }
  .bmsgs { margin: 5px 0 0 8px; max-width: min(300px, 45vw); gap: 2px; }
  .bmsgs p { font-size: 12px; padding: 2px 8px 3px; }
  .bbot { padding: 4px 8px 5px; gap: 4px; }
  .orders { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-height: 29px; }
  .orders > * { flex: none; }
  .ucard { flex-basis: 150px; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; padding: 3px 7px 4px; }
  .ucard .rw em { display: none; }
  .ucard .bar { grid-column: 1 / -1; height: 3px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* shown while saves are not reaching the server */
.savewarn { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: calc(100% - 28px); padding: 8px 14px 9px; border-radius: 4px; background: #5a1d14; border: 1px solid var(--cinnabar); color: #fbe3de; font-size: 14px; text-align: center; pointer-events: none; }

/* ambitions on the home panel */
.amb { display: grid; gap: 6px; }
.amb .am { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; text-align: left; width: 100%; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 4px; background: rgba(255, 255, 255, .035); color: inherit; font: inherit; font-size: 14.5px; }
.amb button.am { cursor: pointer; } .amb button.am:hover { background: rgba(255, 255, 255, .08); }
.amb .am small { color: var(--marble-3); font-size: 12.5px; white-space: nowrap; } .amb .am small b { color: var(--ochre); font-weight: 500; }

/* the sound switch in the top bar */
.nav .snd { min-width: 34px; padding-left: 8px; padding-right: 8px; font-size: 17px; line-height: 1; }
.nav .snd.off { opacity: .4; text-decoration: line-through; }

/* choosing a world */
.pickh { font-size: clamp(34px, 5vw, 56px); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 10px; }
.wcard { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; text-align: left; padding: 13px 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; color: inherit; font: inherit; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.wcard:hover, .wcard:focus-visible { background: rgba(255, 255, 255, .1); border-color: var(--ochre); transform: translateY(-1px); }
.wcard.here { border-color: rgba(214, 170, 76, .55); }
.wcard svg, .allw svg { width: 54px; height: 54px; fill: none; stroke: var(--ochre); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wcard span { display: grid; gap: 1px; min-width: 0; }
.wcard b { font: 400 19px/1.2 var(--display); }
.wcard small { color: var(--ochre); font-size: 12.5px; letter-spacing: .04em; }
.wcard i { color: var(--marble-3); font-size: 13px; font-style: italic; }
.wcard em { margin-top: 5px; justify-self: start; font-style: normal; font-size: 12px; color: var(--ink, #111a2e); background: var(--ochre); border-radius: 3px; padding: 1px 7px; }
.worlds .allw { grid-template-columns: 34px 1fr; align-items: center; gap: 10px; } .allw svg { width: 34px; height: 34px; }

.chron.small { font-size: 14px; display: grid; gap: 7px; } .chron.small small { display: block; color: var(--marble-3); font-size: 12px; }

/* the notice that a battle has been kept */
#kept { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; max-width: min(92vw, 760px); padding: 10px 14px; background: rgba(16, 24, 44, .96); border: 1px solid var(--ochre); border-radius: 6px; font-size: 14.5px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
#kept[hidden] { display: none; }
#kept button, #kept a { background: none; border: 0; padding: 2px 0; color: var(--ochre); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#kept button[data-k="x"] { text-decoration: none; color: var(--marble-3); font-size: 18px; }

.guestnote { margin: -8px 0 0; font-size: 14px; color: var(--marble-2); max-width: 58ch; } .guestnote a { color: var(--ochre); text-underline-offset: 3px; }

/* the page is an older build than the server: it must be reloaded */
#reload { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 12, 24, .78); }
#reload > div { max-width: min(92vw, 520px); padding: 26px 28px; background: #f1ede2; color: #1b2440; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
#reload h2 { font: 400 28px var(--display); margin: 0 0 10px; } #reload p { margin: 0 0 18px; font-size: 16.5px; }
#reload button { background: #1f2c56; color: #fff; border: 0; padding: 11px 20px; font: inherit; border-radius: 3px; cursor: pointer; }

/* the players on a battlefield shared with others */
.bwho { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--marble-2); }
.bwho span { padding: 3px 9px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; } .bwho span.me { border-color: var(--ochre); color: var(--marble); } .bwho span.away { opacity: .5; }
.bwho i { color: var(--ochre); font-style: italic; }
