body,
html {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	background: #000;
}

#map {
	width: 100%;
	height: 100%;
	background: #0a0a0c;
}

/* Override custom Playfair Display font with browser's native default when the setting is enabled */
body.use-system-font {
	font-family: initial;
}
body.use-system-font .menu-v2-title,
body.use-system-font .menu-v2-author,
body.use-system-font .menu-v2-link,
body.use-system-font .settings-title,
body.use-system-font #status-text,
body.use-system-font .setup-title,
body.use-system-font .stats-header,
body.use-system-font .stat-name,
body.use-system-font .settings-tab-btn,
body.use-system-font .thematic-loading-body .loading-status-text,
body.use-system-font .selection-title,
body.use-system-font .scroller-card-name {
	font-family: inherit;
}

.ui-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	padding: 16px;
	box-sizing: border-box;
}

.settings-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	/* slightly less heavy overlay so underlying map shows through */
	background: rgba(5, 5, 8, 0.85);
	z-index: 2000;
	display: flex;
	justify-content: center;
	align-items: center;
	backdrop-filter: blur(4px);
}

.settings-content {
	background: rgba(0, 0, 0, 0.4);
	padding: 30px;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.05);
	width: 90%;
	max-width: 500px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	max-height: 85vh;
	overflow-y: auto;
	backdrop-filter: blur(10px);
	-webkit-overflow-scrolling: touch;
}

.settings-content::-webkit-scrollbar {
	width: 6px;
}

.settings-content::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 3px;
}

.main-menu-v2 {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: url("../assets/images/2022.webp") no-repeat center center;
	background-size: cover;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-image 0.5s ease;
}

.menu-v2-overlay {
	position: absolute;
	top: 0;
	right: 0;
	width: 50%;
	height: 100%;
	/* softer dark panel so menu feels lighter */
	background: rgba(0, 0, 0, 0.58);
	clip-path: polygon(25% 0, 100% 0, 100% 100%, 0% 100%);
	z-index: 1;
	backdrop-filter: blur(3px);
	border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-v2-container {
	width: 100%;
	height: 100%;
	position: relative;
	padding: 60px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	z-index: 2;
}

.menu-v2-header {
	margin-bottom: auto;
	text-align: left;
	max-width: 600px;
	text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
	position: relative;
	z-index: 2;
}

.menu-v2-title {
	font-family: "Playfair Display", serif;
	font-weight: 900;
	font-size: 92px;
	color: #fff;
	margin: 0;
	letter-spacing: -3px;
	line-height: 0.9;
}

.menu-v2-author {
	font-family: "Playfair Display", serif;
	font-weight: 700;
	font-size: 28px;
	color: rgba(255, 255, 255, 0.6);
	margin-top: 15px;
	letter-spacing: 1px;
}

.menu-v2-nav {
	position: absolute;
	right: 0;
	top: 0;
	width: 45%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 60px 40px;
	box-sizing: border-box;
	z-index: 2;
}

.nav-links-fade {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
}

.nav-links-fade.hidden {
	opacity: 0;
	transform: translateX(50px);
	pointer-events: none;
}

.menu-v2-link {
	background: transparent;
	border: none;
	color: #fff;
	font-family: "Playfair Display", serif;
	font-weight: 700;
	font-size: 20px;
	cursor: pointer;
	padding: 2px 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-align: right;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	opacity: 0.7;
	letter-spacing: 1px;
}

.menu-v2-link:hover {
	opacity: 1;
	transform: translateX(-10px);
	color: #ff4757;
}

.menu-v2-link.primary {
	font-size: 48px;
	margin-bottom: 20px;
	opacity: 1;
	letter-spacing: -1px;
}

.menu-v2-link.primary:hover {
	transform: translateX(-20px);
}

.nav-separator {
	width: 200px;
	height: 1px;
	background: linear-gradient(to left, rgba(255, 255, 255, 0.3), transparent);
	margin-bottom: 20px;
}

.menu-v2-link svg {
	width: 54px;
	height: 54px;
}

.menu-v2-footer {
	position: absolute;
	bottom: 40px;
	right: 40px;
	font-size: 10px;
	color: rgba(255, 255, 255, 0.3);
	letter-spacing: 2px;
	text-transform: uppercase;
}

@media (max-width: 1024px) {
	.menu-v2-title {
		font-size: 60px;
	}
	.menu-v2-author {
		font-size: 24px;
	}
	.menu-v2-link.primary {
		font-size: 40px;
	}
	.menu-v2-nav {
		right: 5%;
		width: 260px;
	}
}

@media (max-width: 600px) {
	/* Full-screen overlay on mobile instead of 50% panel */
	.menu-v2-overlay {
		width: 100%;
		clip-path: none;
		background: rgba(0, 0, 0, 0.65);
	}
	.menu-v2-container {
		padding: 24px 20px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
	.menu-v2-header {
		text-align: center;
		margin-bottom: 0;
	}
	.menu-v2-title {
		font-size: 36px;
		letter-spacing: -1px;
	}
	.menu-v2-author {
		font-size: 14px;
		margin-top: 8px;
	}
	.menu-v2-nav {
		position: relative;
		right: auto;
		top: auto;
		transform: none;
		margin-top: 32px;
		width: 100%;
		padding: 0;
		height: auto;
		justify-content: center;
	}
	.nav-links-fade {
		align-items: center;
		gap: 8px;
	}
	.menu-v2-link.primary {
		font-size: 28px;
		margin-bottom: 12px;
	}
	.menu-v2-link {
		font-size: 16px;
		text-align: center;
		justify-content: center;
		padding: 8px 16px;
		opacity: 0.9;
		min-height: 44px;
		min-width: 44px;
		box-sizing: border-box;
	}
	.menu-v2-link:hover {
		transform: none;
	}
	.menu-v2-link svg {
		width: 36px;
		height: 36px;
	}
	.nav-separator {
		width: 120px;
		margin: 0 auto 12px;
	}
	.menu-v2-footer {
		position: relative;
		bottom: auto;
		right: auto;
		text-align: center;
		margin-top: auto;
		padding-top: 20px;
	}
}

@media (max-width: 600px) {
	.menu-layout {
		grid-template-columns: 1fr;
	}
	.game-logo-img {
		max-height: 80px;
	}
	.settings-content {
		padding: 16px;
		max-height: 80vh;
		overflow-y: auto;
	}
	.menu-content {
		padding: 20px 16px;
	}
	/* Make settings controls touch-friendly */
	.settings-content select,
	.settings-content input[type="range"] {
		min-height: 44px;
		font-size: 16px; /* prevents iOS zoom on focus */
	}

	/* Mobile settings: prevent tab bar overflow, stack vertically */
	.scenario-selection-container .selection-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	.settings-tab-container {
		width: 100%;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-self: stretch;
		margin-bottom: 0;
	}
	.settings-tab-btn {
		padding: 6px 10px;
		font-size: 8px;
		letter-spacing: 1px;
	}
	.scenario-scroller-v2 {
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}
}

.settings-title {
	font-family: "Playfair Display", serif;
	font-weight: 900;
	font-size: 28px;
	margin: 0 0 25px 0;
	text-align: center;
	color: white;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.setting-group {
	margin-bottom: 20px;
}

.setting-group label {
	display: block;
	color: #888;
	font-size: 12px;
	margin-bottom: 8px;
	text-transform: uppercase;
}

.setting-group select {
	width: 100%;
	padding: 12px;
	background: #2a2a30;
	border: 1px solid #444;
	color: white;
	border-radius: 8px;
	font-size: 14px;
	outline: none;
}

.setting-group small {
	display: block;
	margin-top: 6px;
	color: #555;
	font-size: 11px;
}

.status-panel {
	pointer-events: auto;
	/* reduce opacity so the panel is less dense */
	background: rgba(10, 10, 12, 0.8);
	backdrop-filter: blur(6px);
	color: #f5f5f5;
	padding: 12px 16px;
	border-radius: 6px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.08);
	margin-bottom: 10px;
	position: relative;
	z-index: 1020;
}

.status-panel.minimized {
	padding-bottom: 4px;
}

.status-panel.minimized .status-right {
	display: flex;
}

/* When minimized, hide everything in the right side except the minimize button */
.status-panel.minimized .status-right > *:not(#minimize-status-btn) {
	display: none;
}

.status-panel.minimized #unit-counts {
	display: none;
}

.status-left {
	display: flex;
	flex-direction: column;
}

#status-text {
	font-family: "Playfair Display", serif;
	font-size: 16px;
	font-weight: 900;
	letter-spacing: 0.5px;
}

.setup-panel {
	position: absolute;
	top: 95px;
	left: 16px;
	pointer-events: auto;
	/* soften panel backdrop to be less intrusive */
	background: rgba(8, 8, 10, 0.78);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 6px;
	padding: 20px;
	color: #f5f5f5;
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);
	max-width: 800px;
	min-width: 280px;
	margin: 0;
	width: auto;
	transition: all 0.18s ease;
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	z-index: 1010;
}

.setup-panel::-webkit-scrollbar {
	width: 4px;
}

.setup-panel::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
}

.setup-panel::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 3px;
}

.setup-resize-grip {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 18px;
	height: 18px;
	cursor: nwse-resize;
	opacity: 0.15;
	transition: opacity 0.15s ease;
}

.setup-resize-grip:hover {
	opacity: 0.5;
}

.setup-resize-grip::after {
	content: "";
	position: absolute;
	bottom: 4px;
	right: 4px;
	width: 8px;
	height: 8px;
	border-right: 2px solid rgba(255, 255, 255, 0.7);
	border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}

.setup-title {
	margin: 0 0 15px 0;
	font-family: "Playfair Display", serif;
	font-weight: 900;
	font-size: 20px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #fff;
	text-align: left;
}

.setup-sides {
	display: flex;
	gap: 15px;
	margin-bottom: 10px;
	align-items: flex-start;
	min-height: 120px;
}

.side-col {
	flex: 0 0 160px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.side-header {
	font-size: 11px;
	font-weight: 900;
	text-align: center;
	padding: 10px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.03);
	color: #666;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid rgba(255, 255, 255, 0.05);
	letter-spacing: 2px;
	text-transform: uppercase;
	position: relative;
	overflow: hidden;
}

.side-header:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #aaa;
}

.side-header {
	transition: color 0.2s ease;
}

.side-header.active {
	background: rgba(255, 255, 255, 0.05);
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
	color: #fff;
}

.side-header.active::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 15%;
	right: 15%;
	height: 3px;
	background: currentColor;
	border-radius: 3px 3px 0 0;
	box-shadow: 0 0 10px currentColor;
}

.side-country-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 40px;
	max-height: 280px;
	overflow-y: auto;
	padding-right: 6px;
	-webkit-overflow-scrolling: touch;
}

.side-country-list::-webkit-scrollbar {
	width: 6px;
}

.side-country-list::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
}

.side-country-list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 3px;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.side-country-list::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

.setup-slot {
	flex: none;
	padding: 10px;
	border-radius: 6px;
	background: #141418;
	border: 1px solid #333;
	text-align: center;
	min-height: 70px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.08s ease;
	position: relative;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.setup-slot:hover {
	background: #1a1a20;
	transform: translateY(-1px);
}

.setup-slot:hover {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.12);
	transform: translateY(-2px);
}

.setup-slot {
	border-left: 4px solid rgba(255, 255, 255, 0.2);
	background: #181416;
	transition: border-color 0.2s ease;
}

.slot-label {
	font-size: 10px;
	color: #aaa;
	margin-bottom: 4px;
}

.slot-name {
	font-size: 13px;
	font-weight: bold;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 5px;
}

.slot-controls {
	display: flex;
	gap: 4px;
	align-items: center;
}

.mini-select {
	flex: 1;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #ccc;
	font-size: 9px;
	padding: 2px 4px;
	border-radius: 3px;
	outline: none;
	text-transform: uppercase;
}

.clear-slot-btn {
	background: rgba(255, 255, 255, 0.05);
	color: #666;
	border: none;
	width: 18px;
	height: 18px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.clear-slot-btn:hover {
	background: rgba(255, 71, 87, 0.2);
	color: #ff4757;
}

.vs-divider {
	font-weight: 900;
	color: #444;
	font-style: italic;
}

.setup-options {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 15px;
	animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.option-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.option-row label {
	font-size: 12px;
	color: #ccc;
}

.option-row input[type="range"] {
	width: 60%;
}

.start-btn {
	width: 100%;
	padding: 10px 12px;
	background: #b33939;
	color: #fdfdfd;
	border: 1px solid #e55039;
	border-radius: 3px;
	font-weight: 800;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	transition:
		background 0.12s ease,
		transform 0.06s ease,
		border-color 0.12s ease;
	box-shadow: 0 5px 14px rgba(0, 0, 0, 0.75);
}

.start-btn:hover {
	background: #d64541;
	border-color: #ff6b6b;
	transform: translateY(-1px);
	box-shadow: 0 9px 20px rgba(0, 0, 0, 0.9);
}

.start-btn:active {
	transform: scale(0.98);
}

.start-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	filter: grayscale(0.5);
}

.setup-panel.minimized .setup-sides,
.setup-panel.minimized #setup-prompt,
.setup-panel.minimized #setup-options {
	display: none;
}

.setup-panel.minimized {
	padding-bottom: 5px;
	margin-bottom: 10px;
}

@media (max-width: 768px) {
	.setup-panel {
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		max-width: 100%;
		min-width: 0;
		border-radius: 12px 12px 0 0;
		padding: 12px 16px;
		max-height: 38vh;
		border-left: none;
		border-right: none;
	}

	/* Mobile: compact inline casualty bar instead of map-blocking overlay */
	.casualty-panel {
		position: relative;
		top: auto;
		left: auto;
		max-width: 100%;
		min-width: 0;
		margin: 0 0 2px 0;
		padding: 6px 10px;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
		background: rgba(10, 10, 12, 0.75);
		border-radius: 0;
		border: none;
		border-bottom: 1px solid rgba(255,255,255,0.08);
		box-shadow: none;
	}
	.casualty-panel .casualty-title {
		display: none;
	}
	.casualty-side-list {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		align-items: center;
	}
	.casualty-item {
		font-size: 10px;
		padding: 2px 6px;
		background: rgba(0,0,0,0.35);
		border-radius: 3px;
		display: flex;
		align-items: center;
		gap: 3px;
	}
	.casualty-item .cas-flag { width: 12px !important; height: 8px !important; }
	.casualty-item .cas-value { font-size: 10px !important; }
	.casualty-item .cas-side-mp { font-size: 10px !important; }

	/* Stats panel: keep it compact */
	.stats-panel {
		max-width: 100%;
		margin-bottom: 4px;
		padding: 10px 14px;
		gap: 6px;
	}
}

.stats-panel.minimized .stats-grid,
.stats-panel.minimized .tug-of-war {
	display: none;
}

.stats-panel.minimized {
	padding-bottom: 5px;
	margin-bottom: 10px;
}

.stats-panel {
	pointer-events: auto;
	/* slightly lighter stats panel */
	background: rgba(14, 14, 16, 0.82);
	backdrop-filter: blur(6px);
	padding: 16px 18px;
	border-radius: 6px;
	margin-top: auto;
	margin-bottom: 20px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.7);
	width: 95%;
	max-width: 540px;
	align-self: center;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.stats-header {
	font-family: "Playfair Display", serif;
	font-size: 14px;
	color: #fff;
	font-weight: 900;
	letter-spacing: 1px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 10px;
}

.stats-grid {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.side-stats {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.side-stats {
	text-align: center;
	flex: 1;
	min-width: 0;
}

.side-stats .metric {
	align-items: center;
}

.stat-name {
	font-family: "Playfair Display", serif;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 4px;
}

.stat-metrics {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.metric {
	display: flex;
	flex-direction: column;
}

.metric-label {
	font-size: 8px;
	color: #444;
	font-weight: 900;
	letter-spacing: 1px;
}

.metric-value {
	font-size: 12px;
	font-weight: 900;
	font-family: monospace;
	color: #eee;
}

.stats-vs {
	align-self: center;
	font-style: italic;
	font-weight: 900;
	color: #222;
	font-size: 16px;
}

.tug-of-war {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: 5px;
}

.control-pct {
	font-size: 11px;
	font-weight: 900;
	font-family: monospace;
	color: #888;
	min-width: 35px;
}

.stats-grid {
	display: flex;
	gap: 8px;
	align-items: stretch;
	flex-wrap: wrap;
}

.stat-progress {
	position: relative;
	height: 6px;
	background: rgba(255, 255, 255, 0.04);
	border-radius: 999px;
	overflow: hidden;
	flex: 1;
}

.progress-inner {
	height: 100%;
	background: #ff4757;
	width: 50%;
	transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 0 12px rgba(255, 71, 87, 0.4);
}

.progress-marker {
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	background: rgba(255, 255, 255, 0.5);
}

.mini-btn {
	background: #2a2d31;
	color: #f0f0f0;
	border: 1px solid #3a4046;
	padding: 5px 10px;
	border-radius: 3px;
	font-size: 11px;
	cursor: pointer;
	transition:
		background 0.12s ease,
		border-color 0.12s ease,
		transform 0.06s ease;
}

.mini-btn.active {
	background: #3d593c;
}

.status-right {
	display: flex;
	gap: 12px;
	align-items: center;
}

.control-group {
	display: flex;
	gap: 3px;
	align-items: center;
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	padding-right: 6px;
}

.control-group:last-child {
	border-right: none;
	padding-right: 0;
}

.mini-btn {
	background: rgba(255, 255, 255, 0.03);
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 4px 9px;
	border-radius: 2px;
	font-size: 10px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	text-transform: uppercase;
	letter-spacing: 1px;
	white-space: nowrap;
}

.mini-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
	color: #fff;
	transform: translateY(-1px);
}

.mini-btn.active {
	background: #264f39;
	color: #a6f4c5;
	border-color: #3fa96a;
	box-shadow: none;
}

@media (max-width: 768px) {
	.status-panel {
		flex-direction: column;
		gap: 8px;
		padding: 8px 10px;
		margin-bottom: 6px;
	}
	#status-text {
		font-size: 14px;
	}
	#unit-counts {
		font-size: 11px;
	}
	.status-right {
		width: 100%;
		flex-wrap: wrap;
		gap: 6px;
	}
	.control-group {
		border-right: none;
		padding-right: 0;
		gap: 4px;
		flex-wrap: wrap;
	}
	.mini-btn {
		padding: 8px 10px;
		font-size: 11px;
		min-height: 36px;
		min-width: 36px;
		border-radius: 4px;
	}
	.mini-btn.active {
		box-shadow: 0 0 8px rgba(63, 169, 106, 0.3);
	}
	/* Hide some less-used toggle buttons on mobile to save space */
	#arrows-toggle-btn,
	#battles-toggle-btn {
		display: none !important;
	}
	#minimize-status-btn {
		font-size: 18px;
		padding: 4px 12px;
	}
	.simulation-controls {
		justify-content: center;
	}
	.utility-controls {
		justify-content: center;
	}
}

.bottom-controls {
	display: flex;
	justify-content: center;
}

.coordinates-display {
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	color: #9ea7b3;
	padding: 3px 10px;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.05);
	font-size: 10px;
	font-family: "JetBrains Mono", Consolas, monospace;
}

/* Map Overrides */
.leaflet-container {
	/* Pitch black base to ensure the canvas gradient is the primary visual */
	background: #000;
}

.leaflet-control-attribution {
	display: none;
}

/* Custom Marker Styles */
.unit-icon {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.5);
}

.treaty-alert {
	margin-top: 15px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 215, 0, 0.3);
	border-radius: 8px;
	animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
	0% {
		border-color: rgba(255, 215, 0, 0.2);
		box-shadow: 0 0 0px rgba(255, 215, 0, 0);
	}
	50% {
		border-color: rgba(255, 215, 0, 0.6);
		box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
	}
	100% {
		border-color: rgba(255, 215, 0, 0.2);
		box-shadow: 0 0 0px rgba(255, 215, 0, 0);
	}
}

.treaty-content {
	text-align: center;
}

#treaty-msg {
	font-size: 12px;
	font-weight: bold;
	color: #ffd700;
	margin-bottom: 10px;
	text-transform: uppercase;
}

.treaty-buttons {
	display: flex;
	gap: 10px;
}

.treaty-btn {
	flex: 1;
	padding: 8px;
	border: none;
	border-radius: 4px;
	font-size: 11px;
	font-weight: bold;
	cursor: pointer;
	text-transform: uppercase;
}

.treaty-btn.accept {
	background: #27ae60;
	color: white;
}

.treaty-btn.reject {
	background: #c0392b;
	color: white;
}

.city-marker {
	background: white;
	border: 1.5px solid #000;
	border-radius: 50%;
	pointer-events: none;
}

.city-marker.occupied-a {
	background: #ff4757;
}

.city-marker.occupied-b {
	background: #2e86de;
}

.buff-btn {
	pointer-events: auto;
	margin-top: 8px;
	padding: 4px 10px;
	font-size: 10px;
	background: rgba(255, 255, 255, 0.05);
	color: #666;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	cursor: pointer;
	font-weight: 900;
	letter-spacing: 1px;
	transition: all 0.2s ease;
	align-self: center;
}

.buff-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #aaa;
}

.buff-btn.active {
	background: #f1c40f;
	color: #000;
	border-color: #f1c40f;
	box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

.buff-btn.super-active,
.start-btn.super-active {
	background: #e67e22;
	color: #fff;
	border-color: #d35400;
	box-shadow: 0 0 20px rgba(230, 126, 34, 0.6);
	animation: pulse-orange 2s infinite;
}

.buff-btn.godly-active,
.start-btn.godly-active {
	background: #ffffff;
	color: #000;
	border: 2px solid #000;
	box-shadow:
		0 0 30px rgba(255, 255, 255, 0.8),
		0 0 60px rgba(255, 255, 255, 0.4);
	animation: pulse-godly 1.5s infinite;
	font-weight: 900;
}

@keyframes pulse-godly {
	0% {
		transform: scale(1);
		box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
	}
	50% {
		transform: scale(1.08);
		box-shadow: 0 0 40px rgba(255, 255, 255, 1);
	}
	100% {
		transform: scale(1);
		box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
	}
}

@keyframes pulse-orange {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
	100% {
		transform: scale(1);
	}
}

#editor-toolbox .mini-btn {
	font-size: 10px;
	padding: 6px 10px;
}

.hub-item {
	background: #141418;
	border: 1px solid #333;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.08s ease;
}

.hub-item:hover {
	background: #1a1a20;
	transform: translateY(-2px);
	border-color: #555;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
}

.hub-preview-img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	background: #000;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-content {
	padding: 15px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.hub-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 10px;
}

.hub-name {
	font-weight: bold;
	color: #fff;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hub-description {
	font-size: 11px;
	color: #aaa;
	line-height: 1.4;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 2.8em;
}

.hub-comment-count {
	font-size: 10px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hub-description.expanded {
	-webkit-line-clamp: unset;
	height: auto;
	display: block;
}

.show-more-btn {
	margin-top: 2px;
	font-size: 9px;
	padding: 3px 8px;
}

.hub-meta {
	font-size: 11px;
	color: #888;
	display: flex;
	align-items: center;
	gap: 8px;
}

.hub-author-img {
	width: 16px;
	height: 16px;
	border-radius: 50%;
}

.hub-actions {
	display: flex;
	gap: 8px;
}

#hub-list::-webkit-scrollbar {
	width: 6px;
}

#hub-list::-webkit-scrollbar-track {
	background: transparent;
}

#hub-list::-webkit-scrollbar-thumb {
	background: #333;
	border-radius: 3px;
}

#editor-toolbox .mini-btn.active,
.hub-tabs .mini-btn {
	background: transparent;
	color: #666;
	text-transform: uppercase;
	font-weight: 800;
	letter-spacing: 1px;
	border: none;
	padding: 10px 20px;
}

.hub-tabs .mini-btn.active {
	background: rgba(255, 255, 255, 0.05);
	color: #2e86de;
	box-shadow: inset 0 0 0 1px rgba(46, 134, 222, 0.3);
}

.hub-tabs .mini-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
}

/* ERA PICKER REMAKE */
.era-modal {
	max-width: 720px;
	padding: 24px 24px 18px;
}

.era-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 14px;
}

.era-title-block {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.era-subtitle {
	font-size: 11px;
	color: #777;
	letter-spacing: 0.4px;
}

.settings-tab-container,
.era-tabs,
.hub-tabs {
	display: flex;
	gap: 2px;
	background: rgba(255, 255, 255, 0.03);
	padding: 3px;
	border-radius: 2px;
	margin-bottom: 20px;
	justify-content: flex-end;
	border: 1px solid rgba(255, 255, 255, 0.08);
	width: fit-content;
	align-self: flex-end;
}

.settings-tab-btn,
.era-tabs .mini-btn,
.hub-tabs .mini-btn {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	padding: 8px 16px;
	border-radius: 1px;
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 2px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-transform: uppercase;
	font-family: "Playfair Display", serif;
}

.settings-tab-btn:hover,
.era-tabs .mini-btn:hover,
.hub-tabs .mini-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
}

.settings-tab-btn.active,
.era-tabs .mini-btn.active,
.hub-tabs .mini-btn.active {
	background: #ff4757;
	color: #fff;
	box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.era-page {
	display: none;
	margin-top: 4px;
}

.era-page.era-page-active {
	display: block;
}

.era-timeline-label {
	font-size: 9px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #555;
	margin: 14px 0 6px;
}

.era-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.era-card {
	width: 100%;
	border-radius: 6px;
	border: 1px solid #333;
	background: #141418;
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.08s ease;
}

.era-card:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.75);
	border-color: #555;
	background: #1a1a20;
}

.era-card-primary {
	border-color: #ff4757;
	background: #181416;
}

.era-card-primary:hover {
	border-color: #ff6b81;
	background: #20181a;
}

.era-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.era-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}
.era-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.era-card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.era-name {
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #fff;
}

.era-desc {
	font-size: 11px;
	color: #ccc;
}

.era-meta {
	font-size: 9px;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	margin-top: 2px;
}

.era-chip {
	font-size: 9px;
	padding: 2px 6px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #ddd;
	background: rgba(0, 0, 0, 0.5);
}

.era-chip-hot {
	border-color: rgba(255, 71, 87, 0.8);
	color: #ffb0ba;
	background: rgba(255, 71, 87, 0.15);
}

.era-hint {
	margin-top: 10px;
	font-size: 10px;
	color: #777;
	text-align: center;
}

.era-back-btn {
	margin-top: 16px;
}

.painting-cursor {
	cursor: crosshair;
}

/* Loading Overlay Styles */
.loading-content {
	text-align: center;
	align-items: center;
	gap: 20px;
}

.loader-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 71, 87, 0.1);
	border-top: 3px solid #ff4757;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

#loading-status {
	color: white;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 2px;
	margin: 0;
}

.loading-bar-container {
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 2px;
	overflow: hidden;
}

.loading-bar-fill {
	height: 100%;
	width: 0%;
	background: #ff4757;
	transition: width 0.3s ease;
	box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.loading-tip {
	font-size: 11px;
	color: #666;
	font-style: italic;
	max-width: 320px;
	line-height: 1.4;
}

.thematic-overlay {
	background-size: cover;
	backdrop-filter: none;
}

#loading-overlay.thematic-overlay #loading-standard-content {
	display: none;
}

#loading-overlay:not(.thematic-overlay) #loading-thematic-content {
	display: none;
}

#loading-overlay.thematic-overlay #loading-thematic-content {
	display: flex;
}

.thematic-overlay .menu-v2-container {
	padding: 60px;
	pointer-events: none;
}

.thematic-overlay .menu-v2-nav {
	pointer-events: auto;
}

@media (max-width: 600px) {
	.thematic-overlay .menu-v2-container {
		padding: 24px 20px;
	}
	.thematic-loading-body {
		align-items: center;
		text-align: center;
	}
}

.thematic-loading-body {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	gap: 15px;
	padding-top: 40px;
}

.thematic-loading-body .loading-status-text {
	font-family: "Playfair Display", serif;
	font-size: 32px;
	margin: 0;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.thematic-loading-body .loading-bar-container {
	height: 2px;
	width: 300px;
}

.hub-tabs .mini-btn {
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
	font-size: 9px;
	padding: 6px 12px;
}

.hub-tabs .mini-btn.active {
	background: #ff4757;
	color: #fff;
	border-color: #ff4757;
}

.tutorial-popup-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 3000;
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
	padding-top: 20px;
	padding-left: 5%;
	background: transparent;
	backdrop-filter: none;
	pointer-events: none;
}

.tutorial-content {
	pointer-events: auto;
	max-width: 380px;
	padding: 20px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.05);
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
}

.tutorial-step {
	animation: fadeIn 0.3s ease-out;
}

.tutorial-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 15px;
}

.tutorial-icon {
	font-size: 32px;
}

.tutorial-title {
	font-size: 20px;
	font-weight: 900;
	letter-spacing: 1px;
	margin: 0;
	color: #fff;
	text-transform: uppercase;
}

.tutorial-body {
	font-size: 13px;
	line-height: 1.5;
	color: #ccc;
	margin-bottom: 20px;
}

.tutorial-body b {
	color: #ff4757;
}

.tutorial-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 20px;
}

#tutorial-dots {
	display: flex;
	gap: 8px;
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	transition: background 0.3s;
}

.dot.active {
	background: #ff4757;
	box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.game-date-display {
	position: static;
	margin: 8px auto 0;
	text-align: center;
	z-index: 1002;
	pointer-events: none;
	font-weight: 900;
	font-size: 16px;
	letter-spacing: 2px;
	color: #ffffff;
	text-shadow:
		-2px -2px 0 #000,
		2px -2px 0 #000,
		-2px 2px 0 #000,
		2px 2px 0 #000,
		0 -2px 0 #000,
		0 2px 0 #000,
		-2px 0 0 #000,
		2px 0 0 #000;
}

.casualty-panel {
	position: absolute;
	top: 68px;
	left: 16px;
	/* anchored below topbar on left side */
	background: rgba(12, 12, 14, 0.9);
	backdrop-filter: blur(8px);
	padding: 12px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	pointer-events: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 160px;
	max-width: 240px;
	z-index: 1001;
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.75);
}

.casualty-title {
	color: #fff;
	font-weight: 900;
	font-size: 14px;
	letter-spacing: 2px;
	text-align: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	padding-bottom: 5px;
}

.casualty-side-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.casualty-item {
	display: flex;
	align-items: center;
	gap: 10px;
	transition: all 0.3s ease;
}

.casualty-item.secondary {
	margin-left: 12px;
	opacity: 0.85;
	transform: scale(0.8);
	transform-origin: left;
	margin-top: -2px;
}

.cas-flag {
	width: 30px;
	height: 18px;
	object-fit: cover;
	border: 1px solid rgba(0, 0, 0, 0.3);
	background: #222;
	flex-shrink: 0;
}

.cas-flag.small {
	width: 22px;
	height: 13px;
}

.cas-value {
	font-size: 18px;
	font-weight: 900;
	font-family: monospace;
	color: #fff;
}

.secondary .cas-value {
	font-size: 14px;
}

.cas-value {
	font-weight: 900;
	font-family: monospace;
}

/* Leaderboard */
.leaderboard-content {
	max-width: 520px;
}

.leaderboard-header {
	display: flex;
	align-items: center;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #888;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding-bottom: 6px;
	margin-bottom: 8px;
}

.leaderboard-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 60vh;
	overflow-y: auto;
	padding-right: 4px;
}

.leaderboard-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.04);
	font-size: 11px;
}

.leaderboard-row:nth-child(odd) {
	background: rgba(255, 255, 255, 0.015);
}

.leaderboard-flag {
	width: 26px;
	height: 16px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, 0.4);
	background: #000;
	flex-shrink: 0;
}

.leaderboard-name {
	flex: 2;
	display: flex;
	align-items: center;
	gap: 6px;
	overflow: hidden;
}

.leaderboard-name span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.leaderboard-tiles,
.leaderboard-units {
	flex: 1;
	text-align: right;
	font-family: monospace;
	color: #ccc;
}

.leaderboard-rank {
	width: 40px;
	text-align: right;
	font-weight: 900;
	color: #f1c40f;
	font-family: monospace;
}

@media (max-width: 540px) {
	.leaderboard-header span:nth-child(2),
	.leaderboard-row .leaderboard-tiles {
		display: none;
	}
}

/* Global chat scroll area */
#global-chat-list {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	max-height: 320px; /* ensure a scrollable window inside the modal */
}

.ref-handle {
	cursor: nwse-resize;
	z-index: 1000;
}

.ref-handle-center {
	cursor: move;
	z-index: 1001;
}

/* Import-from-scenario country cards */
.import-country-card-list {
	max-height: 220px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
	padding-right: 4px;
}

.import-country-card {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		transform 0.1s ease;
	font-size: 11px;
}

.import-country-card:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.25);
	transform: translateY(-1px);
}

.import-country-card.selected {
	border-color: #ff4757;
	box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.5);
}

.import-country-flag {
	width: 28px;
	height: 18px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, 0.4);
	background: #000;
	flex-shrink: 0;
}

.import-country-name {
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.import-country-tiles {
	font-size: 9px;
	color: #888;
}

#no-nations-modal .start-btn {
	padding: 12px;
	font-size: 11px;
}

/* Editor Choice Modal & Menu Card Styles */
.editor-choice-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.menu-card {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
	color: white;
	text-align: left;
}

.menu-card:hover {
	background: rgba(255, 255, 255, 0.08);
	transform: translateY(-2px);
	border-color: #ff4757;
}

.menu-card.primary {
	border-color: rgba(255, 71, 87, 0.3);
}

.card-icon {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 71, 87, 0.12);
	border-radius: 8px;
	color: #ff4757;
	flex-shrink: 0;
}

.card-icon svg {
	width: 20px;
	height: 20px;
}

.menu-card .card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.menu-card .btn-text {
	font-size: 14px;
	font-weight: 900;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.menu-card .btn-sub {
	font-size: 11px;
	color: #888;
}

/* Integrated Scroller Styles */
.scenario-selection-container {
	width: 100%;
	height: 80vh;
	display: flex;
	flex-direction: column;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.05);
	padding: 30px;
	box-sizing: border-box;
	border-radius: 2px;
	animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

@keyframes slideInRight {
	from {
		transform: translateX(40px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.selection-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 15px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.selection-back-btn {
	background: transparent;
	border: none;
	color: #666;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 900;
	cursor: pointer;
	transition: color 0.2s;
}

.selection-back-btn:hover {
	color: #ff4757;
}

.selection-title {
	font-family: "Playfair Display", serif;
	font-size: 24px;
	color: #fff;
	margin: 0;
	letter-spacing: 1px;
}

.scenario-scroller-v2 {
	flex: 1;
	overflow-y: auto;
	padding-right: 15px;
	scroll-behavior: smooth;
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.scenario-scroller-v2::-webkit-scrollbar {
	width: 4px;
}

.scenario-scroller-v2::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
}

.scroller-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.scroller-label {
	font-size: 10px;
	color: #555;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 900;
}

.scroller-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.scroller-card {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
	padding: 20px;
	border-radius: 1px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-align: left;
}

.scroller-card:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
	transform: translateX(-10px);
}

.scroller-card.primary {
	border-color: #ff4757;
	background: rgba(255, 71, 87, 0.05);
}

.scroller-card.selected {
	border-color: #ff4757;
	background: rgba(255, 71, 87, 0.15);
	box-shadow: 0 0 20px rgba(255, 71, 87, 0.2);
	transform: translateX(-15px);
}

.scroller-card-name {
	font-family: "Playfair Display", serif;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 4px;
}

.scroller-card-desc {
	font-size: 11px;
	color: #888;
	line-height: 1.4;
	margin-bottom: 6px;
}

.scroller-card-credits {
	font-size: 9px;
	color: #444;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 900;
}

/* Ensure Hub Nav and Expanded Viewer stay within the clipped area and have enough room */
#scenario-hub-modal .menu-v2-nav,
.item-details-nav {
	width: 45%;
	right: 0;
}

.item-details-nav {
	position: absolute;
	right: 0;
	top: 0;
	width: 45%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 60px 40px;
	box-sizing: border-box;
	z-index: 2;
}

.item-comments-v2 {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 300px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	padding: 10px;
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-comments-v2::-webkit-scrollbar {
	width: 4px;
}

.item-comments-v2::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
}

.comment-composer-v2 {
	margin-top: 15px;
	background: rgba(255, 255, 255, 0.02);
	padding: 15px;
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.05);
}

#scenario-hub-modal .scenario-selection-container {
	padding-bottom: 20px;
}

@media (max-width: 1024px) {
	#scenario-hub-modal .menu-v2-nav,
	.item-details-nav {
		width: 380px;
		right: 1%;
	}
}

@media (max-width: 600px) {
	#scenario-hub-modal .menu-v2-nav,
	.item-details-nav {
		width: 100%;
		position: relative;
		right: auto;
		top: auto;
		transform: none;
		height: auto;
		padding-top: 20px;
	}
	.item-details-nav {
		align-items: stretch;
	}
}
