:root {
	color-scheme: light;
	--surface-0: #f3f2ef;
	--surface-1: #fcfcfb;
	--border: #e1e0db;
	--grid: #ebeae6;
	--text-primary: #0b0b0b;
	--text-secondary: #52514e;
	--text-muted: #7a7973;
	--allies: #2a78d6;
	--axis: #eb6834;
	--accent-bg: #eef4fc;
	--good: #1f7a3a;
	--bad: #b3261e;
	/* Nation dots (our own colours, picked for contrast with each other and the surfaces) */
	--n-germany: #5f6369;
	--n-japan: #d99a1e;
	--n-soviet_union: #b8352c;
	--n-united_kingdom: #a87a45;
	--n-united_states: #3f8a45;
}
@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--surface-0: #111110;
		--surface-1: #1a1a19;
		--border: #33332f;
		--grid: #2a2a27;
		--text-primary: #f0efec;
		--text-secondary: #c3c2b7;
		--text-muted: #94938b;
		--allies: #3987e5;
		--axis: #d95926;
		--accent-bg: #1c2633;
		--good: #5cc27a;
		--bad: #ef7a72;
		--n-germany: #9ba0a6;
		--n-japan: #e6ad3a;
		--n-soviet_union: #e0574c;
		--n-united_kingdom: #c79a63;
		--n-united_states: #5fb066;
	}
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--surface-0); color: var(--text-primary); }
/* The site header (drawn by site.js): name, menu, Download button; the current page has a bar under it */
:root { --site-h: 52px; --button: #1d64c2; --button-hover: #1853a1; }
@media (prefers-color-scheme: dark) { :root { --button: #2a6fc9; --button-hover: #3a80da; } }
#site { position: sticky; top: 0; z-index: 5; display: flex; align-items: stretch; gap: 4px; height: var(--site-h); padding: 0 24px; background: var(--surface-1); border-bottom: 1px solid var(--border); }
#site a { position: relative; display: flex; align-items: center; text-decoration: none; color: var(--text-secondary); white-space: nowrap; }
#site .brand { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-right: 14px; }
#site nav { display: flex; gap: 4px; }
#site nav a { padding: 0 10px; font-weight: 500; }
#site nav a:hover { color: var(--text-primary); }
#site a.current { color: var(--text-primary); font-weight: 700; }
#site a.current::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--allies); }
#site .download { margin-left: auto; }
#site .download.current::after { left: 0; right: 0; }
#site .download .btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; background: var(--button); color: #fff; font-weight: 600; }
#site .download:hover .btn { background: var(--button-hover); }
#site .download:focus-visible { outline: none; } #site .download:focus-visible .btn { outline: 2px solid var(--allies); outline-offset: 2px; }
#site .short { display: none; }
@media (max-width: 600px) {
	#site { padding: 0 12px; gap: 0; }
	#site .brand { margin-right: 4px; }
	#site nav { gap: 0; }
	#site nav a { padding: 0 8px; }
	#site .download .btn { padding: 6px 10px; gap: 5px; }
	#site .long { display: none; } #site .short { display: inline; }
}
select, input, button { font: inherit; color: inherit; background: var(--surface-0); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
button { cursor: pointer; }
#status { color: var(--text-secondary); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; display: grid; gap: 20px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; }
.card h2 { font-size: 15px; margin: 0 0 4px; }
.card .sub { color: var(--text-muted); font-size: 12.5px; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font-weight: 600; color: var(--text-secondary); font-size: 12.5px; }
td.n, th.n { text-align: right; }
tr.sum td { font-weight: 600; border-top: 1px solid var(--border); }
.mine { background: var(--accent-bg); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot.allies { background: var(--allies); } .dot.axis { background: var(--axis); }
.ndot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 2px; vertical-align: 0; box-shadow: 0 0 0 1px var(--surface-1); }
.ndot.germany { background: var(--n-germany); } .ndot.japan { background: var(--n-japan); } .ndot.soviet_union { background: var(--n-soviet_union); }
.ndot.united_kingdom { background: var(--n-united_kingdom); } .ndot.united_states { background: var(--n-united_states); }
.turn { border-top: 1px solid var(--grid); padding: 10px 0; }
.turn:first-child { border-top: 0; }
.turn h3 { font-size: 14px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.phase { margin: 4px 0 4px 2px; }
.phase > b { color: var(--text-secondary); font-weight: 600; font-size: 12.5px; display: block; }
.phase ul { margin: 2px 0 6px; padding-left: 18px; }
.phase li { margin: 1px 0; }
.win { color: var(--good); font-weight: 600; } .loss { color: var(--bad); font-weight: 600; }
.muted { color: var(--text-muted); }
/* Who won a finished game (Outcome in C#): a green W after the winners, a grey L after the losers, whose names are muted */
.wl { display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 1; padding: 2px 4px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.wl.won { background: var(--good); color: #fff; }
.wl.lost { border: 1px solid var(--border); color: var(--text-muted); padding: 1px 3px; }
.lost-side { color: var(--text-muted); }
details > summary { cursor: pointer; color: var(--text-secondary); margin: 4px 0; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--surface-1); border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font-size: 12.5px; box-shadow: 0 2px 8px rgba(0,0,0,.12); white-space: nowrap; display: none; z-index: 3; }
.empty { color: var(--text-muted); padding: 8px 0; }
#logFilter { width: 220px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.scrollx { overflow-x: auto; }
table.battles td ul { list-style: none; padding-left: 0; margin: 2px 0 4px; }
table.battles { min-width: 860px; }
td.odds { min-width: 240px; font-size: 13px; }
button.mini { font-size: 12px; padding: 2px 8px; }
a { color: var(--allies); }
