/* ── War of Emperium / Battle Arena Section ── */
.battlearena-section {
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100vw;
	min-height: 200px;
	padding: 50px 0;
	background-color: rgba(49, 54, 61, 0.816);
	overflow: visible;
	border-top: 1px solid rgba(150, 190, 220, 0.35);
	border-bottom: 1px solid rgba(150, 190, 220, 0.35);
}

.battlearena-section .ba-bg {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 0.20;
	pointer-events: none;
	z-index: 0;
}

/* Chibi - right anchor */
.battlearena-section .is-chibi {
    flex-shrink: 0;
    top: -150px;
    position: absolute;
    right: -100px;       
    left: auto;   
}

.battlearena-section .is-chibi img {
    max-height: 280px;
    transform: scale(1.03);
    transform-origin: right bottom;  
    width: auto;
    display: block;
}

.battlearena-section::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.457) 0%, transparent 14%, transparent 86%, rgba(255, 255, 255, 0.55) 100%);
}

.battlearena-section .ba-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 30px;
}

/* Section heading - pill style */
.ba-header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: fit-content;
	margin: 6px auto 14px;
	padding: 12px 24px;
	background-color: rgba(103, 182, 252, 0.973);
	border-radius: 50px;
	box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.219),
    inset 0 -4px 0 rgba(10, 60, 120, 0.55);
}

.ba-header h3 {
	font-family: 'Grobold', 'Arial Black', sans-serif;
	color: #fbfdff;
	font-size: 18px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 2px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.523);
}

.ba-icon {
	font-size: 18px;
}

/* Subtitle under the pill */
.ca-sub {
	text-align: center;
	color: #e4eefa;
	font-family: 'Informb';
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 26px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* ── Castle row - 4 across on PC, wraps on mobile ── */
.ca-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
}

.ca-card {
	flex: 0 0 220px;
	max-width: 220px;
	display: flex;
	flex-direction: column;
	align-items: center;
    transform: scale(0.80);
	text-align: center;
	background: rgba(255, 255, 255, 0.897);
	border: 1px solid rgba(150, 190, 220, 0.082);
	border-radius: 12px;
	padding: 16px 14px;
	box-shadow: 0 8px 20px rgba(29, 71, 108, 0.249);
	transition: transform 0.15s, box-shadow 0.15s;
}

.ca-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(40, 110, 170, 0.2);
}

/* Guild banner with emblem overlaid */
.ca-banner {
	position: relative;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 12px;
}

.ca-banner-bg {
	height: 300px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	image-rendering: pixelated;
	filter: drop-shadow(0 4px 8px rgba(40, 110, 170, 0.25));
}

.ca-banner-icon {
	position: absolute;
	top: 42%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	object-fit: contain;
	image-rendering: pixelated;
}

/* Castle name / owner / economy */
.ca-name {
	color: #3a4a5a;
	font-family: 'Grobold', 'Arial Black', sans-serif;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.ca-owner {
	color: #c98a2e;
	font-size: 12px;
	font-weight: 700;
	margin-top: 5px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.ca-owner.ca-none {
	color: #9aa7b5;
	font-weight: 600;
}

.ca-econ {
	color: #6a7686;
	font-size: 11px;
	font-weight: 600;
	margin-top: 4px;
}

/* Empty castle card - keeps banner, no text */
.ca-empty {
	min-height: 0;
}

.castle-page-section {
	min-height: 610px;
	padding: 52px 0 70px;
}

.castle-page-section .ba-bg {
	opacity: 0.18;
}

.castle-page-section .ca-grid {
	gap: 34px;
}

.castle-page-section .ca-card {
	flex-basis: 220px;
	max-width: 220px;
	transform: none;
}

.castle-page-section .ca-card:hover {
	transform: translateY(-3px);
}

.castle-page-section .ca-banner-bg {
	height: 300px;
}

/* Responsive castle layout: two cards on tablets, one card on phones. */
@media (max-width: 960px) {
	.battlearena-section {
		padding: 42px 0 50px;
		overflow: hidden;
	}

	.battlearena-section .ba-inner {
		padding: 0 22px;
	}

	.battlearena-section .is-chibi {
		top: 18px;
		right: 10px;
		left: auto;
		z-index: -1 !important;
		pointer-events: none;
	}

	.battlearena-section .is-chibi img {
		max-height: 245px;
		max-width: 225px;
		object-fit: contain;
		transform: none;
	}

	.ba-header,
	.ca-sub,
	.ca-grid {
		position: relative;
		z-index: 2;
	}

	.ca-grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 220px));
		justify-content: center;
		align-items: stretch;
		gap: 24px;
	}

	.ca-card,
	.castle-page-section .ca-card {
		width: 100%;
		max-width: 220px;
		min-width: 0;
		transform: none;
	}

	.ca-card:hover,
	.castle-page-section .ca-card:hover {
		transform: translateY(-2px);
	}

	.ca-banner-bg,
	.castle-page-section .ca-banner-bg {
		height: 220px;
	}
}

@media (max-width: 700px) {
	.battlearena-section {
		padding: 34px 0 42px;
	}

	.battlearena-section .ba-inner {
		padding: 0 16px;
	}

	.ba-header {
		padding: 10px 20px;
		margin-top: 0;
	}

	.ba-header h3 {
		font-size: 15px;
		letter-spacing: 1.4px;
	}

	.ca-sub {
		max-width: 250px;
		margin: 0 auto 22px;
		font-size: 11px;
		line-height: 1.4;
	}

	.battlearena-section .is-chibi {
		top: 64px;
		right: -6px;
		opacity: .72;
		z-index: -1 !important;
	}

	.battlearena-section .is-chibi img {
		max-height: 168px;
		max-width: 156px;
	}

	.ca-grid {
		grid-template-columns: minmax(0, 220px);
		gap: 18px;
	}

	.ca-card,
	.castle-page-section .ca-card {
		width: 220px;
		max-width: 100%;
		padding: 14px 12px;
	}

	.ca-banner-bg,
	.castle-page-section .ca-banner-bg {
		height: 180px;
	}
}

@media (max-width: 430px) {
	.battlearena-section .ba-inner {
		padding: 0 12px;
	}

	.battlearena-section .is-chibi {
		top: 78px;
		right: -8px;
		opacity: .72;
	}

	.battlearena-section .is-chibi img {
		max-height: 150px;
		max-width: 140px;
	}

	.ca-grid {
		grid-template-columns: minmax(0, 205px);
		gap: 16px;
	}

	.ca-card,
	.castle-page-section .ca-card {
		width: 205px;
	}

	.ca-banner-bg,
	.castle-page-section .ca-banner-bg {
		height: 165px;
	}
}
