/* Agentistan campaigns: the same parchment and inks as the living world, with a little more to hold in your hands. */
:root {
  --paper: #ecdfbf;
  --paper-2: #e3d0a3;
  --paper-3: #d6bf8c;
  --ink: #3a2816;
  --ink-soft: #6a5032;
  --sepia: #8c6b3f;
  --lapis: #27466e;
  --vermilion: #a3361f;
  --gold: #b3852c;
  --turquoise: #2b7d7a;
  --green: #4f7a3a;
  --shadow: rgba(58, 40, 22, 0.28);
  --display: 'Cinzel', 'Amiri', Georgia, serif;
  --body: 'Amiri', Georgia, serif;
  --kufi: 'Reem Kufi', 'Amiri', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #2b2116; color: var(--ink); font: 17px/1.4 var(--body); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--lapis); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; margin: 0; }
.panel { background: linear-gradient(180deg, rgba(240, 228, 196, 0.97), rgba(228, 212, 172, 0.97)); border: 1px solid #b89a63; border-radius: 10px; box-shadow: 0 6px 22px var(--shadow), inset 0 0 0 3px rgba(255, 248, 228, 0.5); }
.btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid #a8885a; background: #f3e6c6; font: 600 15px var(--kufi); letter-spacing: 0.03em; text-decoration: none; color: var(--ink); word-spacing: 0.16em; }
.btn:hover { background: #f8eed6; }
.btn.main { background: var(--vermilion); border-color: #7d2614; color: #fff6e6; }
.btn.main:hover { background: #b8432a; }
.btn.blue { background: var(--lapis); border-color: #1b3150; color: #f3ecdc; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--lapis); text-decoration: underline; font: inherit; }
.sub { color: var(--ink-soft); margin: 4px 0; }
.fine { font-size: 13px; color: var(--ink-soft); }
.note { background: rgba(179, 133, 44, 0.14); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 4px; margin: 10px 0; }

/* ---------- the menu ---------- */
.menu { min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #f3e7c8 0%, var(--paper) 45%, var(--paper-2) 100%); padding: 24px 16px 48px; }
.menu-head { max-width: 1080px; margin: 0 auto 18px; text-align: center; }
.menu-head h1 { font-size: clamp(36px, 6vw, 58px); color: var(--vermilion); margin: 8px 0 6px; }
.menu-head .lede { max-width: 720px; margin: 0 auto; font-size: 19px; color: var(--ink-soft); }
.menu-head .back { display: inline-block; font: 600 14px var(--kufi); letter-spacing: 0.06em; text-decoration: none; word-spacing: 0.16em; }
.era { max-width: 1080px; margin: 30px auto 0; }
.era h2 { font-size: 22px; color: var(--lapis); border-bottom: 2px solid rgba(39, 70, 110, 0.25); padding-bottom: 6px; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.camp { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 14px 12px; border-radius: 10px; border: 1px solid #b89a63; background: #f5ead0; box-shadow: 0 3px 10px var(--shadow); transition: transform 0.15s, box-shadow 0.15s; text-decoration: none; color: var(--ink); }
.camp:hover { transform: translateY(-2px); box-shadow: 0 8px 18px var(--shadow); }
.camp .yr { min-height: 24px; font: 600 13px var(--kufi); color: var(--sepia); letter-spacing: 0.05em; word-spacing: 0.16em; }
.camp h3 { font-size: 19px; line-height: 1.15; }
.camp .as { font-style: italic; color: var(--ink-soft); }
.camp .hook { font-size: 15px; }
.camp .who { display: flex; align-items: center; gap: 10px; }
.camp .who svg, .camp .who img { width: 46px; height: 46px; flex: none; border-radius: 50%; }
.camp .badge { position: absolute; top: 10px; right: 10px; font: 600 12px var(--kufi); padding: 2px 8px; border-radius: 99px; background: rgba(39, 70, 110, 0.12); color: var(--lapis); word-spacing: 0.16em; }
.camp .badge.on { background: var(--vermilion); color: #fff6e6; }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 15px; }
.stars .off { color: rgba(140, 107, 63, 0.35); }
.camp.soon { background: #efe3c4; border-style: dashed; box-shadow: none; cursor: default; }
.camp.soon:hover { transform: none; box-shadow: none; }
.camp.soon .who, .camp.soon .hook { opacity: 0.72; }
.live-runs { max-width: 1080px; margin: 0 auto; padding: 12px 14px; }
.live-runs h2 { font-size: 16px; color: var(--vermilion); margin-bottom: 8px; }
.live-runs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.live-runs li a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: #f5ead0; border: 1px solid #b89a63; text-decoration: none; color: var(--ink); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vermilion); display: inline-block; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.menu-foot { max-width: 1080px; margin: 40px auto 0; text-align: center; color: var(--ink-soft); font-size: 14px; }

/* ---------- the game ---------- */
.game { position: fixed; inset: 0; overflow: hidden; background: #a9bab4; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.game.dragging #map, .game.dragging .marks { cursor: grabbing; }
.coast { fill: none; stroke: #4a3a26; stroke-width: 1.2; opacity: 0.75; pointer-events: none; }
.prov { stroke: none; transition: fill 0.9s, fill-opacity 0.9s; cursor: pointer; }
.prov:hover { fill-opacity: 0.5 !important; }
.edge { fill: none; stroke-linecap: round; pointer-events: none; }
.edge.inner { stroke: rgba(58, 40, 22, 0.32); stroke-width: 0.8; stroke-dasharray: 1 4; }
.edge.border { stroke: rgba(48, 30, 14, 0.8); stroke-width: 1.8; }
.river { fill: none; stroke: #5f8aa0; opacity: 0.75; stroke-linecap: round; pointer-events: none; }
.lane { fill: none; stroke: #3d6b8c; stroke-width: 1.4; stroke-dasharray: 2 5; opacity: 0.6; pointer-events: none; }
.reach { fill: rgba(255, 246, 214, 0.38); stroke: #fff4d2; stroke-width: 2.4; pointer-events: none; }
.arrow { fill: none; stroke-width: 3; stroke-dasharray: 8 5; stroke-linecap: round; opacity: 0.92; animation: march 1.2s linear infinite; pointer-events: none; }
@keyframes march { to { stroke-dashoffset: -13; } }

/* the marks: cities, ground, armies and badges keep their size on the screen at any zoom */
.marks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.marks > * { position: absolute; left: 0; top: 0; will-change: transform; }
.city { pointer-events: auto; cursor: pointer; }
.city .dot { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1.5px #f3e7c8; animation: none; }
.city .nm { position: absolute; left: 0; top: 5px; transform: translateX(-50%); white-space: nowrap; font: 600 12.5px/1 var(--body); color: var(--ink); text-shadow: 0 0 3px #f3e7c8, 0 0 3px #f3e7c8, 0 0 2px #f3e7c8; }
.city.major .nm { font: 700 14px/1 var(--display); letter-spacing: 0.02em; }
.city .ic { position: absolute; left: -9px; top: -24px; width: 18px; height: 18px; }
.city .ic svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 1.5px #f3e7c8); }
.city.besieged .dot { background: var(--vermilion); box-shadow: 0 0 0 2px #f3e7c8, 0 0 0 4px var(--vermilion); }
.marks[data-zoom='0'] .city:not(.major) .nm { display: none; }
.marks[data-zoom='0'] .city:not(.major) .dot { width: 5px; height: 5px; left: -2.5px; top: -2.5px; }
.terrain { width: 24px; margin-left: -12px; opacity: 0.6; }
.terrain svg { width: 24px; display: block; }
.marks[data-zoom='0'] .terrain { display: none; }
.tk { pointer-events: auto; cursor: pointer; --w: 46px; margin-left: calc(var(--i, 0) * (var(--w) + 4px) - var(--w) / 2); margin-top: -46px; width: var(--w); display: flex; flex-direction: column; align-items: center; transition: opacity 0.5s; }
.tk.moving { transition: transform 1.1s ease-in-out, opacity 0.5s; }
.tk .flag { width: 30px; height: 22px; border-radius: 3px 3px 10px 10px; background: var(--c); border: 1.5px solid #2a1c0e; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
.tk b { position: relative; margin-top: -15px; font: 700 12px/1 var(--kufi); color: #fbf3dd; text-shadow: 0 0 2px #2a1c0e, 0 0 2px #2a1c0e, 0 0 3px #2a1c0e; word-spacing: 0.16em; }
.tk small { position: relative; margin-top: 5px; padding: 1px 5px; border-radius: 6px; background: rgba(251, 243, 221, 0.92); font: 600 11px/1.2 var(--kufi); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); word-spacing: 0.16em; }
.tk small:empty { display: none; }
.tk.mine { z-index: 1; }
.tk.sel { z-index: 2; }
.tk.mine .flag { outline: 2px solid rgba(255, 244, 200, 0.85); outline-offset: 1px; }
.tk.hero .flag { border-color: #c9a03c; border-width: 2.5px; }
.tk.hero small::before { content: '★ '; color: var(--gold); }
.tk.sel .flag { outline: 3px solid #f3d27a; outline-offset: 2px; transform: scale(1.12); }
.tk.gone { opacity: 0; }
.tk:hover .flag { transform: scale(1.08); }
.marks[data-zoom='0'] .tk { --w: 40px; }
.marks[data-zoom='0'] .tk small { display: none; }
.badge { pointer-events: auto; cursor: pointer; transform-origin: 0 0; margin: 8px 0 0 -26px; min-width: 52px; text-align: center; padding: 3px 8px; border-radius: 99px; font: 700 12px/1.2 var(--kufi); white-space: nowrap; background: #fbf3dd; border: 1.5px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); word-spacing: 0.16em; }
.badge.good { background: #e1edd4; border-color: var(--green); color: #2f5a22; }
.badge.even { background: #f6ebc9; border-color: var(--gold); color: #6b4d12; }
.badge.bad { background: #f3d9cf; border-color: var(--vermilion); color: #8a2a16; }
.badge:hover { filter: brightness(1.05); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
.burst { pointer-events: none; z-index: 2; width: 26px; height: 26px; margin: -60px 0 0 10px; border-radius: 50%; background: var(--vermilion); border: 2px solid #fbf3dd; padding: 5px; box-shadow: 0 0 0 6px rgba(163, 54, 31, 0.3); animation: burst 1.6s ease-out both; }
.burst.minor { background: var(--sepia); box-shadow: 0 0 0 5px rgba(140, 107, 63, 0.3); }
.burst svg { width: 100%; height: 100%; display: block; }
@keyframes burst { 0% { opacity: 0; scale: 0.3; } 15% { opacity: 1; scale: 1.35; } 30% { scale: 1; } 100% { opacity: 0.75; } }

.hud { position: absolute; top: 12px; left: 12px; display: flex; gap: 12px; align-items: center; padding: 10px 14px; max-width: min(620px, calc(100% - 440px)); }
.hud .face { width: 56px; height: 56px; flex: none; }
.hud .face svg, .hud .face img { width: 100%; height: 100%; border-radius: 50%; }
.hud h1 { font-size: 18px; color: var(--vermilion); line-height: 1.1; }
.hud .date { font: 600 14px var(--kufi); color: var(--lapis); letter-spacing: 0.04em; word-spacing: 0.16em; }
.hud .meters { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; }
.hud .meters b { font: 700 15px var(--kufi); word-spacing: 0.16em; }
.hud .meters small { color: var(--ink-soft); }
.meter { display: inline-block; width: 54px; height: 7px; border-radius: 4px; background: rgba(58, 40, 22, 0.15); vertical-align: middle; overflow: hidden; margin-left: 4px; }
.meter i { display: block; height: 100%; }
.tools { position: absolute; top: 12px; right: 412px; display: flex; gap: 6px; }
.game.watching-run .tools, .game.bare .tools { right: 12px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; border: 1px solid #b89a63; background: rgba(240, 228, 196, 0.95); font: 600 13px var(--kufi); letter-spacing: 0.03em; text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px var(--shadow); word-spacing: 0.16em; }
.tool svg { width: 18px; height: 18px; }
.tool[aria-pressed='true'] { background: var(--lapis); color: #f3ecdc; }

/* the council: a conversation down the right side */
.court { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 388px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.court-toggle { display: none; }
.chat { list-style: none; margin: 0; padding: 12px 12px 4px; flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.m { animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.m.divider { text-align: center; padding: 6px 0 2px; border-top: 1px solid rgba(140, 107, 63, 0.35); margin-top: 6px; }
.m.divider:first-child { border-top: 0; margin-top: 0; }
.m.divider span { display: block; font: 700 17px var(--display); color: var(--lapis); }
.m.divider small { font: 600 12px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); word-spacing: 0.16em; }
.m.msg { display: flex; gap: 8px; align-items: flex-start; }
.m.msg .face { width: 36px; height: 36px; flex: none; }
.m.msg .face svg, .m.msg .face img { width: 36px; height: 36px; border-radius: 50%; }
.m.msg .bubble { background: rgba(255, 250, 235, 0.75); border: 1px solid #d1b98a; border-radius: 4px 12px 12px 12px; padding: 6px 10px; max-width: 100%; }
.m.msg .bubble b { font: 700 13px var(--kufi); color: var(--lapis); word-spacing: 0.16em; }
.m.msg .bubble small { margin-left: 6px; font-size: 12px; color: var(--ink-soft); font-style: italic; }
.m.msg .bubble p { margin: 2px 0 0; font-size: 15.5px; line-height: 1.38; }
.m.msg.you { justify-content: flex-end; }
.m.msg.you .bubble { background: var(--lapis); border-color: #1b3150; color: #f6efdd; border-radius: 12px 4px 12px 12px; max-width: 86%; }
.m.msg[class*='side'] .bubble { border-style: dashed; }
.m.orders { background: rgba(39, 70, 110, 0.07); border-left: 3px solid var(--lapis); border-radius: 4px 10px 10px 4px; padding: 8px 10px; }
.m.orders .who { display: flex; align-items: center; gap: 6px; font: 700 13px var(--kufi); color: var(--lapis); word-spacing: 0.16em; }
.m.orders .who svg, .m.orders .who img { width: 26px; height: 26px; border-radius: 50%; }
.m.orders p { margin: 4px 0 2px; font-size: 14.5px; color: var(--ink-soft); }
.plan { margin: 0; padding-left: 18px; font-size: 15px; }
.plan li { margin: 2px 0; }
.m.card { background: #f8edd2; border: 1px solid #b89a63; border-radius: 10px; padding: 0 12px 12px; overflow: hidden; box-shadow: 0 3px 10px rgba(58, 40, 22, 0.18); }
.m.card .art { display: block; width: calc(100% + 24px); margin: 0 -12px 8px; height: 120px; object-fit: cover; filter: sepia(0.25); }
.m.card h4 { font-size: 16px; color: var(--vermilion); padding-top: 10px; }
.m.card .art + h4 { padding-top: 0; }
.m.card > p { margin: 4px 0 0; font-size: 15px; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.opt { text-align: left; padding: 8px 10px; border-radius: 9px; border: 1px solid #b89a63; background: #fbf3dd; transition: background 0.15s, box-shadow 0.15s; }
.opt b { display: block; font: 700 15px var(--kufi); word-spacing: 0.16em; }
.opt small { display: block; color: var(--ink-soft); font-size: 13.5px; }
.opt .fx { display: block; font: 600 12px var(--kufi); color: var(--sepia); margin-top: 3px; word-spacing: 0.16em; }
.opt:hover:not(:disabled) { background: #fff8e4; box-shadow: 0 2px 8px rgba(58, 40, 22, 0.15); }
.opt.chosen { border-color: var(--lapis); box-shadow: 0 0 0 2px rgba(39, 70, 110, 0.3); background: #eef2f6; }
.opt:disabled { opacity: 0.45; cursor: default; }
.advice { font-size: 14px; color: var(--lapis); margin: 8px 0 0; font-style: italic; }
.m.dispatch { background: rgba(255, 250, 235, 0.6); border: 1px solid #d1b98a; border-radius: 10px; padding: 8px 12px; }
.m.dispatch h4 { font: 600 12.5px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--vermilion); word-spacing: 0.16em; }
.m.dispatch .news li { font-size: 14.5px; }
.m.history { padding: 6px 12px; border-left: 3px solid var(--sepia); font-size: 14.5px; color: var(--ink-soft); }
.m.history h4 { font: 600 12px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); word-spacing: 0.16em; }
.m.history p { margin: 2px 0 0; }
.chips { display: flex; gap: 6px; padding: 6px 12px 0; overflow-x: auto; scrollbar-width: none; flex: none; min-height: 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 5px 11px; border-radius: 99px; border: 1px solid #b89a63; background: #fbf3dd; font-size: 14px; white-space: nowrap; }
.chip:hover { background: #fff8e4; border-color: var(--lapis); }
.chips .thinking { font-size: 14px; padding: 5px 0; }
.chips .thinking::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.say { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px; flex: none; }
.say textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 10px; border: 1px solid #a8885a; background: #fffaf0; font: 16px/1.3 var(--body); color: var(--ink); }
.say textarea:focus { outline: 2px solid rgba(39, 70, 110, 0.45); outline-offset: 0; border-color: var(--lapis); }
.say .btn { min-height: 42px; }
.court > #end-turn { margin: 0 12px 12px; width: auto; flex: none; min-height: 46px; font-size: 16px; }

.zoom { position: absolute; left: 12px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #a8885a; background: rgba(240, 228, 196, 0.95); font: 700 20px var(--kufi); box-shadow: 0 2px 8px var(--shadow); word-spacing: 0.16em; }
.game.bare .hud, .game.bare .court, .game.bare .tools .tool:not(#hide-btn), .game.bare .pop, .game.bare .replay { display: none !important; }
.show-btn { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 8px 14px; border-radius: 99px; border: 1px solid #a8885a; background: rgba(240, 228, 196, 0.95); font: 600 14px var(--kufi); box-shadow: 0 2px 8px var(--shadow); word-spacing: 0.16em; }
.pop { position: fixed; z-index: 5; width: 300px; padding: 12px 14px; }
.pop h3 { font-size: 16px; color: var(--vermilion); margin-bottom: 4px; padding-right: 20px; }
.pop .x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 22px; line-height: 1; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 14px; }
.pop dt { color: var(--ink-soft); }
.pop dd { margin: 0; }
.pop .share { margin-top: 8px; }
.pop .share .btn { min-height: 34px; padding: 5px 12px; font-size: 13.5px; }
.toast { position: absolute; z-index: 6; left: calc(50% - 200px); bottom: 18px; transform: translateX(-50%); max-width: min(520px, calc(100% - 520px)); padding: 10px 16px; border-radius: 10px; background: rgba(43, 33, 22, 0.92); color: #f3ecdc; font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.game.bare .toast, .game.watching-run .toast { left: 50%; max-width: min(560px, calc(100% - 120px)); bottom: 84px; }

/* ---------- sheets: briefings, cards, the turn's news, the scroll ---------- */
.sheet { border: 0; padding: 0; background: transparent; max-width: min(680px, calc(100% - 24px)); width: 100%; max-height: calc(100% - 24px); }
.sheet::backdrop { background: rgba(30, 20, 10, 0.55); }
.sheet > .panel { padding: 20px 22px; max-height: calc(100vh - 40px); overflow: auto; position: relative; }
.sheet .x { position: absolute; z-index: 3; top: 8px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(240, 228, 196, 0.85); font-size: 24px; line-height: 1; color: var(--ink-soft); }
.sheet.wide { max-width: min(1120px, calc(100% - 24px)); }
.sheet h2 { font-size: 24px; color: var(--vermilion); margin-bottom: 4px; }
.brief-head { display: flex; gap: 14px; align-items: center; }
.brief-head svg, .brief-head img { width: 76px; height: 76px; flex: none; border-radius: 50%; }
.howto { background: rgba(39, 70, 110, 0.07); border-left: 3px solid var(--lapis); padding: 8px 12px; border-radius: 4px; margin: 12px 0; font-size: 15.5px; }
.sheet .art { width: calc(100% + 44px); margin: -20px -22px 14px; height: 200px; object-fit: cover; border-radius: 10px 10px 0 0; display: block; filter: sepia(0.25); }
.history { margin-top: 14px; border-top: 1px dashed #b89a63; padding-top: 10px; }
.history h4 { font: 600 13px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); margin-bottom: 4px; word-spacing: 0.16em; }
.goal { background: rgba(163, 54, 31, 0.08); border-left: 3px solid var(--vermilion); padding: 8px 12px; border-radius: 4px; margin: 12px 0; }
.goal b { color: var(--vermilion); }
.forces { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.forces div { border-radius: 8px; padding: 6px 10px; background: rgba(255, 250, 235, 0.6); border-left: 5px solid var(--c); font-size: 14px; }
.forces b { font: 700 14px var(--kufi); display: block; word-spacing: 0.16em; }
.news { list-style: none; margin: 8px 0 0; padding: 0; }
.news li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dotted #c8ad7c; font-size: 15px; }
.news li .i { width: 22px; flex: none; text-align: center; }
.news li.good { color: #2f5a22; }
.news li.bad { color: #8a2a16; }
.news li small { display: block; color: var(--ink-soft); font-size: 13px; }
.said { font-style: italic; margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--c, var(--sepia)); }
.scroll-head { text-align: center; }
.scroll-head .stars { font-size: 30px; }
.verdict { font: 700 26px var(--display); color: var(--lapis); }
.timeline { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 0; margin-top: 12px; font-size: 14px; }
.timeline > div { padding: 6px 8px; border-bottom: 1px dotted #c8ad7c; }
.timeline .h { font: 600 12px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); word-spacing: 0.16em; }
.timeline .d { font: 600 13px var(--kufi); color: var(--lapis); word-spacing: 0.16em; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 10px 0; font-size: 15px; }
.stats b { font: 700 18px var(--kufi); display: block; text-align: center; word-spacing: 0.16em; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share input { flex: 1; min-width: 200px; padding: 8px 10px; border-radius: 8px; border: 1px solid #b89a63; background: #fbf3dd; font: 14px var(--body); }
.nft { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #b89a63; }
.nft img { width: 120px; border-radius: 6px; box-shadow: 0 3px 10px var(--shadow); }
.thinking { color: var(--ink-soft); font-style: italic; }
.watching { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 14px; font: 600 14px var(--kufi); display: flex; gap: 10px; align-items: center; word-spacing: 0.16em; }
.replay { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(620px, calc(100% - 120px)); padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.replay input { flex: 1; accent-color: var(--vermilion); }
.replay small { font: 600 13px var(--kufi); color: var(--lapis); white-space: nowrap; word-spacing: 0.16em; }
.replay .round { width: 36px; height: 36px; font-size: 18px; flex: none; }

/* ---------- the war room ---------- */
.wr-head h2 { font-size: 26px; }
.goalbar { margin: 10px 0 14px; padding: 10px 12px; background: rgba(163, 54, 31, 0.07); border-radius: 8px; border-left: 3px solid var(--vermilion); }
.goalbar b { color: var(--vermilion); }
.goalbar small { display: block; color: var(--ink-soft); margin-top: 4px; }
.bar { display: block; height: 6px; border-radius: 4px; background: rgba(58, 40, 22, 0.13); overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--c, var(--lapis)); border-radius: 4px; }
.bar.big { height: 10px; margin-top: 8px; }
.goalbar .bar > i { background: var(--lapis); }
.sides { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.side { background: rgba(255, 250, 235, 0.7); border: 1px solid #d1b98a; border-top: 5px solid var(--c); border-radius: 10px; padding: 10px 12px; }
.side header { display: flex; gap: 10px; align-items: center; }
.side header svg, .side header img { width: 52px; height: 52px; flex: none; border-radius: 50%; }
.side h3 { font-size: 16px; color: var(--ink); }
.side header small { display: block; color: var(--ink-soft); font-style: italic; }
.rel { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 99px; font: 600 11.5px var(--kufi); letter-spacing: 0.04em; background: rgba(58, 40, 22, 0.1); word-spacing: 0.16em; }
.rel.war { background: #f3d9cf; color: #8a2a16; }
.rel.ally { background: #e1edd4; color: #2f5a22; }
.rel.you { background: var(--lapis); color: #f3ecdc; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 6px; text-align: center; }
.kpis > div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kpis b { font: 700 18px var(--kufi); line-height: 1.1; word-spacing: 0.16em; }
.kpis span { font-size: 12px; color: var(--ink-soft); }
.kpis .bar { width: 100%; }
.spark { width: 100%; max-width: 72px; height: 20px; margin-top: 2px; }
.gauge { width: 60px; height: 36px; }
.gauge text { font: 700 13px var(--kufi); fill: var(--ink); word-spacing: 0.16em; }
.side .armies { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.side .armies li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 4px 0; border-top: 1px dotted #d1b98a; }
.side .armies li span { font: 700 13.5px var(--kufi); word-spacing: 0.16em; }
.side .armies li small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12.5px; }
.persona { font-size: 13.5px; font-style: italic; color: var(--ink-soft); margin: 8px 0 0; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; }
.charts section { background: rgba(255, 250, 235, 0.6); border: 1px solid #d1b98a; border-radius: 10px; padding: 10px 12px; }
.charts h4, .people h4 { font: 600 12.5px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); margin-bottom: 6px; word-spacing: 0.16em; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { fill: none; stroke: rgba(58, 40, 22, 0.4); }
.chart .grid { stroke: rgba(58, 40, 22, 0.12); stroke-dasharray: 3 3; }
.chart .yl { font: 11px var(--kufi); fill: var(--ink-soft); text-anchor: end; word-spacing: 0.16em; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.people { margin-top: 14px; }
.people h5 { font: 600 12px var(--kufi); letter-spacing: 0.08em; text-transform: uppercase; color: var(--vermilion); margin: 10px 0 4px; word-spacing: 0.16em; }
.living, .fallen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.living li { padding: 4px 10px; border-radius: 8px; background: rgba(255, 250, 235, 0.7); border-left: 4px solid var(--c); font-size: 14px; }
.living li b { display: block; font: 700 13.5px var(--kufi); word-spacing: 0.16em; }
.living li small { color: var(--ink-soft); font-size: 12.5px; }
.fallen li { padding: 4px 10px; border-radius: 8px; background: rgba(58, 40, 22, 0.08); color: var(--ink-soft); font-size: 14px; }

@media (max-width: 760px) {
  .hud { right: 12px; padding: 8px 10px; gap: 8px; max-width: none; top: 8px; left: 8px; right: 8px; }
  .hud .face { width: 40px; height: 40px; }
  .hud h1 { font-size: 15px; }
  .hud .meters { font-size: 12.5px; gap: 2px 10px; }
  .hud .goalmeter { display: none; }
  .tools { top: auto; bottom: auto; right: 8px; top: 96px; flex-direction: column; }
  .game.bare .tools, .game.watching-run .tools { right: 8px; }
  .tool { padding: 7px; }
  .tool span { display: none; }
  .court { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 46%; border-radius: 14px 14px 0 0; transition: height 0.25s ease; }
  .court.open { height: 86%; }
  .court-toggle { display: block; flex: none; height: 20px; border: 0; background: none; padding: 0; }
  .court-toggle i { display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 3px; background: rgba(58, 40, 22, 0.3); }
  .chat { padding-top: 0; }
  .say textarea { font-size: 16px; }
  .zoom { left: auto; right: 8px; bottom: calc(46% + 12px); }
  .toast, .game.bare .toast, .game.watching-run .toast { left: 50%; top: 104px; bottom: auto; max-width: calc(100% - 32px); }
  .timeline { grid-template-columns: 80px 1fr; }
  .timeline .hist { grid-column: 2; color: var(--ink-soft); }
  .pop { left: 12px !important; right: 12px; width: auto; top: 110px !important; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .replay { width: calc(100% - 24px); }
}

/* the war room: conditions in force on a side */
.cond { margin: 4px 0 0; padding: 2px 8px; border-radius: 6px; font-size: 14px; }
.cond.good { background: rgba(79, 122, 58, 0.12); color: #2f5a22; }
.cond.bad { background: rgba(163, 54, 31, 0.1); color: #8a2a16; }

/* fleets: a crossing by sea, and an army that came by sea */
.arrow.sea { stroke-dasharray: 2 6; }
.shipmark { width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.shipmark svg, .tk .ship-ic svg { width: 100%; height: 100%; display: block; }
.tk .ship-ic { width: 20px; height: 20px; margin-bottom: -4px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45)); }

/* the field of battle: the ground as a board, the units as counters, the officers beside it */
.sheet.wide .panel:has(.field) { max-width: min(1240px, 96vw); }
.field .f-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.field .f-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; margin-top: 8px; }
.field .f-board svg { width: 100%; height: auto; display: block; border-radius: 8px; border: 2px solid #6a5032; box-shadow: 0 4px 14px var(--shadow); background: #e6d7a9; touch-action: manipulation; }
.field .f-help { font-size: 13px; color: var(--ink-soft); font-style: italic; margin: 6px 0 0; }
.f-tile { stroke: rgba(58, 40, 22, 0.12); stroke-width: 1; cursor: pointer; }
.f-reach { fill: rgba(243, 210, 122, 0.45); stroke: #b3852c; stroke-width: 2; cursor: pointer; }
.f-order { stroke: #27466e; stroke-width: 3; stroke-dasharray: 6 5; stroke-linecap: round; pointer-events: none; }
.f-order.attack { stroke: #a3361f; }
.f-unit { cursor: pointer; }
.f-unit .f-chip { stroke: #2a1c0e; stroke-width: 2; }
.f-unit.mine .f-chip { stroke: #f3e7c8; stroke-width: 2.5; }
.f-unit.sel .f-chip { stroke: #f3d27a; stroke-width: 4; }
.f-unit.hold .f-chip { stroke-dasharray: 5 3; }
.f-men { font: 700 12px var(--kufi); fill: #fbf3dd; text-anchor: middle; paint-order: stroke; stroke: #2a1c0e; stroke-width: 3px; }
.f-morale { fill: #f3d27a; }
.f-talk { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.f-talk ol { list-style: none; margin: 0; padding: 8px; flex: 1; max-height: 360px; overflow: auto; border-radius: 8px; background: rgba(245, 234, 208, 0.85); border: 1px solid rgba(140, 107, 63, 0.4); font-size: 15px; }
.f-talk li { padding: 4px 0; border-bottom: 1px dotted rgba(140, 107, 63, 0.35); }
.f-talk li.you { color: var(--lapis); font-style: italic; }
.f-talk li.herald { color: var(--sepia); font-size: 14px; }
.f-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.f-chips .pick { font: 600 12.5px var(--kufi); padding: 4px 9px; border-radius: 99px; border: 1px solid #b89a63; background: #f5ead0; cursor: pointer; word-spacing: 0.16em; }
.f-say { display: flex; gap: 6px; }
.f-say input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid #b89a63; background: #fbf3dd; font: 15px var(--body); }
.f-act { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { .field .f-body { grid-template-columns: 1fr; } .f-talk ol { max-height: 200px; } }
