:root {
	--bg: #0f1115;
	--text: #e9edf1;
	--muted: #aab3bf;
	--accent: #2563eb;
	--border: #2a3038;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Segoe UI", Tahoma, Arial, sans-serif;
	font-size: 1rem;
}

.navbar-brand {
	letter-spacing: 0.4px;
}

.table-dark {
	--bs-table-bg: #151920;
}

.card {
	border-radius: 12px;
}

.container-fluid {
	padding: 16px;
}

.text-muted {
	color: var(--muted);
}

.border-dark {
	border-color: var(--border) !important;
}

/* Gelanggang live cards */
.gelanggang-card {
	transition: box-shadow 0.3s ease;
}

.gelanggang-card:hover {
	box-shadow: 0 0 16px rgba(37, 99, 235, 0.15);
}

/* Status badges */
.status-badge {
	font-size: 0.7rem;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.badge-tanding {
	background-color: rgba(255, 193, 7, 0.15);
	color: #ffc107;
}

.badge-seni {
	background-color: rgba(37, 99, 235, 0.15);
	color: var(--accent);
}

.badge-battle {
	background-color: rgba(255, 87, 34, 0.15);
	color: #ff5722;
}

/* Scoreboard layout */
.scoreboard {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.scoreboard-corner {
	flex: 1;
	text-align: center;
	padding: 12px 8px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
}

.scoreboard-vs {
	font-size: 1rem;
	font-weight: 700;
	color: var(--muted);
	flex-shrink: 0;
}

.corner-label {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 1px;
	margin-bottom: 4px;
}

.corner-score {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	margin-bottom: 6px;
}

.corner-name {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.corner-kontingen {
	font-size: 0.85rem;
	color: var(--muted);
}

/* Red & Blue corner accents */
.score-red .corner-label {
	color: #ef5350;
}

.score-red .corner-score {
	color: #ef5350;
}

.score-red {
	border-bottom: 2px solid #ef5350;
}

.score-blue .corner-label {
	color: #42a5f5;
}

.score-blue .corner-score {
	color: #42a5f5;
}

.score-blue {
	border-bottom: 2px solid #42a5f5;
}

/* Seni score */
.seni-score {
	font-size: 2.2rem;
	font-weight: 700;
	color: var(--accent);
	line-height: 1;
}

/* Pulse animation on data change */
@keyframes pulseGlow {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
	}

	70% {
		box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
	}
}

.pulse {
	animation: pulseGlow 0.6s ease-out;
}

/* Auto-refresh spinner */
.refresh-spin {
	animation: spin 2s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/* Connection status indicator */
.connection-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	letter-spacing: 0.3px;
	transition: all 0.3s ease;
}

.connection-status .status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
}

.connection-status.connected {
	background: rgba(34, 197, 94, 0.15);
	color: #22c55e;
}

.connection-status.connected .status-dot {
	background: #22c55e;
	box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.connection-status.disconnected {
	background: rgba(239, 68, 68, 0.15);
	color: #ef4444;
}

.connection-status.disconnected .status-dot {
	background: #ef4444;
	box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* Status-differentiated badges */
.badge-status-live {
	background-color: rgba(34, 197, 94, 0.15);
	color: #22c55e;
}

.badge-status-standby {
	background-color: rgba(251, 191, 36, 0.15);
	color: #fbbf24;
}

.badge-status-done {
	background-color: rgba(148, 163, 184, 0.15);
	color: #94a3b8;
}

/* Larger scores for visual impact */
.corner-score {
	font-size: 2.5rem;
	font-weight: 800;
}

/* Idle card reduced opacity */
.gelanggang-idle {
	opacity: 0.55;
	transition: opacity 0.3s ease;
}

.gelanggang-idle:hover {
	opacity: 0.8;
}

/* Card fade-in animation */
@keyframes cardFadeIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.card-enter {
	animation: cardFadeIn 0.4s ease-out both;
}

.card-enter:nth-child(2) {
	animation-delay: 0.06s;
}

.card-enter:nth-child(3) {
	animation-delay: 0.12s;
}

.card-enter:nth-child(4) {
	animation-delay: 0.18s;
}

.card-enter:nth-child(5) {
	animation-delay: 0.24s;
}

.card-enter:nth-child(6) {
	animation-delay: 0.30s;
}

/* Gelanggang title in card header */
.gelanggang-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--text);
	letter-spacing: 0.3px;
}

/* Match info line */
.match-info {
	font-size: 0.95rem;
	color: var(--muted);
	letter-spacing: 0.3px;
}

/* Emphasized partai number */
.partai-number {
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--text);
}

/* Kejuaraan header card meta */
.kejuaraan-meta {
	font-size: 0.95rem;
}

/* Loading spinner for initial load */
.live-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 1rem;
	gap: 1rem;
}

.live-loading .spinner-border {
	width: 2.5rem;
	height: 2.5rem;
}

/* Medal tally table */
.medal-table {
	--bs-table-bg: transparent;
	--bs-table-hover-bg: rgba(255, 255, 255, 0.04);
	font-size: 0.95rem;
}

.medal-table thead th {
	background: rgba(16, 24, 37, 0.6);
	border-bottom: 2px solid #2a3447;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 0.75rem;
	white-space: nowrap;
}

.medal-table tbody td {
	padding: 0.65rem 0.75rem;
	vertical-align: middle;
	border-color: rgba(42, 52, 71, 0.5);
}

.medal-count-gold {
	color: #FFD700;
	font-weight: 700;
}

.medal-count-silver {
	color: #C0C0C0;
	font-weight: 700;
}

.medal-count-bronze {
	color: #CD7F32;
	font-weight: 700;
}

.medal-rank-gold td:first-child {
	color: #FFD700;
}

.medal-rank-silver td:first-child {
	color: #C0C0C0;
}

.medal-rank-bronze td:first-child {
	color: #CD7F32;
}

.medal-rank-gold {
	background: rgba(255, 215, 0, 0.06) !important;
}

.medal-rank-silver {
	background: rgba(192, 192, 192, 0.04) !important;
}

.medal-rank-bronze {
	background: rgba(205, 127, 50, 0.04) !important;
}

.medal-col-gold {
	color: #FFD700;
}

.medal-col-silver {
	color: #C0C0C0;
}

.medal-col-bronze {
	color: #CD7F32;
}

/* Medal badge pills */
.medal-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: capitalize;
	letter-spacing: 0.3px;
}

.medal-badge-emas {
	background: rgba(255, 215, 0, 0.18);
	color: #FFD700;
}

.medal-badge-perak {
	background: rgba(192, 192, 192, 0.18);
	color: #C0C0C0;
}

.medal-badge-perunggu {
	background: rgba(205, 127, 50, 0.18);
	color: #CD7F32;
}

/* Detail button in medal table */
.btn-medal-detail {
	font-size: 1rem;
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid rgba(96, 165, 250, 0.4);
	color: #93c5fd;
	background: rgba(96, 165, 250, 0.08);
	text-decoration: none;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.btn-medal-detail:hover {
	color: #fff;
	background: rgba(96, 165, 250, 0.25);
	border-color: rgba(96, 165, 250, 0.6);
}

/* Mobile breakpoint */
@media (max-width: 576px) {
	.scoreboard {
		flex-direction: column;
		gap: 0;
	}

	.scoreboard-corner {
		width: 100%;
		padding: 12px;
		border-radius: 8px;
	}

	.score-red {
		border-bottom: none;
		border-left: 3px solid #ef5350;
	}

	.score-blue {
		border-bottom: none;
		border-left: 3px solid #42a5f5;
	}

	.scoreboard-vs {
		width: 100%;
		padding: 4px 0;
		font-size: 0.75rem;
		color: var(--muted);
		display: flex;
		align-items: center;
		gap: 8px;
	}

	.scoreboard-vs::before,
	.scoreboard-vs::after {
		content: "";
		flex: 1;
		height: 1px;
		background: var(--border);
	}

	.corner-score {
		font-size: 2rem;
	}

	.corner-name {
		font-size: 0.85rem;
		white-space: normal;
	}

	.corner-kontingen {
		font-size: 0.75rem;
	}

	.seni-score {
		font-size: 1.6rem;
	}

	.card-body {
		padding: 0.75rem;
	}

	.card-header {
		padding: 0.6rem 0.75rem;
	}

	.match-info {
		font-size: 0.85rem;
	}

	.container {
		padding-left: 8px;
		padding-right: 8px;
	}
}
