:root {
	--corner-cut-large: 10px;
	--corner-cut-small: 9px;
	--menubar-h: 3.25rem;
	--sidebar-w: 240px;
}

.maplibregl-ctrl-attrib {
	display: none !important;
}

body {
	font-family: "Archivo Narrow", sans-serif; font-weight: 400; font-style: normal;
	background: #0a0a14;
}

/* ==============================
   Map
   ============================== */

#map {
	display: block; position: fixed;
	left: 0; top: var(--menubar-h); right: 0; bottom: 0;
}

/* ==============================
   Menubar
   ============================== */

#menubar {
	display: block; position: fixed;
	left: 0; top: 0; right: 0; height: var(--menubar-h);
	z-index: 30;
	background: url(/cdn/gt/i/steel.jpg); background-size: cover; box-shadow: 0 0 2px 1px #0009;
	font-family: "Saira Stencil One", sans-serif; font-weight: 400; font-style: normal; line-height: 1;
}
#menubar .bar {
	display: flex; align-items: center;
	height: var(--menubar-h);
}
#menubar .logo {
	flex: 0 0 fit-content;
	padding: 0 1.25rem;
	font-size: 2.25rem; color: #fff7;
}
#menubar .logo a {
	color: #fff7; text-decoration: none;
}
#menubar .world {
	flex: 0 0 auto;
	padding: 0 1rem;
	font-family: "Archivo Narrow", sans-serif;
}
#menubar .world-name {
	color: #fff9; font-size: 0.875rem; font-weight: 600;
}
#menubar .menu {
	flex: 1 1 auto;
}
#menubar .tabs {
	display: inline-flex; gap: 0.75rem;
}
#menubar .tab {
	flex: 1 1 auto;
	position: relative; align-items: center; justify-content: center; z-index: 1;
	padding: 0.5rem 1.75rem 0.5rem 1.25rem;
	font-size: 1rem; color: #eee; text-transform: uppercase; text-shadow: 1px 1px 1px #000b;
	cursor: pointer;
}
#menubar .tab i {
	margin-right: 0.375rem;
}
#menubar .tab::before {
	content: "";
	position: absolute; z-index: -2;
	inset: 0;
	background: #666;
	clip-path: polygon(
		var(--corner-cut-large) 0,
		100% 0,
		100% calc(100% - var(--corner-cut-large)),
		calc(100% - var(--corner-cut-large)) 100%,
		0 100%,
		0 var(--corner-cut-large)
	);
}
#menubar .tab::after {
	content: "";
	position: absolute; z-index: -1;
	inset: 1px;
	background: linear-gradient(180deg, #111 0%, #333 50%, #111 50%, #222 100%);
	clip-path: polygon(
		var(--corner-cut-small) 0,
		100% 0,
		100% calc(100% - var(--corner-cut-small)),
		calc(100% - var(--corner-cut-small)) 100%,
		0 100%,
		0 var(--corner-cut-small)
	);
}
#menubar .tab:hover::after {
	background: linear-gradient(180deg, #333 0%, #555 50%, #333 50%, #444 100%);
}
#menubar .tab.active::after {
	background: linear-gradient(180deg, #711 0%, #922 50%, #711 50%, #922 100%);
}
#menubar .tab.disabled {
	color: #666; cursor: default; pointer-events: none;
}
#menubar .tab.disabled::after {
	background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 50%, #222 100%);
}
#menubar .tab.tab-more,
#menubar .tab.tab-close {
	padding: 0.5rem 1.25rem;
}
#menubar .tab.tab-more {
	display: none;
}
#menubar .tab.tab-more i,
#menubar .tab.tab-close i {
	margin-right: 0;
	font-size: 1.125rem;
}
#menubar .tab.tab-close a {
	display: inline-flex; align-items: center;
}
#menubar .tab a { color: inherit; text-decoration: none; }

/* Tab dropdown (shown on small screens) */
#tab-dropdown {
	display: none;
	position: fixed;
	top: var(--menubar-h);
	z-index: 40;
	min-width: 180px;
	background: linear-gradient(180deg, #1a1a1a 0%, #222 100%);
	border: 1px solid #666;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
	padding: 4px 0;
}
#tab-dropdown.open {
	display: block;
}
.td-item {
	display: flex; align-items: center;
	padding: 0.625rem 1rem;
	font-family: "Saira Stencil One", sans-serif; font-size: 0.875rem;
	color: #eee; text-transform: uppercase; text-shadow: 1px 1px 1px #000b;
	cursor: pointer;
	white-space: nowrap;
}
.td-item:hover:not(.disabled) {
	background: rgba(255, 255, 255, 0.08);
}
.td-item.active {
	background: linear-gradient(180deg, #711 0%, #922 100%);
	color: #fff;
}
.td-item.disabled {
	color: #666; cursor: default; pointer-events: none;
}
.td-item i {
	margin-right: 0.5rem; width: 1rem; text-align: center;
}
#menubar .player {
	flex: 0 0 auto;
	display: flex; align-items: center; gap: 0.5rem;
	padding: 0 1.25rem 0 0.5rem;
	font-family: "Archivo Narrow", sans-serif;
}
#menubar .treasury {
	font-size: 0.875rem;
	font-family: 'Source Code Pro', monospace;
	letter-spacing: -0.3px;
	padding: 2px 8px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}
#menubar .treasury.tb-negative { color: #ef6b6b; }
#menubar .player .color {
	display: inline-block;
	width: 14px; height: 14px;
	border-radius: 3px;
	border: 1px solid rgba(255, 255, 255, 0.3);
}
#menubar .player .country {
	color: #e0e0e0; font-size: 0.875rem; font-weight: 600;
}
#menubar .player .browsing {
	color: #888; font-size: 0.875rem; font-style: italic;
}

/* ==============================
   Sidebar
   ============================== */

#sidebar {
	display: block; position: fixed;
	right: 0; top: var(--menubar-h); bottom: 0; width: var(--sidebar-w);
	z-index: 20;
	overflow-y: auto;
	pointer-events: none;
}
#sidebar .panel {
	display: block; position: relative; z-index: 0;
	margin: 0.75rem; padding: 0.5rem 0.875rem 0.875rem 0.875rem;
	pointer-events: auto;
}
#sidebar .panel::before {
	content: "";
	position: absolute; z-index: -2;
	inset: 0;
	background: #666;
	clip-path: polygon(
		var(--corner-cut-large) 0,
		100% 0,
		100% calc(100% - var(--corner-cut-large)),
		calc(100% - var(--corner-cut-large)) 100%,
		0 100%,
		0 var(--corner-cut-large)
	);
}
#sidebar .panel::after {
	content: "";
	position: absolute; z-index: -1;
	inset: 1px;
	background: linear-gradient(180deg, #111 0%, #333 1.75rem, #111 1.75rem, #222 100%);
	clip-path: polygon(
		var(--corner-cut-small) 0,
		100% 0,
		100% calc(100% - var(--corner-cut-small)),
		calc(100% - var(--corner-cut-small)) 100%,
		0 100%,
		0 var(--corner-cut-small)
	);
}
#sidebar .panel h3 {
	margin-bottom: 0.75rem;
	font-family: "Saira Stencil One", sans-serif; font-weight: 400; font-style: normal; font-size: 0.875rem; line-height: 1;
	color: #eee;
}
#sidebar .panel h3 i {
	margin-right: 0.375rem;
}

/* Map controls: mode + overlay buttons */
#sidebar .options {
	display: flex;
	margin: 0.75rem 0 0 0;
}
#sidebar .options:first-child {
	margin-top: 0;
}
#sidebar .options .option {
	flex: 1 1 auto;
	padding: 0.5rem 0;
	background: linear-gradient(180deg, #222 0%, #333 50%, #222 50%, #333 100%);
	border: 1px solid #666; border-left-width: 0;
	text-align: center; text-shadow: 1px 1px 1px #000b;
	color: #ccc; font-size: 0.875rem;
	cursor: pointer;
}
#sidebar .options .option.active {
	background: linear-gradient(180deg, #711 0%, #922 50%, #711 50%, #922 100%);
	color: #fff;
}
#sidebar .options .option:hover:not(.active) {
	background: linear-gradient(180deg, #333 0%, #444 50%, #333 50%, #444 100%);
	color: #fff;
}
#sidebar .options .option:first-child {
	border-left-width: 1px;
}

/* Overlay legend (inside sidebar) */
#overlay-legend {
	margin-top: 0.625rem;
	padding: 0.375rem 0;
	font-size: 0.75rem;
	color: #ccc;
	line-height: 1.4;
	display: none;
}
#overlay-legend.ov-visible {
	display: block;
}
.ov-legend-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.ov-legend-swatch {
	display: flex;
	align-items: center;
	gap: 3px;
	white-space: nowrap;
}
.ov-legend-swatch i {
	display: inline-block;
	width: 10px; height: 10px;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.2);
}
.ov-legend-sep {
	height: 1px;
	background: rgba(255, 255, 255, 0.12);
	margin: 4px 0;
}
.ov-legend-bar {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ov-legend-bar .ov-gradient {
	width: 100%; height: 8px;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.15);
}
.ov-legend-bar .ov-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
	color: #999;
}

/* Sector hover info */
.si-name {
	font-family: "Saira Stencil One", sans-serif; font-size: 0.875rem;
	margin-bottom: 0.375rem; color: #eee;
}
.si-row {
	display: flex; justify-content: space-between;
	font-size: 0.875rem; padding: 0.0625rem 0; color: #ccc;
}
.si-label { color: #888; }
.si-capital { color: #f0c040; font-size: 0.75rem; margin-top: -0.25rem; margin-bottom: 0.25rem; }
.si-stale { color: #e8913a; font-size: 0.75rem; }
.si-fog { color: #4a7a9e; font-size: 0.75rem; margin-top: 0.125rem; }
.si-color {
	display: inline-block; width: 10px; height: 10px;
	border-radius: 2px; margin-right: 4px; vertical-align: middle;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==============================
   Map Popups
   ============================== */

.maplibregl-popup-content {
	background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
	border: 1px solid #666;
	color: #eee; font-family: "Archivo Narrow", sans-serif;
	padding: 0; border-radius: 0;
	clip-path: polygon(
		var(--corner-cut-small) 0, 100% 0,
		100% calc(100% - var(--corner-cut-small)),
		calc(100% - var(--corner-cut-small)) 100%,
		0 100%, 0 var(--corner-cut-small)
	);
	box-shadow: 0 0 8px 2px #0009;
}
.maplibregl-popup-close-button {
	color: #888; font-size: 1.125rem; padding: 0.25rem 0.5rem;
}
.maplibregl-popup-close-button:hover { color: #fff; }
.maplibregl-popup-tip { border-top-color: #666; }

.popup {
	padding: 0.75rem 1rem; min-width: 180px; max-width: 220px;
}
.pp-entity-popup {
	min-width: 280px; max-width: 320px;
}
.pp-title {
	font-family: "Saira Stencil One", sans-serif; font-size: 0.875rem;
	color: #eee; margin-bottom: 0.375rem;
}
.pp-owner { font-size: 0.75rem; font-weight: 600; margin-bottom: 0.25rem; }
.pp-str-line { font-size: 0.75rem; color: #999; margin-bottom: 0.25rem; }
.pp-str-val { color: #ccc; font-weight: 600; }
.pp-stat-grid { margin: 0.25rem 0; }
.pp-stat-row { display: flex; justify-content: space-between; font-size: 0.875rem; padding: 0.1rem 0; }
.pp-stat-label { color: #999; }
.pp-stat-value { color: #ccc; font-weight: 600; text-align: right; }
.pp-air-units { margin: 0.375rem 0; }
.pp-air-row { display: flex; align-items: center; justify-content: space-between; padding: 0.2rem 0; font-size: 0.875rem; color: #ccc; }
.pp-air-name { white-space: nowrap; }
.pp-air-str { color: #999; }
.pp-air-empty { font-size: 0.75rem; color: #666; margin: 0.25rem 0; font-style: italic; }
.pp-btn-sm { font-size: 0.875rem; padding: 0.15rem 0.4rem; }
.pp-air-launch-row { display: flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0; font-size: 0.875rem; color: #ccc; }
.pp-air-launch-row .pp-air-name { flex: 1; white-space: nowrap; }
.pp-air-qty { background: #2a2a3e; color: #ccc; border: 1px solid #444; border-radius: 3px; padding: 0.1rem 0.2rem; font-size: 0.75rem; }
.pp-air-cancel-row { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0; font-size: 0.875rem; color: #ccc; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pp-btn-x { background: none; border: none; color: #ef6b6b; cursor: pointer; padding: 0.1rem 0.3rem; font-size: 0.875rem; }
.pp-btn-x:hover { color: #ff9999; }
.bm-row-disabled td { color: #555; }
.bm-full { text-align: center; color: #666; font-style: italic; font-size: 0.75rem; }
.bm-cell-empty { background: none; }
.bm-air-cell { cursor: pointer; }
.pp-body { font-size: 0.875rem; color: #ccc; }
.pp-body .si-row { font-size: 0.875rem; }
.pp-badge { font-size: 0.75rem; padding: 0.125rem 0.375rem; margin-bottom: 0.25rem; border-radius: 2px; }
.pp-badge.pp-unknown { background: #333; color: #888; }
.pp-badge.pp-stale { background: rgba(232, 145, 58, 0.15); color: #e8913a; }
.pp-capital-star { color: #f0c040; font-size: 0.75rem; }
.pp-swatch {
	display: inline-block; width: 10px; height: 10px;
	border-radius: 2px; margin-right: 4px; vertical-align: middle;
	border: 1px solid rgba(255, 255, 255, 0.2);
}
.pp-you { color: #8f8; font-size: 0.75rem; }
.pp-view-country { color: #6cf; cursor: pointer; font-size: 0.875rem; margin-left: 4px; }
.pp-view-country:hover { text-decoration: underline; }
.pp-subtitle { font-size: 0.875rem; color: #ccc; margin-bottom: 0.375rem; }
.pp-fog-note { color: #4a7a9e; font-size: 0.75rem; margin-top: 0.25rem; }
.pp-claimed { color: #888; font-size: 0.75rem; }
.pp-entities { margin-top: 0.375rem; }
.pp-entity {
	display: flex; align-items: center; gap: 0.375rem;
	font-size: 0.875rem; padding: 0.125rem 0; color: #ccc;
}
.pp-icon { width: 16px; height: 16px; }
.pp-str { color: #888; margin-left: auto; font-size: 0.75rem; }
.pp-actions {
	margin-top: 0.5rem; border-top: 1px solid #444; padding-top: 0.5rem;
}
.pp-act-group {
	display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
	margin-top: 0.5rem;
}
.pp-act-group:first-child { margin-top: 0; }
.pp-btn {
	display: block; width: 100%; padding: 0.35rem 0.5rem;
	background: linear-gradient(180deg, #711 0%, #922 50%, #711 50%, #922 100%);
	border: 1px solid #666; color: #fff; text-shadow: 1px 1px 1px #000b;
/*	font-family: "Saira Stencil One", sans-serif; font-size: 0.75rem; text-transform: uppercase; */
    font-family: "Archivo Narrow", sans-serif; font-size: 1rem; font-weight: 600;
	cursor: pointer; text-align: left;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-icon-fixed { display: inline-block; width: 1.1rem; text-align: center; }
.pp-btn:hover { filter: brightness(1.2); }

/* Land attacks (red) */
.pp-btn.pp-btn-atk-land {
	background: linear-gradient(180deg, #711 0%, #922 50%, #711 50%, #922 100%);
}
.pp-btn.pp-btn-atk-land-cancel {
	background: linear-gradient(180deg, #300 0%, #511 50%, #300 50%, #511 100%);
}

/* Sea attacks (orange) */
.pp-btn.pp-btn-atk-sea {
	background: linear-gradient(180deg, #842 0%, #b63 50%, #842 50%, #b63 100%);
}
.pp-btn.pp-btn-atk-sea-cancel {
	background: linear-gradient(180deg, #421 0%, #632 50%, #421 50%, #632 100%);
}

/* Air attacks (yellow) */
.pp-btn.pp-btn-atk-air {
	background: linear-gradient(180deg, #a82 0%, #db4 50%, #a82 50%, #db4 100%);
}
.pp-btn.pp-btn-atk-air-cancel {
	background: linear-gradient(180deg, #541 0%, #762 50%, #541 50%, #762 100%);
}

/* Boarding (orange — same family as sea) */
.pp-btn.pp-btn-board {
	background: linear-gradient(180deg, #842 0%, #b63 50%, #842 50%, #b63 100%);
}

/* Build / sell (green) and cancel build (dark green) */
.pp-btn.pp-btn-build {
	background: linear-gradient(180deg, #351 0%, #572 50%, #351 50%, #572 100%);
}
.pp-btn.pp-btn-build-cancel {
	background: linear-gradient(180deg, #131 0%, #251 50%, #131 50%, #251 100%);
}

/* Generic neutral cancel (legacy) */
.pp-btn-cancel {
	background: linear-gradient(180deg, #333 0%, #444 50%, #333 50%, #444 100%);
}

/* Gold (legacy) */
.pp-btn.pp-btn-gold {
	background: linear-gradient(180deg, #a8882e 0%, #c8a84e 50%, #a8882e 50%, #c8a84e 100%);
	color: #1a1a1a;
}

/* Capital scores in popup */
.pp-scores { margin-top: 0.375rem; }
.cs-row {
	display: flex; align-items: center; gap: 0.375rem;
	font-size: 0.875rem; padding: 0.125rem 0; color: #ccc;
}
.cs-label { flex: 0 0 auto; min-width: 60px; color: #888; }
.cs-bar {
	flex: 1 1 auto; height: 5px;
	background: rgba(255, 255, 255, 0.1); border-radius: 2px;
	overflow: hidden; display: inline-block;
}
.cs-fill {
	height: 100%; border-radius: 2px; display: block;
	background: #5da7b3;
}
.cs-val { flex: 0 0 auto; font-size: 0.75rem; color: #888; min-width: 20px; text-align: right; }

/* Entity sections in popups */
.se-section { margin-top: 6px; }
.se-header {
	color: #888; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px;
	margin-bottom: 2px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding-top: 4px;
}
.se-item { font-size: 0.875rem; line-height: 1.5; color: #ccc; }
.se-dot {
	display: inline-block; width: 6px; height: 6px;
	border-radius: 2px; margin-right: 3px; vertical-align: middle;
}
.se-stat { color: #888; font-size: 0.75rem; }
.se-cat { color: #666; font-size: 0.75rem; }
.se-empty { color: #555; font-size: 0.75rem; font-style: italic; margin-top: 4px; }

/* ==============================
   Tab Content Panels
   ============================== */

/* Dashboard */
#dashboard {
	position: fixed;
	top: var(--menubar-h); left: 0; right: var(--sidebar-w); bottom: 0;
	z-index: 5;
	background: #0a0a14;
	overflow: hidden;
}
#dashboard .db-scroll {
	width: 100%; height: 100%;
	overflow-y: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	display: flex; flex-direction: column; gap: 0.75rem;
}
.db-panel {
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
}
.db-panel:empty { display: none; }
#db-summary {
	font-size: 1rem; color: #ccc; line-height: 1.8;
}
.db-columns {
	display: flex; gap: 0.75rem;
}
.db-col { flex: 1; min-width: 0; }
.db-section-title {
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.8px;
	margin-bottom: 10px; padding-bottom: 6px;
	border-bottom: 1px solid #444;
}
.db-row {
	display: flex; justify-content: space-between; align-items: center;
	padding: 4px 0; font-size: 1rem; color: #ccc;
}
.db-row .db-label { color: #999; }
.db-row .db-val { font-family: 'Source Code Pro', monospace; font-size: 1rem; }
.db-row .db-val-pos { color: #6be67b; }
.db-row .db-val-neg { color: #ef6b6b; }
.db-row.db-subtotal {
	color: #bbb;
	border-top: 1px solid #333;
	margin-top: 6px; padding-top: 6px;
}
.db-row.db-total {
	font-weight: 700; color: #fff;
	border-top: 1px solid #444;
	margin-top: 6px; padding-top: 8px;
}
.db-row.db-sub { padding-left: 12px; font-size: 1rem; }
.db-row.db-sub .db-label { color: #777; }
.db-group-header {
	font-size: 1rem; font-weight: 600; color: #888;
	margin-top: 10px; margin-bottom: 2px;
}
.db-warn {
	margin-top: 12px; padding: 8px 12px;
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #ef6b6b; font-size: 1rem;
}
.db-bar-row {
	margin-top: 10px; height: 24px;
	display: flex; overflow: hidden;
	font-size: 1rem; font-weight: 600;
}
.db-bar-income {
	background: #2d6b3f; color: #b5e8c3;
	display: flex; align-items: center; justify-content: center; white-space: nowrap;
}
.db-bar-upkeep {
	background: #6b2d2d; color: #e8b5b5;
	display: flex; align-items: center; justify-content: center; white-space: nowrap;
}
.db-tier-near { color: #6be67b; }
.db-tier-mid { color: #e6c96b; }
.db-tier-far { color: #ef6b6b; }
.db-supply-cost { color: #e6c96b; font-size: 0.875rem; margin-left: 4px; }
#db-build-cost { font-size: 1rem; color: #ccc; }
.db-vp-label { color: #8888aa; font-size: 1rem; margin-bottom: 6px; }
.db-vp-bar {
	position: relative; height: 16px;
	background: #1a1a2e; overflow: hidden; margin-bottom: 4px;
}
.db-vp-fill { height: 100%; transition: width 0.3s; }
.db-vp-threshold { position: absolute; top: 0; width: 2px; height: 100%; background: #f0c040; }
.db-vp-stats {
	display: flex; justify-content: space-between;
	color: #8888aa; font-size: 1rem;
}
.db-trend-row { display: flex; gap: 16px; margin-bottom: 6px; }
.db-trend-item { color: #ccc; font-size: 1rem; }
.db-trend-up { color: #4caf50; font-weight: 700; }
.db-trend-down { color: #f44336; font-weight: 700; }
.db-trend-flat { color: #888; }
.db-sparkline-label { color: #666; font-size: 1rem; margin-bottom: 2px; }
#db-sparkline { display: block; }

/* Compass selector (perpetual attack) */
.compass-selector {
	position: absolute; z-index: 50;
	pointer-events: none;
}
.compass-arrow {
	position: absolute;
	width: 36px; height: 36px;
	display: flex; align-items: center; justify-content: center;
	color: rgba(255, 255, 255, 0.6);
	font-size: 22px;
	font-weight: 900;
	cursor: pointer;
	pointer-events: auto;
	border-radius: 50%;
	transition: color 0.12s, background 0.12s;
	text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
.compass-arrow:hover {
	color: #fff;
	background: rgba(93, 167, 179, 0.5);
}
.compass-cancel {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	color: #666; font-size: 0.75rem;
	pointer-events: none;
}

/* Orders panel */
#orders {
	position: fixed;
	top: var(--menubar-h); left: 0; right: var(--sidebar-w); bottom: 0;
	z-index: 5;
	background: #0a0a14;
	overflow: hidden;
}
#orders .ord-scroll {
	width: 100%; height: 100%;
	overflow-y: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	display: flex; flex-direction: column; gap: 0.75rem;
}
#ord-summary {
	font-size: 1rem; color: #ccc; line-height: 1.8;
}
.ord-lock {
	font-size: 1rem; font-weight: 600;
	padding: 2px 8px;
}
.ord-lock.ord-open { color: #6be67b; }
.ord-lock.ord-locked { color: #ef6b6b; }
.ord-phase { margin-bottom: 14px; }
.ord-phase:last-child { margin-bottom: 0; }
.ord-phase-header {
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.6px;
	margin-bottom: 6px; padding-bottom: 4px;
	border-bottom: 1px solid #444;
}
.ord-phase-count {
	color: #666; font-weight: 400; font-size: 1rem; margin-left: 6px;
}
.ord-item {
	display: flex; align-items: center; justify-content: space-between;
	padding: 6px 10px; margin-bottom: 2px;
	background: rgba(255, 255, 255, 0.03);
	font-size: 1rem; color: #ccc;
	transition: background 0.12s;
}
.ord-item:hover { background: rgba(255, 255, 255, 0.07); }
.ord-item-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ord-item-icon { color: #888; font-size: 1rem; flex-shrink: 0; }
.ord-item-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-item-cost {
	font-family: 'Source Code Pro', monospace;
	font-size: 1rem; color: #888; margin-left: 10px; flex-shrink: 0;
}
.ord-item-cost.ord-cost-warn { color: #ef6b6b; }
.ord-cancel {
	background: none; border: none; color: #666; cursor: pointer;
	font-size: 1rem; padding: 2px 6px; margin-left: 6px;
	transition: color 0.12s, background 0.12s;
}
.ord-cancel:hover { color: #ef6b6b; background: rgba(239, 107, 107, 0.1); }
.ord-empty {
	color: #555; font-size: 1rem; font-style: italic;
	padding: 20px 0; text-align: center;
}
.ord-perp { font-size: 1rem; color: #b88a5a; margin-left: 4px; }

/* Order bulk cancel */
.ord-bulk-bar {
	display: none; align-items: center; gap: 10px;
	padding: 8px 12px;
	border: 1px solid #666;
	background: linear-gradient(180deg, #3a2020 0%, #2a1818 100%);
}
.ord-bulk-count { color: #f66; font-size: 1rem; font-weight: 600; }
.ord-bulk-cancel {
	background: #6a2a2a; color: #fff;
	border: 1px solid #8a3a3a;
	padding: 4px 10px; font-size: 1rem; cursor: pointer;
}
.ord-bulk-cancel:hover { background: #8a3a3a; }
.ord-check { flex-shrink: 0; margin-right: 6px; accent-color: #f0c040; }
.ord-select-all { background: none; padding: 4px 10px; }
.ord-select-all-label { color: #777; font-size: 0.9rem; }

/* Country creation modal */
#create-country .cc-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, 0.6); z-index: 100;
}
#create-country .cc-card {
	position: fixed; top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	z-index: 101; width: 380px;
	background: #1e1e38;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px; padding: 24px; color: #e0e0e0;
}
.cc-header { font-size: 1.125rem; font-weight: 700; color: #fff; margin-bottom: 16px; }
.cc-error {
	display: none; color: #ef4444; font-size: 0.875rem; margin-bottom: 12px;
	padding: 6px 10px; background: rgba(239, 68, 68, 0.1); border-radius: 4px;
}
.cc-field { margin-bottom: 14px; }
.cc-field label {
	display: block; font-size: 0.875rem; color: #aaa; margin-bottom: 4px;
	font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.cc-field input[type="text"] {
	width: 100%; padding: 8px 10px;
	border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px;
	background: rgba(255, 255, 255, 0.06); color: #e0e0e0;
	font-size: 0.875rem; font-family: 'Source Sans Pro', sans-serif;
	outline: none; box-sizing: border-box;
}
.cc-field input[type="text"]:focus { border-color: #5da7b3; }
.cc-palette { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-swatch {
	width: 28px; height: 28px; border-radius: 4px;
	border: 2px solid transparent; cursor: pointer;
	transition: border-color 0.15s, transform 0.1s;
}
.cc-swatch:hover { transform: scale(1.15); border-color: rgba(255, 255, 255, 0.4); }
.cc-swatch.cc-selected { border-color: #fff; transform: scale(1.15); }
.cc-actions { display: flex; gap: 10px; margin-top: 18px; }
.cc-btn-submit {
	flex: 1; padding: 9px 0; border: none; border-radius: 4px;
	background: #c8a84e; color: #1a1a2e;
	font-size: 0.875rem; font-weight: 700; cursor: pointer;
	transition: background 0.15s;
}
.cc-btn-submit:hover { background: #dab94f; }
.cc-btn-submit:disabled { background: #555; color: #888; cursor: default; }
.cc-btn-cancel {
	padding: 9px 16px;
	border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px;
	background: transparent; color: #aaa; font-size: 0.875rem; cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
}
.cc-btn-cancel:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

/* Build modal */
#build-modal .bm-overlay,
#sell-modal .bm-overlay,
#repair-modal .bm-overlay,
#bug-modal .bm-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, 0.5); z-index: 100;
}
#build-modal .bm-card,
#sell-modal .bm-card,
#repair-modal .bm-card,
#bug-modal .bm-card {
	position: fixed; top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	z-index: 101; width: 420px; max-height: 70vh; overflow-y: auto;
	background: #1e1e38;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px; padding: 20px; color: #e0e0e0;
}
.bm-header { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.bm-error {
	display: none; color: #ef4444; font-size: 0.875rem; margin-bottom: 10px;
	padding: 6px 10px; background: rgba(239, 68, 68, 0.1); border-radius: 4px;
}
.bm-section-title {
	color: #888; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 4px;
}
.bm-grid {
	width: 100%; border-collapse: separate; border-spacing: 2px;
	margin-bottom: 8px;
}
.bm-grid th {
	font-size: 0.75rem; color: #666; padding: 2px 0; text-align: center;
	width: 28px; font-weight: 400;
}
.bm-grid-name {
	font-size: 0.875rem; color: #ccc; padding-right: 6px; white-space: nowrap;
	text-align: left;
}
.bm-cell {
	width: 28px; height: 26px; text-align: center; vertical-align: middle;
	font-size: 0.75rem; color: #888; cursor: pointer;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 3px;
	transition: background 0.1s, border-color 0.1s;
}
.bm-cell:hover {
	background: rgba(93, 167, 179, 0.15); border-color: rgba(93, 167, 179, 0.3);
	color: #e0e0e0;
}
.bm-cell-sel {
	background: rgba(93, 167, 179, 0.35); border-color: rgba(93, 167, 179, 0.6);
	color: #fff; font-weight: 600;
}
.bm-grid-footer {
	display: flex; align-items: center; justify-content: space-between;
	margin-top: 8px; padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.bm-qty-row { display: flex; align-items: center; gap: 8px; }
.bm-qty-row label { font-size: 0.875rem; color: #aaa; }
.bm-qty-row select {
	background: #2a2a4a; color: #e0e0e0; border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px; padding: 4px 8px; font-size: 0.875rem; cursor: pointer;
}
.bm-btn-create {
	padding: 6px 18px; border: none; border-radius: 4px;
	background: rgba(93, 167, 179, 0.6); color: #fff;
	font-size: 0.875rem; font-weight: 600; cursor: pointer;
	transition: background 0.12s;
}
.bm-btn-create:hover { background: rgba(93, 167, 179, 0.8); }
.bm-option {
	display: flex; align-items: center; justify-content: space-between;
	padding: 8px 12px; margin-bottom: 4px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 5px; cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
}
.bm-option:hover { background: rgba(93, 167, 179, 0.1); border-color: rgba(93, 167, 179, 0.3); }
.bm-option-name { font-size: 1rem; font-weight: 600; color: #e0e0e0; }
.bm-option-stat { font-size: 0.9375rem; color: #888; margin-top: 2px; }
.bm-option-cost {
	font-family: 'Source Code Pro', monospace;
	font-size: 0.875rem; color: #6be67b; flex-shrink: 0;
}
.bm-btn-cancel {
	margin-top: 10px; width: 100%; padding: 8px 0;
	border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px;
	background: transparent; color: #aaa; font-size: 0.875rem; cursor: pointer;
}
.bm-btn-cancel:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

/* Build modal rows (per-unit-type, qty + Build button) */
.bm-row {
	display: flex; align-items: center; gap: 8px;
	padding: 6px 10px; margin-bottom: 4px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 4px;
}
.bm-row-disabled { opacity: 0.55; }
.bm-row-name { flex: 1; font-size: 0.9375rem; color: #e0e0e0; }
.bm-cap-label { color: #888; font-size: 0.75rem; font-weight: 400; }
.bm-row-note { font-size: 0.75rem; color: #888; font-style: italic; }
.bm-row-qty { display: flex; align-items: center; gap: 4px; }
.bm-row-qty label { font-size: 0.75rem; color: #888; }
.bm-row-qty .bm-qty-sel {
	background: #2a2a4a; color: #e0e0e0; border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px; padding: 2px 6px; font-size: 0.875rem; cursor: pointer;
}
.bm-row-cost {
	font-family: 'Source Code Pro', monospace;
	font-size: 0.875rem; color: #6be67b; min-width: 64px; text-align: right;
}
.bm-row-build {
	padding: 4px 12px; border: none; border-radius: 4px;
	background: rgba(93, 167, 179, 0.6); color: #fff;
	font-size: 0.875rem; font-weight: 600; cursor: pointer;
	transition: background 0.12s;
}
.bm-row-build:hover { background: rgba(93, 167, 179, 0.85); }

/* Air unit picker rows (launch / paradrop / sell) */
.apl-list { display: flex; flex-direction: column; gap: 4px; }
.apl-row {
	display: flex; align-items: center; gap: 8px;
	padding: 6px 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 4px; cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
}
.apl-row:hover { background: rgba(93, 167, 179, 0.12); border-color: rgba(93, 167, 179, 0.35); }
.apl-row-disabled { opacity: 0.45; cursor: default; }
.apl-row-disabled:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
.apl-icon { color: #9fc5cc; width: 1.25rem; text-align: center; }
.apl-name { flex: 1; font-size: 0.9375rem; color: #e0e0e0; }
.apl-hp { font-size: 0.75rem; font-family: 'Source Code Pro', monospace; }
.apl-hp-hi { color: #6be67b; }
.apl-hp-mid { color: #e8c946; }
.apl-hp-lo { color: #e07a7a; }
.apl-skill { font-size: 0.75rem; color: #bbb; font-family: 'Source Code Pro', monospace; }
.apl-price {
	font-family: 'Source Code Pro', monospace;
	font-size: 0.875rem; color: #6be67b; min-width: 64px; text-align: right;
}
.apl-chev { color: #666; font-size: 0.75rem; }
.apl-queued { font-size: 0.75rem; color: #888; font-style: italic; }
.apl-hint { font-size: 0.75rem; color: #888; margin-top: 4px; text-align: right; }
.apl-count { font-size: 0.875rem; color: #bbb; font-family: 'Source Code Pro', monospace; }

.apl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.apl-cell {
	padding: 4px 6px;
	background: rgba(93, 167, 179, 0.08);
	border: 1px solid rgba(93, 167, 179, 0.2);
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	line-height: 1.15;
}
.apl-cell:hover { background: rgba(93, 167, 179, 0.2); border-color: rgba(93, 167, 179, 0.45); }
.apl-cell-disabled { opacity: 0.4; cursor: default; }
.apl-cell-disabled:hover { background: rgba(93, 167, 179, 0.08); border-color: rgba(93, 167, 179, 0.2); }
.apl-cell-id { font-family: 'Source Code Pro', monospace; font-size: 0.875rem; color: #9fc5cc; }
.apl-cell-hp { font-family: 'Source Code Pro', monospace; font-size: 0.75rem; }
.apl-cell-skill { font-family: 'Source Code Pro', monospace; font-size: 0.75rem; color: #bbb; }
.apl-cell-tag { font-size: 0.75rem; color: #888; font-style: italic; }

/* Sector panel action buttons (used in popups) */
.sp-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.sp-action-btn {
	padding: 4px 10px;
	border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px;
	background: rgba(255, 255, 255, 0.06); color: #ccc;
	font-size: 0.875rem; cursor: pointer;
	transition: background 0.12s, color 0.12s;
}
.sp-action-btn:hover { background: rgba(93, 167, 179, 0.2); color: #fff; border-color: rgba(93, 167, 179, 0.4); }
.sp-action-btn:disabled { color: #555; cursor: default; border-color: rgba(255, 255, 255, 0.06); }

/* Notify toast */
#gt-notify {
	display: none; position: fixed; z-index: 9999;
	left: 50%; bottom: 1.5rem; transform: translateX(-50%);
	padding: 0.6rem 1.25rem;
	background: rgba(18, 22, 30, 0.92); border: 1px solid rgba(255,255,255,0.15);
	color: #ddd; font-family: "Archivo Narrow", sans-serif; font-size: 0.9rem;
	text-align: center; white-space: nowrap; pointer-events: none;
}

/* Movement mode indicator */
.move-mode-banner {
	position: fixed;
	top: calc(var(--menubar-h) + 10px);
	left: 50%; transform: translateX(-50%);
	z-index: 25; padding: 6px 18px;
	background: rgba(93, 167, 179, 0.9); color: #fff;
	font-size: 0.875rem; font-weight: 600; border-radius: 4px;
	display: none;
}
.ap-done-btn {
	display: inline-block; margin-left: 8px; padding: 2px 10px;
	background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4);
	color: #fff; font-size: 0.875rem; font-weight: 600; border-radius: 3px;
	cursor: pointer; vertical-align: middle;
}
.ap-done-btn:hover { background: rgba(255, 255, 255, 0.35); }
.group-select-box {
	position: fixed; display: none; z-index: 50;
	border: 2px solid rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.08);
	pointer-events: none; box-sizing: border-box;
}
.ap-done-marker {
	width: 22px; height: 22px;
	background: rgba(255, 255, 255, 0.9); color: #111;
	display: flex; align-items: center; justify-content: center;
	font-size: 0.75rem; cursor: pointer; border-radius: 3px;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
.ap-done-marker:hover { background: #fff; }
.bombard-target-marker {
	width: 20px; height: 20px;
	background: rgba(255, 80, 40, 0.85); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 50%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 1.5px solid rgba(255, 255, 255, 0.6);
	font-family: 'Archivo Narrow', sans-serif;
}
.bombard-target-marker:hover { background: rgba(255, 100, 60, 1); }
.ord-path-badge { font-size: 1rem; color: #5da7b3; margin-left: 4px; }

/* ==============================
   Diplomacy Tab
   ============================== */

#diplomacy {
	position: fixed;
	top: var(--menubar-h); left: 0; right: var(--sidebar-w); bottom: 0;
	z-index: 5;
	background: #0a0a14;
	overflow: hidden;
}
.dip-scroll {
	width: 100%; height: 100%;
	overflow-y: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	display: flex; flex-direction: column; gap: 0.75rem;
}
.dip-section {
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
}
.dip-section:empty { display: none; }
.dip-header {
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.8px;
	margin-bottom: 10px; padding-bottom: 6px;
	border-bottom: 1px solid #444;
}
.dip-empty { color: #666; font-size: 1rem; padding: 6px 0; }
.proposal-card {
	padding: 10px 0; border-bottom: 1px solid #333;
}
.proposal-card:last-child { border-bottom: none; }
.proposal-actions { margin-top: 8px; }
.treaty-partner { font-size: 1rem; font-weight: 500; color: #ccc; margin-bottom: 4px; }
.treaty-bar { height: 4px; background: #333; border-radius: 2px; margin: 6px 0; overflow: hidden; }
.treaty-bar-fill { height: 100%; background: #6be67b; border-radius: 2px; transition: width 0.3s; }
.treaty-info { font-size: 1rem; color: #888; margin-bottom: 4px; }
.treaty-renewal-badge { display: inline-block; font-size: 1rem; color: #e6c96b; margin: 4px 0; }
.treaty-renewal-badge.treaty-warn { color: #ef6b6b; }
.treaty-renewal-actions { margin: 6px 0 2px; }
.dip-btn {
	display: inline-block; padding: 5px 12px; border: none; border-radius: 4px;
	font-size: 1rem; cursor: pointer; transition: background 0.12s;
}
.dip-btn-accept { background: #2e7d4a; color: #fff; }
.dip-btn-accept:hover { background: #39965a; }
.dip-btn-decline { background: #7d2e2e; color: #fff; margin-left: 4px; }
.dip-btn-decline:hover { background: #963939; }
.dip-btn-small { background: #3a3f4a; color: #ccc; padding: 4px 10px; font-size: 1rem; }
.dip-btn-small:hover { background: #4a4f5a; }
.ctp-swatch {
	display: inline-block; width: 12px; height: 12px;
	border-radius: 50%; margin-right: 8px; vertical-align: middle;
	border: 1px solid rgba(255, 255, 255, 0.15);
}
.dip-country-row {
	display: flex; align-items: center; padding: 8px 4px;
	border-bottom: 1px solid #333; border-left: 3px solid transparent;
}
.dip-country-row:hover { background: rgba(255, 255, 255, 0.03); }
.dip-country-row:last-child { border-bottom: none; }
.dip-row-eliminated { opacity: 0.45; }
.dip-country-name {
	flex: 0 0 auto; min-width: 160px;
	font-size: 1rem; font-weight: 500; color: #ccc;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dip-eliminated { font-weight: 400; color: #666; font-size: 1rem; }
.dip-country-status {
	flex: 1 1 auto; padding: 0 12px;
	font-size: 1rem; color: #888;
}
.dip-treaty-inline .treaty-bar { margin: 2px 0 4px; }
.dip-status-pending { color: #e6c96b; }
.dip-status-incoming { color: #6be6a7; }
.dip-status-expired { color: #666; }
.dip-country-actions {
	flex: 0 0 auto; white-space: nowrap;
}
.dip-propose-form { display: inline-flex; align-items: center; gap: 6px; }
.dip-dur-select {
	background: #2a2d35; color: #e0e0e0; border: 1px solid #444;
	border-radius: 3px; padding: 4px 6px; font-size: 1rem;
}
.dip-dur-label { font-size: 1rem; color: #888; margin-right: 2px; }
/* ==============================
   Report
   ============================== */

#report {
	position: fixed;
	top: var(--menubar-h); left: 0; right: var(--sidebar-w); bottom: 0;
	z-index: 5;
	background: #0a0a14;
	overflow: hidden;
}
#report .rpt-scroll {
	width: 100%; height: 100%;
	overflow-y: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	display: flex; flex-direction: column; gap: 0.75rem;
}
.rpt-header {
	display: flex; align-items: center; justify-content: space-between;
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
}
.rpt-title {
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.8px;
}
.rpt-cycle-nav { display: flex; align-items: center; gap: 6px; }
.rpt-nav-btn {
	background: #2a2d3a; border: 1px solid #3a3d4a;
	color: #ccc; padding: 4px 10px; cursor: pointer;
	font-size: 0.875rem;
}
.rpt-nav-btn:hover { background: #3a3d4a; }
.rpt-nav-disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.rpt-cycle-select {
	background: #2a2d3a; border: 1px solid #3a3d4a;
	color: #e0e0e0; padding: 4px 8px; font-size: 0.875rem;
}
.rpt-summary {
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
	font-size: 1rem; color: #ccc; line-height: 1.8;
}
.rpt-gain { color: #6be67b; }
.rpt-loss { color: #ef6b6b; }
.rpt-sections {
	display: flex; flex-direction: column; gap: 0.75rem;
}
.rpt-section {
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
}
.rpt-section-title {
	display: flex; align-items: center; gap: 8px;
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.8px;
	margin-bottom: 10px; padding-bottom: 6px;
	border-bottom: 1px solid #444;
	cursor: pointer; user-select: none;
}
.rpt-section-title:hover { color: #ccc; }
.rpt-section-title i:first-child { width: 16px; text-align: center; color: #888; }
.rpt-collapse-icon { margin-left: auto; font-size: 0.875rem; color: #666; }
.rpt-empty { color: #666; font-size: 1rem; font-style: italic; padding: 4px 0; }
.rpt-territory-gain {
	padding: 6px 0 6px 10px; margin: 4px 0;
	border-left: 3px solid #6be67b;
	font-size: 1rem; color: #ccc;
}
.rpt-territory-loss {
	padding: 6px 0 6px 10px; margin: 4px 0;
	border-left: 3px solid #ef6b6b;
	font-size: 1rem; color: #ccc;
}
.rpt-sector-link { color: #7ab4ff; cursor: pointer; text-decoration: none; }
.rpt-sector-link:hover { text-decoration: underline; }
.rpt-country-link { cursor: pointer; font-weight: 600; }
.rpt-country-link:hover { text-decoration: underline; }
.rpt-combat-tag {
	font-size: 0.75rem; background: #444; color: #aaa;
	padding: 1px 5px; margin-left: 4px;
}
.rpt-combat-summary {
	font-size: 1rem; color: #ccc; margin-bottom: 8px;
	padding-bottom: 8px; border-bottom: 1px solid #333;
}
.rpt-battle { padding: 6px 0 6px 10px; margin: 3px 0; font-size: 1rem; color: #ccc; }
.rpt-battle-won { border-left: 3px solid #6be67b; }
.rpt-battle-lost { border-left: 3px solid #ef6b6b; }
.rpt-battle-phase {
	font-size: 0.75rem; background: #2a2d3a; color: #888;
	padding: 1px 6px;
}
.rpt-battle-power { font-size: 0.75rem; color: #777; }
.rpt-air-event { padding: 5px 0; font-size: 1rem; color: #ccc; }
.rpt-nuclear {
	padding: 8px 12px; margin: 4px 0;
	background: rgba(239, 107, 107, 0.1);
	border: 1px solid rgba(239, 107, 107, 0.3);
	color: #ef6b6b; font-size: 1rem;
}
.rpt-nuclear i { margin-right: 4px; }
.rpt-treaty-blocked { padding: 5px 0; font-size: 1rem; color: #888; font-style: italic; }
.rpt-intel-event { padding: 5px 0; font-size: 1rem; color: #ccc; }
.rpt-intel-event i { width: 16px; text-align: center; color: #6a7aaa; margin-right: 4px; }
.rpt-production-item {
	padding: 5px 0; font-size: 1rem; color: #ccc;
	display: flex; align-items: center; gap: 6px;
}
.rpt-prod-count { font-weight: 700; color: #7ab4ff; min-width: 30px; }
.rpt-prod-cost { color: #888; font-size: 0.75rem; margin-left: auto; }
.rpt-prod-failures { padding: 5px 0; font-size: 1rem; color: #ef6b6b; }
.rpt-economy-grid { display: flex; flex-direction: column; gap: 4px; }
.rpt-eco-row {
	display: flex; justify-content: space-between;
	padding: 4px 0; font-size: 1rem; color: #ccc;
}
.rpt-eco-label { color: #888; }
.rpt-eco-val { font-weight: 600; }
.rpt-eco-net { border-top: 1px solid #333; padding-top: 8px; margin-top: 4px; }
.rpt-eco-warning { padding: 6px 0; color: #e6c96b; font-size: 1rem; }
.rpt-eco-warning i { margin-right: 4px; }
.rpt-dip-event { padding: 5px 0; font-size: 1rem; color: #ccc; }
.rpt-dip-event i { margin-right: 4px; }
.rpt-scorched-count, .rpt-bridge-summary { font-size: 1rem; color: #ccc; padding: 4px 0; }
.rpt-scorched-event { font-size: 1rem; color: #999; padding: 3px 0; }

/* Notification badge */
.tab-badge {
	display: inline-block;
	background: #f44336; color: #fff;
	font-size: 0.75rem; font-weight: 700; font-family: "Archivo Narrow", sans-serif;
	width: 14px; height: 14px; line-height: 14px;
	text-align: center; border-radius: 50%;
	margin-left: 4px; vertical-align: top;
}

/* ==============================
   Victory / Pre-start Overlays
   ============================== */

.victory-overlay {
	position: fixed; inset: 0; z-index: 100;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, 0.7);
}
.victory-banner {
	background: #1a1a3a; border: 2px solid #f0c040;
	border-radius: 12px; padding: 32px 40px;
	text-align: center; max-width: 480px; width: 90%;
	box-shadow: 0 0 40px rgba(240, 192, 64, 0.3);
}
.vb-title {
	font-size: 2.25rem; font-weight: 700; color: #f0c040;
	margin-bottom: 16px; letter-spacing: 2px; text-transform: uppercase;
}
.vb-victor {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	font-size: 1.25rem; color: #fff; margin-bottom: 12px;
}
.vb-color {
	display: inline-block; width: 18px; height: 18px;
	border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.3);
}
.vb-details { color: #8888aa; font-size: 0.875rem; line-height: 1.6; margin-bottom: 20px; }
.vb-actions { display: flex; gap: 12px; justify-content: center; }
.vb-btn {
	padding: 8px 20px;
	border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px;
	background: rgba(255, 255, 255, 0.08); color: #fff;
	font-size: 0.875rem; cursor: pointer; transition: background 0.15s;
}
.vb-btn:hover { background: rgba(255, 255, 255, 0.15); }
.vb-btn-primary { background: rgba(240, 192, 64, 0.2); border-color: #f0c040; color: #f0c040; }
.vb-btn-primary:hover { background: rgba(240, 192, 64, 0.35); }
.vb-reopen {
	display: inline-block; margin-left: 10px;
	padding: 2px 8px; font-size: 0.875rem; color: #f0c040;
	background: rgba(240, 192, 64, 0.15);
	border: 1px solid rgba(240, 192, 64, 0.3);
	border-radius: 4px; cursor: pointer; vertical-align: middle;
}
.vb-reopen:hover { background: rgba(240, 192, 64, 0.3); }

.prestart-overlay {
	position: fixed; inset: 0; z-index: 100;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, 0.5);
}
.prestart-banner {
	background: #1a1a3a;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px; padding: 28px 36px;
	text-align: center; max-width: 400px; width: 90%;
}
.ps-title { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.ps-details { color: #8888aa; font-size: 0.875rem; line-height: 1.6; margin-bottom: 16px; }
.ps-countdown { color: #66bbff; font-size: 0.9375rem; font-weight: 600; margin-bottom: 16px; }

/* ==============================
   Batch Selection Bar
   ============================== */

#batch-bar {
	position: fixed; bottom: 20px; left: 50%;
	transform: translateX(-50%);
	background: rgba(20, 20, 30, 0.95);
	border: 1px solid #f0c040; border-radius: 8px;
	padding: 8px 16px; display: none;
	align-items: center; gap: 12px;
	z-index: 800;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.bb-count { color: #f0c040; font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
#batch-bar button {
	background: #334; color: #fff;
	border: 1px solid #556; border-radius: 4px;
	padding: 5px 12px; font-size: 0.875rem; cursor: pointer;
}
#batch-bar button:hover { background: #445; }
#batch-bar .bb-build { background: #2a6a3a; border-color: #3a8a4a; }
#batch-bar .bb-build:hover { background: #3a8a4a; }

/* Replay controls bar */
.replay-bar {
	position: fixed;
	top: calc(var(--menubar-h) + 10px);
	left: 50%; transform: translateX(-50%);
	background: rgba(20, 20, 30, 0.95);
	border: 1px solid #556; border-radius: 8px;
	padding: 6px 14px; display: none;
	align-items: center; gap: 10px;
	z-index: 800;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.rp-phase { color: #f0c040; font-weight: 700; font-size: 0.875rem; min-width: 100px; }
.rp-counter { color: #888; font-size: 0.875rem; min-width: 60px; }
.rp-btn {
	background: #334; color: #ccc;
	border: 1px solid #556; border-radius: 4px;
	padding: 4px 8px; font-size: 0.875rem; cursor: pointer;
}
.rp-btn:hover { background: #445; color: #fff; }
.rp-stop { color: #f66; }
.rp-speed {
	background: #223; color: #ccc;
	border: 1px solid #556; border-radius: 4px;
	padding: 3px 6px; font-size: 0.875rem;
}
.rpt-replay-btn {
	background: #334; color: #f0c040;
	border: 1px solid #556; border-radius: 4px;
	padding: 4px 10px; font-size: 0.875rem; cursor: pointer; margin-left: 8px;
}
.rpt-replay-btn:hover { background: #445; }

/* Right-click context menu */
.ctx-menu {
	position: fixed;
	background: rgba(20, 20, 30, 0.95);
	border: 1px solid #556; border-radius: 6px;
	padding: 4px 0; z-index: 900; min-width: 140px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.ctx-item {
	padding: 7px 14px; color: #ccc;
	font-size: 0.875rem; cursor: pointer; white-space: nowrap;
}
.ctx-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.ctx-item i { width: 16px; text-align: center; margin-right: 6px; color: #888; }

/* ==============================
   Responsive
   ============================== */

@media (max-width: 1439px) {
	#menubar .tab {
		display: none;
	}
	#menubar .tab.active,
	#menubar .tab.tab-more,
	#menubar .tab.tab-close {
		display: inline-flex;
	}
	#menubar .world {
		display: none;
	}
	#menubar .player .country,
	#menubar .player .color {
		display: none;
	}
}

@media (max-width: 767px) {
	:root {
		--sidebar-w: 0px;
	}
	#sidebar {
		display: none;
		position: fixed;
		top: calc(var(--menubar-h) + 52px); right: 0;
		width: 240px;
	}
	#sidebar.mp-open {
		display: block;
	}
	#sidebar.mp-open #panel-sector {
		display: none;
	}
	#batch-bar {
		bottom: 10px; padding: 6px 10px; gap: 8px;
	}
	#batch-bar button {
		padding: 4px 8px; font-size: 0.875rem;
	}
}


/* ==============================
   Research Tab
   ============================== */

#research {
	position: fixed;
	top: var(--menubar-h); left: 0; right: var(--sidebar-w); bottom: 0;
	z-index: 5;
	background: #0a0a14;
	overflow: hidden;
}
.rsc-scroll {
	width: 100%; height: 100%;
	overflow-y: auto;
	padding: 0.75rem;
	box-sizing: border-box;
}
.rsc-tracks {
	display: flex; flex-direction: column; gap: 0.75rem;
}
.rsc-track {
	border: 1px solid #666;
	background: linear-gradient(180deg, #222 0%, #181818 100%);
	padding: 14px 16px;
	cursor: pointer;
	transition: border-color 0.15s;
}
.rsc-track:hover {
	border-color: #888;
}
.rsc-track.active {
	border-color: #6be67b;
}
.rsc-track-header {
	display: flex; align-items: center; gap: 0.5rem; margin-bottom: 10px;
}
.rsc-track-icon {
	color: #888; width: 1.125rem; text-align: center; font-size: 1rem;
}
.rsc-track.active .rsc-track-icon { color: #6be67b; }
.rsc-track-name {
	font-size: 1.125rem; font-weight: 700; color: #aaa;
	text-transform: uppercase; letter-spacing: 0.8px;
	flex: 1 1 auto;
}
.rsc-track.active .rsc-track-name { color: #ccc; }
.rsc-track-toggle {
	color: #555; font-size: 1.125rem; cursor: pointer;
}
.rsc-track.active .rsc-track-toggle { color: #6be67b; }

/* Progress line with circle markers */
.rsc-line {
	position: relative;
	height: 20px;
	margin: 4px 0 10px;
	display: flex; align-items: center;
}
.rsc-line-bg {
	position: absolute;
	left: 0; right: 0; top: 50%;
	height: 2px; margin-top: -1px;
	background: #333;
}
.rsc-line-fill {
	position: absolute;
	left: 0; top: 50%;
	height: 2px; margin-top: -1px;
	background: #6be67b;
	transition: width 0.3s ease;
}
.rsc-dot {
	position: absolute; top: 50%;
	width: 6px; height: 6px;
	border-radius: 50%;
	background: #333;
	transform: translate(-50%, -50%);
	z-index: 1;
}
.rsc-dot.filled {
	background: #6be67b;
}
.rsc-dot.milestone {
	width: 10px; height: 10px;
	border: 2px solid #444;
	background: #181818;
}
.rsc-dot.milestone.filled {
	border-color: #6be67b;
	background: #6be67b;
}

/* Items row */
.rsc-items {
	position: relative;
	height: 1.75rem;
}
.rsc-item {
	position: absolute; top: 0;
	display: flex; align-items: center; gap: 0.3125rem;
	padding: 0.25rem 0.5rem;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 4px;
	font-size: 0.875rem; color: #666;
	white-space: nowrap;
	transform: translateX(-100%);
}
.rsc-item.unlocked {
	color: #e0e0e0;
	border-color: rgba(107,230,123,0.25);
	background: rgba(107,230,123,0.08);
}
.rsc-item .pos {
	font-weight: 700; color: #555; min-width: 1.25rem; text-align: center; font-size: 0.75rem;
}
.rsc-item.unlocked .pos {
	color: #6be67b;
}
.rsc-item .rsc-item-name {
	white-space: nowrap;
}

/* Build modal: locked items */
.bm-option.bm-locked {
	opacity: 0.4; cursor: default; pointer-events: none;
}
.bm-lock-label {
	color: #c66 !important; font-size: 0.75rem;
}


/* Bug report */

#bug-btn {
	position: fixed;
	bottom: 8px; right: 8px;
	width: 36px; height: 36px;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	z-index: 50;
	display: flex; align-items: center; justify-content: center;
}
#bug-btn:hover {
	background: rgba(0, 0, 0, 0.9);
	border-color: rgba(255, 255, 255, 0.3);
}
#map-panel-btn {
	display: none;
	position: fixed;
	top: calc(var(--menubar-h) + 8px); right: 8px;
	width: 36px; height: 36px;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	z-index: 50;
	align-items: center; justify-content: center;
}
#map-panel-btn:hover, #map-panel-btn.active {
	background: rgba(0, 0, 0, 0.9);
	border-color: rgba(255, 255, 255, 0.3);
}
#map-panel-btn.active {
	color: #f0c040;
}
@media (max-width: 767px) {
	#map-panel-btn {
		display: flex;
	}
}

.bug-field { margin-bottom: 12px; }
.bug-field label {
	display: block; margin-bottom: 4px;
	color: #aaa; font-size: 0.875rem;
}
#bug-sector-display {
	margin-bottom: 6px;
	color: #e0e0e0; font-size: 0.875rem;
}
.bug-sector-actions { display: flex; gap: 6px; }
.bug-sector-actions button {
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.05);
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	font: 400 0.875rem "Open Sans", sans-serif;
	cursor: pointer;
}
.bug-sector-actions button:hover {
	background: rgba(93, 167, 179, 0.15);
	border-color: rgba(93, 167, 179, 0.3);
}
#bug-description {
	width: 100%; box-sizing: border-box; padding: 8px;
	background: #121224;
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	font: 400 0.875rem "Open Sans", sans-serif;
	resize: vertical;
}
#bug-description:focus {
	outline: none;
	border-color: rgba(93, 167, 179, 0.6);
}

#bug-pick-hint {
	position: fixed;
	bottom: 16px; left: 50%;
	transform: translateX(-50%);
	padding: 8px 14px;
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	font-size: 0.875rem;
	z-index: 101;
	pointer-events: none;
}

.bug-toast {
	position: fixed;
	bottom: 56px; right: 8px;
	padding: 8px 14px;
	background: rgba(40, 100, 50, 0.95);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	font-size: 0.875rem;
	z-index: 200;
	transition: opacity 0.5s;
}
.bug-toast-out { opacity: 0; }
