/* =============================================================
   Grid Sync — Bracket Visualization
   ============================================================= */

.grid-bracket-wrap {
	margin: 16px 0 28px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.grid-bracket {
	display: inline-block;
	min-width: 100%;
	padding: 0 0 8px;
}

/* --- Section (UB / LB / GF / SE) --- */

.grid-bracket__section {
	margin-bottom: 20px;
}

.grid-bracket__section--gf {
	margin-bottom: 0;
}

.grid-bracket__section-title {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #999;
	padding: 0 0 4px;
	margin-bottom: 6px;
	border-bottom: 2px solid #ddd;
}

/* --- Rounds row --- */

.grid-bracket__rounds {
	display: flex;
	align-items: stretch;
	position: relative; /* for SVG overlay */
}

/* --- Round column --- */

.grid-bracket__round {
	display: flex;
	flex-direction: column;
	width: 180px;
	min-width: 180px;
	flex-shrink: 0;
}

.grid-bracket__round-title {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #aaa;
	text-align: center;
	padding: 3px 6px;
	min-height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- Slots column --- */

.grid-bracket__slots {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.grid-bracket__slot {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	padding: 0 16px;
	box-sizing: border-box;
}

/* Label shown above a match card in a merged GF+3PM column — same style as round-title. */
.grid-bracket__slot-label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #aaa;
	text-align: center;
	padding: 3px 6px;
	min-height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- Match card --- */

.grid-bracket__match {
	width: 100%;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
	cursor: default;
	user-select: none;
}

.grid-bracket__match[role="link"] {
	cursor: pointer;
}

.grid-bracket__match[role="link"]:hover {
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.13);
	border-color: #c0c0c0;
}

.grid-bracket__match[role="link"]:focus {
	outline: 2px solid #007cba;
	outline-offset: 2px;
}

/* --- Team row --- */

.grid-bracket__team {
	display: flex;
	align-items: center;
	padding: 5px 7px;
	gap: 6px;
	border-bottom: 1px solid #f0f0f0;
	min-height: 32px;
}

.grid-bracket__team:last-child {
	border-bottom: none;
}

.grid-bracket__team--winner {
	background-color: #f0f8f0;
}

.grid-bracket__team--loser .grid-bracket__team-name,
.grid-bracket__team--loser .grid-bracket__score {
	color: #bbb;
}

/* --- Team logo --- */

.grid-bracket__logo {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 2px;
	background: #f5f5f5;
}

.grid-bracket__logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* --- Team name --- */

.grid-bracket__team-name {
	flex: 1;
	font-size: 12px;
	font-weight: 500;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

/* --- Score --- */

.grid-bracket__score {
	font-size: 12px;
	font-weight: 700;
	color: #555;
	min-width: 16px;
	text-align: right;
	flex-shrink: 0;
}

.grid-bracket__team--winner .grid-bracket__team-name {
	color: #1a6b1a;
	font-weight: 600;
}

.grid-bracket__team--winner .grid-bracket__score {
	color: #1a6b1a;
}

/* --- SVG connector overlay --- */

.grid-bracket__connectors {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
	overflow: visible;
}

/* =============================================================
   Responsive — tablet (< 768px)
   ============================================================= */

@media (max-width: 767px) {
	.grid-bracket__round {
		width: 150px;
		min-width: 150px;
	}

	.grid-bracket__team {
		padding: 4px 5px;
		gap: 4px;
		min-height: 26px;
	}

	.grid-bracket__logo {
		width: 16px;
		height: 16px;
	}

	.grid-bracket__team-name {
		font-size: 11px;
	}

	.grid-bracket__score {
		font-size: 11px;
	}

	.grid-bracket__slot {
		padding: 0 10px;
	}
}

/* =============================================================
   Responsive — mobile (< 480px)
   ============================================================= */

@media (max-width: 479px) {
	.grid-bracket__round {
		width: 130px;
		min-width: 130px;
	}

	.grid-bracket__team {
		padding: 3px 4px;
		gap: 3px;
		min-height: 22px;
	}

	.grid-bracket__logo {
		width: 14px;
		height: 14px;
	}

	.grid-bracket__team-name {
		font-size: 10px;
	}

	.grid-bracket__score {
		font-size: 10px;
		min-width: 12px;
	}

	.grid-bracket__slot {
		padding: 0 6px;
	}

	.grid-bracket__round-title,
	.grid-bracket__slot-label {
		font-size: 9px;
		padding: 2px 4px;
		min-height: 18px;
	}
}

/* =============================================================
   MODERN COMPACT PLAYOFF DESIGN (RE-RESTORED & REFINED)
   ============================================================= */

.grid-bracket__match {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    overflow: hidden !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
    margin-bottom: 8px !important;
}

.grid-bracket__match:hover {
    border-color: #3498db !important;
    transform: translateY(-1px) !important;
}

.grid-bracket__team {
    padding: 6px 10px !important;
    min-height: 34px !important;
    gap: 8px !important;
    border-bottom: 1px solid rgba(0,0,0,0.04) !important;
    display: flex !important;
    align-items: center !important;
}

.grid-bracket__team:last-child {
    border-bottom: none !important;
}

.grid-bracket__team-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #333 !important;
    flex: 1 !important;
}

.grid-bracket__score {
    background: rgba(0,0,0,0.04) !important;
    color: #555 !important;
    font-weight: 950 !important;
    min-width: 26px !important;
    text-align: center !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    padding: 2px 0 !important;
}

/* Winner Styling (Less Intense as requested) */
.grid-bracket__team--winner {
    background: rgba(52, 152, 219, 0.04) !important;
}

.grid-bracket__team--winner .grid-bracket__team-name {
    font-weight: 950 !important;
    color: #2c3e50 !important;
}

.grid-bracket__team--winner .grid-bracket__score {
    background: rgba(52, 152, 219, 0.15) !important;
    color: #3498db !important;
    border: 1px solid rgba(52, 152, 219, 0.1) !important;
}

.grid-bracket__team--loser {
    opacity: 0.55 !important;
}

/* Connectors */
.grid-bracket__connectors path {
    stroke: #3498db !important;
    stroke-width: 1.5px !important;
    opacity: 0.25 !important;
}

/* Dark Mode Support */
body.digital_newspaper_dark_mode .grid-bracket__match {
    background: #1e2124 !important;
    border-color: rgba(255,255,255,0.08) !important;
}

body.digital_newspaper_dark_mode .grid-bracket__team-name {
    color: #eee !important;
}

body.digital_newspaper_dark_mode .grid-bracket__team--winner .grid-bracket__team-name {
    color: #fff !important;
}

body.digital_newspaper_dark_mode .grid-bracket__score {
    background: rgba(255,255,255,0.05) !important;
    color: #aaa !important;
}

body.digital_newspaper_dark_mode .grid-bracket__team--winner .grid-bracket__score {
    background: rgba(52, 152, 219, 0.2) !important;
    color: #3498db !important;
}

body.digital_newspaper_dark_mode .grid-bracket__round-title {
    color: #888 !important;
}
