/**
 * City list styles inside #ID_CARD — match css/cards.css city list / mini previews.
 */

#ID_CARD #CITYLIST .compatible {
	display: inline-block;
	vertical-align: top;
	margin: 0;
	text-align: left;
	position: relative;
}

#ID_CARD #CITYLIST .city_label {
	width: auto;
	padding-left: 5px;
	white-space: nowrap;
	overflow: hidden;
	user-select: none;
	cursor: default;
}

#ID_CARD #CITYLIST .population {
	position: absolute;
	margin-top: -50px;
	text-align: right;
	opacity: 1;
	user-select: none;
	pointer-events: none;
	z-index: 2;
}

#ID_CARD #CITYLIST .population div {
	display: inline-block;
	margin-right: 10px;
	padding: 5px;
	padding-left: 8px;
	padding-right: 8px;
	background-color: #333;
	color: white;
	font-weight: 600;
	font-size: 10px;
	border-radius: 15px;
	opacity: 1;
	cursor: pointer;
	pointer-events: all;
}

@media (hover: hover) {
	#ID_CARD #CITYLIST .population div:hover {
		background-color: #222;
	}
}

#ID_CARD #CITYLIST .city_preview,
#ID_CARD .browser-cities-detail-preview {
	height: auto;
	width: auto;
	min-height: 100px;
	margin: 0;
	margin-top: 5px;
	margin-bottom: 20px;
	background-color: gray;
	border-radius: 10px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	background-position: center center;
	background-size: 50px;
	background-repeat: no-repeat;
	box-shadow: none;
	border: none;
}

/* Kill main-game / 3D borders & shadows only — keep inline size for layout.
   Also kill #ID_CARD .ROAD sample-card margins (margin-left:-40px; margin-top:20px)
   which would shove every preview road left and down. */
#ID_CARD #CITYLIST .city_preview .ROAD,
#ID_CARD .browser-cities-detail-preview .ROAD,
#ID_CARD #CITYLIST .city_preview .PARK,
#ID_CARD .browser-cities-detail-preview .PARK,
#ID_CARD #CITYLIST .city_preview .WATER,
#ID_CARD .browser-cities-detail-preview .WATER,
#ID_CARD #CITYLIST .city_preview .MOUNTAIN,
#ID_CARD .browser-cities-detail-preview .MOUNTAIN,
#ID_CARD #CITYLIST .city_preview .BUILDING,
#ID_CARD .browser-cities-detail-preview .BUILDING {
	position: absolute !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	border: none !important;
	outline: none !important;
	filter: none !important;
	opacity: 1 !important;
	cursor: default !important;
	animation: none !important;
}

#ID_CARD #CITYLIST .city_preview .ROAD,
#ID_CARD .browser-cities-detail-preview .ROAD {
	/* Beat #ID_CARD .ROAD { width: calc(100% + 80px); height: 20px; } */
	width: auto;
	height: auto;
}

#ID_CARD #CITYLIST .city_preview .ROAD,
#ID_CARD .browser-cities-detail-preview .ROAD,
#ID_CARD #CITYLIST .city_preview .PARK,
#ID_CARD .browser-cities-detail-preview .PARK {
	background-color: silver !important;
	background-image: none !important;
	border-radius: 5px;
	z-index: 2;
}

#ID_CARD #CITYLIST .city_preview .PARK,
#ID_CARD .browser-cities-detail-preview .PARK {
	background-color: #80ca7b !important;
	z-index: 1;
}

#ID_CARD #CITYLIST .city_preview .WATER,
#ID_CARD .browser-cities-detail-preview .WATER {
	background-color: lightblue !important;
	background-image: none !important;
	border-radius: 2px;
}

#ID_CARD #CITYLIST .city_preview .MOUNTAIN,
#ID_CARD .browser-cities-detail-preview .MOUNTAIN {
	background-color: dimgray !important;
	background-image: url(../images/mountain_2D.png) !important;
	background-position: center center !important;
	background-size: 100% 100% !important;
	background-repeat: no-repeat !important;
	border-radius: 2px;
}

#ID_CARD #CITYLIST .city_preview .BUILDING,
#ID_CARD .browser-cities-detail-preview .BUILDING {
	background-color: #333 !important;
	background-image: none !important;
	border-radius: 0;
}

#ID_CARD .browser-cities-subdued {
	position: absolute;
	bottom: 78px;
	left: 0;
	right: 0;
	text-align: center;
}

#ID_CARD .browser-cities-panel {
	position: relative;
	min-height: 200px;
	padding-bottom: 90px;
}

/* Save / city-detail panels fill the card so the primary button can sit at the bottom */
#ID_CARD:not(.browser-cities-list) > .browser-cities-panel {
	position: absolute;
	left: 20px;
	right: 20px;
	top: 72px;
	bottom: 20px;
	min-height: 0;
	padding-bottom: 0;
	box-sizing: border-box;
}

/* City list can be taller than the card — allow vertical scroll */
#ID_CARD.browser-cities-list,
#ID_CARD:has(#CITYLIST) {
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

#ID_CARD.browser-cities-list .browser-cities-panel,
#ID_CARD:has(#CITYLIST) .browser-cities-panel {
	position: relative;
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	padding-bottom: 24px;
	min-height: 0;
}

/* Full-width primary action — same left/right inset as the modal text */
#ID_CARD #LOAD_SAVE .button.browser-cities-primary-btn {
	position: absolute !important;
	display: block !important;
	left: 0;
	right: 0;
	bottom: 0;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	box-sizing: border-box;
	text-align: center;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	BUILDING RENAME (JS card — no PHP iframe)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

#ID_CARD.building-rename-card .building-rename-panel {
	position: absolute;
	left: 20px;
	right: 20px;
	top: 72px;
	bottom: 20px;
	box-sizing: border-box;
}

#ID_CARD.building-rename-card .building-rename-input {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: auto;
	margin: 0;
	margin-top: 10px;
	margin-bottom: 20px;
	padding: 10px;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 18px;
	color: black;
	font-weight: 400;
	background-color: white;
	border: 1px solid black;
	border-radius: 10px;
}

#ID_CARD.building-rename-card .building-rename-suggestions {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 70px;
	text-align: left;
}

#ID_CARD.building-rename-card .building-rename-suggestions input[type='button'] {
	display: inline-block;
	position: relative;
	width: 60px;
	height: 45px;
	margin: 0;
	margin-right: 6px;
	margin-bottom: 6px;
	padding: 0;
	font-size: 10px;
	white-space: normal;
	text-align: center;
	color: black;
	background-color: white;
	border: 1px solid black;
	border-radius: 10px;
	cursor: pointer;
	user-select: none;
}

#ID_CARD.building-rename-card .building-rename-suggestions input[type='button']:active {
	filter: invert(1);
	border: 1px solid white;
}

#ID_CARD.building-rename-card .building-rename-submit {
	position: absolute !important;
	display: block !important;
	left: 0;
	right: 0;
	bottom: 0;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	box-sizing: border-box;
	text-align: center;
	padding: 10px;
	font-size: 18px;
	line-height: 120%;
}
