/*
 * "Broadcast stage" theme for the public bracket view.
 * Deliberately a single dark world (like a video-player skin) so the
 * bracket reads the same way regardless of the host theme's light/dark
 * mode — team names and live status need to scan instantly, the way a
 * tournament overlay does on a match broadcast.
 */

.gtb-stage {
	--gtb-bg: #10131a;
	--gtb-surface: #1a1e27;
	--gtb-surface-2: #232837;
	--gtb-border: #2e3340;
	--gtb-text: #edeef2;
	--gtb-text-dim: #8c93a3;
	--gtb-gold: #e8b339;
	--gtb-gold-soft: rgba( 232, 179, 57, 0.14 );
	--gtb-gold-ink: #2b2106;
	--gtb-live: #37d6b2;
	--gtb-live-soft: rgba( 55, 214, 178, 0.14 );
	--gtb-muted: #4a5064;
	--gtb-radius: 10px;
	--gtb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var( --gtb-font );
	color: var( --gtb-text ) !important;
	background: var( --gtb-bg ) !important;
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba( 0, 0, 0, 0.35 );
	overflow: hidden;
}

/*
 * Defensive hardening: some host themes style article/content wrappers
 * (.hentry, .entry-content, generic "article {}" rules, etc.) with their
 * own background/color and enough specificity to leak through onto our
 * inner sections, which have no background of their own and would
 * otherwise show the theme's background instead of the stage. Since this
 * is a deliberate single dark world (see comment above), every section
 * repaints its own background/color explicitly so nothing bleeds through
 * regardless of the surrounding theme.
 */
.gtb-stage,
.gtb-stage p,
.gtb-stage li,
.gtb-stage h1,
.gtb-stage h2,
.gtb-stage h3 {
	margin-block: 0;
}

.gtb-stage a {
	text-decoration: none;
}

.gtb-stage * {
	box-sizing: border-box;
}

.gtb-stage ::selection {
	background: var( --gtb-gold );
	color: var( --gtb-gold-ink );
}

/* ---------- Page wrap / header ---------- */

.gtb-page-wrap {
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
}

.gtb-page-header {
	position: relative;
	padding: 36px 28px 26px;
	background:
		radial-gradient( 900px 220px at 15% -20%, var( --gtb-gold-soft ), transparent 60% ),
		linear-gradient( 180deg, var( --gtb-surface ), var( --gtb-bg ) ) !important;
	border-bottom: 1px solid var( --gtb-border );
}

.gtb-page-header::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 64px;
	height: 6px;
	background: var( --gtb-gold );
	clip-path: polygon( 0 0, 100% 0, 82% 100%, 0% 100% );
}

.gtb-page-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var( --gtb-gold ) !important;
	margin: 0 0 10px;
}

.gtb-page-title {
	margin: 0 0 14px;
	font-size: clamp( 22px, 4vw, 32px );
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.15;
	text-wrap: balance;
	color: #fff !important;
}

.gtb-page-description {
	margin: 0 0 16px;
	max-width: 640px;
	font-size: 14px;
	line-height: 1.6;
	color: var( --gtb-text-dim ) !important;
}

.gtb-page-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	color: var( --gtb-text-dim );
	font-size: 13px;
}

.gtb-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	border: 1px solid var( --gtb-border );
	border-radius: 999px;
	background: var( --gtb-surface-2 ) !important;
	color: var( --gtb-text-dim ) !important;
	font-weight: 600;
	white-space: nowrap;
}

.gtb-chip svg {
	width: 13px;
	height: 13px;
	flex: none;
}

.gtb-chip-live {
	color: var( --gtb-live );
	border-color: rgba( 55, 214, 178, 0.35 );
	background: var( --gtb-live-soft );
}

.gtb-chip-gold {
	color: var( --gtb-gold );
	border-color: rgba( 232, 179, 57, 0.35 );
	background: var( --gtb-gold-soft );
}

.gtb-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.gtb-chip-live .gtb-dot {
	animation: gtb-pulse 1.8s ease-in-out infinite;
}

@keyframes gtb-pulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba( 55, 214, 178, 0.5 ); }
	50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba( 55, 214, 178, 0 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.gtb-chip-live .gtb-dot {
		animation: none;
	}
}

.gtb-page-content {
	padding: 26px 28px 40px;
	background: var( --gtb-bg ) !important;
}

.gtb-empty {
	text-align: center;
	color: var( --gtb-text-dim ) !important;
	padding: 50px 20px;
}

/* ---------- Search ---------- */

.gtb-search-wrap {
	max-width: 460px;
	margin: 0 auto 34px;
}

.gtb-search-wrap label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --gtb-text-dim );
	text-align: center;
}

.gtb-search-field {
	position: relative;
}

.gtb-search-field svg {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY( -50% );
	width: 16px;
	height: 16px;
	color: var( --gtb-text-dim );
	pointer-events: none;
}

#gtb-team-search {
	width: 100%;
	background: var( --gtb-surface ) !important;
	border: 1px solid var( --gtb-border );
	color: var( --gtb-text ) !important;
	padding: 13px 16px 13px 42px;
	font-size: 15px;
	border-radius: 999px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#gtb-team-search::placeholder {
	color: var( --gtb-muted );
}

#gtb-team-search:focus {
	outline: none;
	border-color: var( --gtb-gold );
	box-shadow: 0 0 0 4px var( --gtb-gold-soft );
}

.gtb-search-result {
	margin-top: 12px;
	padding: 12px 16px;
	background: var( --gtb-surface ) !important;
	border: 1px solid var( --gtb-border );
	border-left: 3px solid var( --gtb-gold );
	border-radius: 8px;
	font-size: 14px;
}

.gtb-search-result strong {
	display: block;
	margin-bottom: 3px;
	color: #fff !important;
	font-size: 15px;
}

.gtb-search-result span {
	color: var( --gtb-text-dim ) !important;
}

/* ---------- Bracket ---------- */

.gtb-bracket-scroll {
	overflow-x: auto;
	padding-bottom: 8px;
	margin: 0 -4px;
}

.gtb-bracket {
	display: flex;
	align-items: stretch;
	min-width: max-content;
	gap: 36px;
	padding: 4px;
}

.gtb-round {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	min-width: 232px;
}

.gtb-round-title {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 11px;
	font-weight: 700;
	color: var( --gtb-text-dim ) !important;
	margin: 0 0 14px;
}

.gtb-round-matches {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	flex: 1;
	gap: 22px;
}

.gtb-match {
	background: var( --gtb-surface ) !important;
	border: 1px solid var( --gtb-border );
	border-radius: var( --gtb-radius );
	position: relative;
	overflow: hidden;
}

.gtb-match-schedule {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 7px 13px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var( --gtb-text-dim ) !important;
	background: var( --gtb-surface-2 ) !important;
	border-bottom: 1px solid var( --gtb-border );
}

.gtb-match-schedule svg {
	width: 12px;
	height: 12px;
	flex: none;
}

/* connector nub reaching toward the next round */
.gtb-round:not(:last-child) .gtb-match::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -18px;
	width: 18px;
	height: 1px;
	background: var( --gtb-border );
}

.gtb-round:not(:last-child) .gtb-match:has(.gtb-slot-winner)::after {
	background: var( --gtb-gold );
}

.gtb-slot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 13px;
	border-bottom: 1px solid var( --gtb-border );
	font-size: 14px;
	font-weight: 500;
	color: var( --gtb-text-dim ) !important;
	background: transparent;
}

.gtb-slot:last-child {
	border-bottom: none;
}

.gtb-slot-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gtb-slot-winner {
	background: var( --gtb-gold-soft ) !important;
	color: #fff !important;
	font-weight: 700;
	box-shadow: inset 3px 0 0 var( --gtb-gold );
}

.gtb-slot-score {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var( --gtb-text-dim ) !important;
	flex: none;
}

.gtb-slot-winner .gtb-slot-score {
	color: var( --gtb-gold ) !important;
}

.gtb-slot.gtb-highlight {
	outline: 2px solid var( --gtb-gold );
	outline-offset: -2px;
}

.gtb-round-champion {
	justify-content: center;
}

.gtb-champion-card {
	background: linear-gradient( 165deg, var( --gtb-gold-soft ), var( --gtb-surface ) 60% ) !important;
	border: 1px solid rgba( 232, 179, 57, 0.4 );
	border-radius: var( --gtb-radius );
	padding: 22px 18px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.gtb-champion-card svg {
	width: 30px;
	height: 30px;
	color: var( --gtb-gold ) !important;
}

.gtb-champion-name {
	font-size: 17px;
	font-weight: 800;
	color: #fff !important;
}

/* ---------- Tournament list shortcode ---------- */

.gtb-tournament-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 14px;
}

.gtb-tournament-list-item {
	background: var( --gtb-surface, #1a1e27 ) !important;
	border: 1px solid var( --gtb-border, #2e3340 );
	border-radius: 12px;
	overflow: hidden;
	transition: transform 0.15s ease, border-color 0.15s ease;
}

.gtb-tournament-list-item:hover {
	transform: translateY( -2px );
	border-color: var( --gtb-gold, #e8b339 );
}

.gtb-tournament-list-item a {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px;
	text-decoration: none;
	color: inherit;
}

.gtb-list-title {
	font-weight: 800;
	font-size: 16px;
	color: #fff !important;
}

.gtb-list-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12.5px;
	color: var( --gtb-text-dim, #8c93a3 ) !important;
}

.gtb-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.03em;
	border: 1px solid var( --gtb-border, #2e3340 );
	color: var( --gtb-text-dim, #8c93a3 ) !important;
}

.gtb-badge[data-status="ongoing"] {
	color: var( --gtb-live, #37d6b2 ) !important;
	border-color: rgba( 55, 214, 178, 0.35 );
	background: var( --gtb-live-soft, rgba( 55, 214, 178, 0.14 ) ) !important;
}

.gtb-badge[data-status="ongoing"]::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.gtb-badge[data-status="done"] {
	color: var( --gtb-gold, #e8b339 ) !important;
	border-color: rgba( 232, 179, 57, 0.35 );
	background: var( --gtb-gold-soft, rgba( 232, 179, 57, 0.14 ) ) !important;
}

/* Standalone list/grid can appear outside the dark .gtb-stage wrapper
   (dropped anywhere via [gtb_list]) so give it its own dark card look. */
.gtb-tournament-list:not( .gtb-stage * ) {
	background: #10131a;
	padding: 16px;
	border-radius: 14px;
}

@media ( max-width: 600px ) {
	.gtb-page-header {
		padding: 28px 18px 20px;
	}
	.gtb-page-content {
		padding: 20px 16px 32px;
	}
	.gtb-round {
		min-width: 200px;
	}
	.gtb-bracket {
		gap: 26px;
	}
}
