/**
 * Floating election ticker: rotating assembly constituency + vote columns.
 */

.evr-ticker {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	justify-content: center;
	align-items: flex-end;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
	pointer-events: none;
	font-family: "Hind Siliguri", "Noto Sans Bengali", "Kalpurush", "Segoe UI", Roboto, sans-serif;
}

.evr-ticker * {
	pointer-events: auto;
	box-sizing: border-box;
}

.evr-ticker__frame {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 10px;
	width: fit-content;
	max-width: calc(100vw - 24px);
	margin: 0 auto;
	padding: 10px 14px;
	border: 4px solid #8b1538;
	border-radius: 6px;
	background: linear-gradient(180deg, #f4e4a6 0%, #e8c44a 45%, #d4a017 100%);
	box-shadow:
		0 -4px 18px rgba(0, 0, 0, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.evr-ticker__empty {
	padding: 12px 16px;
	font-weight: 700;
	color: #5a0a18;
	text-align: center;
	white-space: normal;
	max-width: 320px;
}

/* Current constituency panel */
.evr-ticker__ac {
	flex: 0 0 auto;
	min-width: 132px;
	max-width: 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px 12px;
	background: rgba(255, 236, 140, 0.95);
	border-radius: 6px;
	border: 2px solid rgba(139, 21, 56, 0.35);
}

.evr-ticker__ac-label {
	display: block;
	font-size: 13px;
	font-weight: 800;
	color: #7a1028;
	line-height: 1.2;
}

/* Fixed vertical space for two lines so the ticker bar height stays steady */
.evr-ticker__ac-name-slot {
	width: 100%;
	margin-top: 4px;
	font-size: 15px;
	min-height: 2.7em;
	display: flex;
	align-items: center;
	justify-content: center;
}

.evr-ticker__ac-name {
	display: -webkit-box;
	margin: 0;
	width: 100%;
	font-size: 1em;
	font-weight: 900;
	color: #4a0818;
	line-height: 1.35;
	max-height: 2.7em;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	word-break: break-word;
	text-align: center;
}

.evr-ticker__ac-district {
	display: block;
	margin-top: 2px;
	min-height: 1.35em;
	font-size: 12px;
	font-weight: 600;
	color: #6b1528;
	line-height: 1.35;
	word-break: break-word;
}

.evr-ticker__ac-total {
	display: block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 700;
	color: #5a0a18;
	opacity: 0.95;
}

/* Party columns (vote counts for this AC) */
.evr-ticker__rot-parties {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 8px;
	min-width: 0;
}

.evr-ticker__pcol {
	flex: 0 0 auto;
	min-width: 88px;
	max-width: 200px;
	display: flex;
	flex-direction: column;
	border-radius: 8px 8px 4px 4px;
	overflow: visible;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
	border: 2px solid rgba(90, 10, 30, 0.25);
	background: #fff8e7;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.evr-ticker__pcol.is-ahead {
	border-color: rgba(212, 160, 23, 0.95);
	box-shadow: 0 0 0 2px rgba(255, 200, 60, 0.65), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.evr-ticker__pcol.is-winner {
	border-color: #b8860b;
	box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.7), 0 2px 10px rgba(0, 0, 0, 0.22);
}

.evr-ticker__pcol-head {
	padding: 6px 8px 8px;
	min-height: 50px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	text-align: center;
	border-radius: 6px 6px 0 0;
}

.evr-ticker__pcol-headrow {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 6px;
	width: 100%;
}

.evr-ticker__party-icon {
	width: 28px;
	height: 28px;
	max-width: 28px;
	max-height: 28px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.25);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.evr-ticker__party-name {
	font-size: 15px;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	line-height: 1.2;
	word-break: break-word;
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
}

.evr-ticker__pcol-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
}

.evr-ticker__badge {
	display: inline-block;
	padding: 2px 5px;
	border-radius: 4px;
	font-size: 9px;
	font-weight: 900;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: none;
	flex-shrink: 0;
	white-space: nowrap;
}

.evr-ticker__badge--ahead {
	background: rgba(255, 255, 255, 0.95);
	color: #7a1028;
	border: 1px solid rgba(122, 16, 40, 0.35);
}

.evr-ticker__badge--win {
	background: linear-gradient(180deg, #ffd700 0%, #daa520 100%);
	color: #3d0a0a;
	border: 1px solid #8b6914;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.evr-ticker__pcol-body {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 6px;
	background: linear-gradient(180deg, #fff9e6 0%, #f5e9c8 100%);
	border-radius: 0 0 4px 4px;
}

.evr-ticker__pcol-votes {
	font-size: 20px;
	font-weight: 900;
	color: #7a1028;
	line-height: 1;
}

/* Summary slide: মোট এগিয়ে panel */
.evr-ticker__sum--panel {
	flex: 0 0 auto;
	min-width: 120px;
	max-width: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px 12px;
	background: rgba(255, 236, 140, 0.95);
	border-radius: 6px;
	border: 2px solid rgba(139, 21, 56, 0.35);
}

.evr-ticker__sum-title {
	display: block;
	font-size: 15px;
	font-weight: 900;
	color: #4a0818;
	line-height: 1.2;
}

.evr-ticker__sum-sub {
	display: block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 700;
	color: #5a0a18;
	line-height: 1.25;
}

.evr-ticker__pcol-votes--ahead-total {
	font-size: 22px;
	color: #5a0a18;
}

body.evr-has-election-ticker {
	padding-bottom: 6rem;
}

@media (max-width: 782px) {
	.evr-ticker__ac {
		min-width: 108px;
		max-width: 220px;
	}

	.evr-ticker__ac-name-slot {
		font-size: 13px;
	}

	.evr-ticker__sum--panel {
		min-width: 100px;
		max-width: 140px;
	}

	.evr-ticker__sum-title {
		font-size: 13px;
	}

	.evr-ticker__pcol-votes {
		font-size: 17px;
	}

	.evr-ticker__party-name {
		font-size: 13px;
	}

	.evr-ticker__pcol-votes--ahead-total {
		font-size: 18px;
	}

	.evr-ticker__party-icon {
		width: 24px;
		height: 24px;
		max-width: 24px;
		max-height: 24px;
	}

	body.evr-has-election-ticker {
		padding-bottom: 6.5rem;
	}
}
