.hrtg-spielbetrieb {
	--hrtg-green: var(--tvr-green, #16a329);
	--hrtg-black: var(--tvr-black, #111111);
	--hrtg-muted: var(--tvr-text-muted, #555555);
	--hrtg-line: var(--tvr-border, #e5e5e5);
	--hrtg-card-bg: var(--tvr-card-bg, #f3f3f3);
	width: 100%;
	max-width: 1200px;
}

/* Exakt dieselbe Inhaltsachse wie Service, Mannschaften und Aktuelles. */
.home-spielplan > .wp-block-shortcode,
.team-games > .wp-block-shortcode,
.home-spielplan .wp-block-shortcode:has(.hrtg-spielbetrieb),
.team-games .wp-block-shortcode:has(.hrtg-spielbetrieb) {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 1200px !important;
	margin-right: auto !important;
	margin-left: auto !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* Entfernt die frühere weiße Widget-Schale. So steht nicht mehr eine
   große Rundung direkt über den Rundungen der ersten Kartenzeile. */
.home-spielplan .wp-block-group:has(.hrtg-spielbetrieb),
.team-games .wp-block-group:has(.hrtg-spielbetrieb) {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 1200px !important;
	margin-right: auto !important;
	margin-left: auto !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* Liegt der Shortcode in einer solchen Gruppe, nutzt er deren gesamte Breite
   und wird nicht ein zweites Mal um 48 Pixel verkleinert. */
.home-spielplan .wp-block-group:has(.hrtg-spielbetrieb) .wp-block-shortcode:has(.hrtg-spielbetrieb),
.team-games .wp-block-group:has(.hrtg-spielbetrieb) .wp-block-shortcode:has(.hrtg-spielbetrieb) {
	width: 100% !important;
	max-width: none !important;
}

.hrtg-spielbetrieb__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.hrtg-game {
	position: relative;
	display: grid;
	grid-template-columns: 108px minmax(0, 1fr) 28px;
	align-items: stretch;
	min-height: 152px;
	color: var(--hrtg-black);
	background: var(--hrtg-card-bg);
	border: 0;
	border-top: 4px solid var(--hrtg-green);
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none !important;
	box-shadow: none;
	transition: background-color .2s ease;
}

.hrtg-game:hover,
.hrtg-game:focus-visible {
	color: var(--hrtg-black);
	background: var(--tvr-action-hover, #f7fbf8);
}

.hrtg-game:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--hrtg-green), transparent 60%);
	outline-offset: 2px;
}

.hrtg-game__date {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	padding: 20px 18px;
	color: var(--hrtg-black);
	background: transparent;
	border-right: 1px solid var(--hrtg-line);
	box-shadow: none;
}

.hrtg-game__date strong {
	font-size: 1.02rem;
	line-height: 1.2;
}

.hrtg-game__date span {
	font-size: .86rem;
	color: var(--hrtg-muted);
}

.hrtg-game__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 9px;
	min-width: 0;
	padding: 20px 12px 20px 22px;
}

.hrtg-game__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: .72rem;
	font-weight: 750;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.hrtg-game__team-label {
	color: var(--hrtg-green);
}

.hrtg-game__home-away {
	color: var(--hrtg-muted);
}

.hrtg-game__home-away::before {
	content: "·";
	margin-right: 6px;
}

.hrtg-game__cancelled {
	padding: 2px 6px;
	color: #fff;
	background: #b42318;
	border-radius: 4px;
}

.hrtg-game__pairing {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	font-size: 1rem;
	font-weight: 750;
	line-height: 1.28;
	overflow-wrap: normal;
	word-break: normal;
}

.hrtg-game__pairing span:first-child {
	text-align: left;
}

.hrtg-game__separator {
	display: block;
	width: auto;
	height: auto;
	margin: 0;
	color: var(--hrtg-muted);
	background: transparent;
	font-size: .78rem;
	line-height: 1;
}

.hrtg-game__details {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	color: var(--hrtg-muted);
	font-size: .76rem;
	line-height: 1.35;
}

.hrtg-game__details span + span::before {
	content: "·";
	margin-right: 12px;
}

.hrtg-game__arrow {
	align-self: center;
	color: var(--hrtg-green);
	font-size: 1.8rem;
	line-height: 1;
}

.hrtg-game--cancelled {
	opacity: .68;
}

.hrtg-game--cancelled .hrtg-game__pairing {
	text-decoration: line-through;
}

.hrtg-spielbetrieb__source {
	margin: 12px 2px 0;
	color: var(--hrtg-muted);
	font-size: .72rem;
	text-align: right;
}

.hrtg-spielbetrieb__source a {
	color: inherit;
}

.hrtg-spielbetrieb__empty {
	padding: 16px 18px;
	color: var(--hrtg-muted);
	background: var(--hrtg-card-bg);
	border-radius: 10px;
}

@media (max-width: 880px) {
	.home-spielplan > .wp-block-shortcode,
	.team-games > .wp-block-shortcode,
	.home-spielplan .wp-block-shortcode:has(.hrtg-spielbetrieb),
	.team-games .wp-block-shortcode:has(.hrtg-spielbetrieb),
	.home-spielplan .wp-block-group:has(.hrtg-spielbetrieb),
	.team-games .wp-block-group:has(.hrtg-spielbetrieb) {
		width: 100% !important;
		max-width: 1200px !important;
	}

	.home-spielplan .wp-block-group:has(.hrtg-spielbetrieb) .wp-block-shortcode:has(.hrtg-spielbetrieb),
	.team-games .wp-block-group:has(.hrtg-spielbetrieb) .wp-block-shortcode:has(.hrtg-spielbetrieb) {
		width: 100% !important;
	}

	.hrtg-spielbetrieb__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (max-width: 520px) {
	.hrtg-game {
		grid-template-columns: 88px minmax(0, 1fr) 18px;
		min-height: 144px;
		border-radius: 10px;
	}

	.hrtg-game__date {
		padding: 16px 12px;
	}

	.hrtg-game__body {
		padding: 14px 8px 14px 13px;
	}

	.hrtg-game__pairing {
		font-size: .93rem;
	}

	.hrtg-game__details span {
		display: block;
		width: 100%;
	}

	.hrtg-game__details span + span::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hrtg-game {
		transition: none;
	}
}

/* Ergebnisse ------------------------------------------------------------- */
.hrtg-results__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.hrtg-result {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	align-items: center;
	gap: 18px;
	min-height: 84px;
	padding: 15px 18px;
	color: var(--hrtg-black);
	background: var(--hrtg-card-bg);
	border-top: 4px solid var(--hrtg-green);
	border-radius: 10px;
	box-shadow: none;
}

.hrtg-result__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: var(--hrtg-muted);
	font-size: .78rem;
}

.hrtg-result__outcome {
	color: var(--hrtg-green);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.hrtg-result__pairing {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	min-width: 0;
	font-size: .95rem;
	font-weight: 700;
}

.hrtg-result__pairing span:first-child {
	text-align: right;
}

.hrtg-result__pairing span:last-child {
	text-align: left;
}

.hrtg-result__pairing strong {
	min-width: 68px;
	font-size: 1.28rem;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
}

.hrtg-result__competition {
	grid-column: 1 / -1;
	max-width: none;
	color: var(--hrtg-muted);
	font-size: .72rem;
	line-height: 1.3;
	text-align: right;
}

/* Tabelle --------------------------------------------------------------- */
.hrtg-table__competition {
	margin: 0 0 10px;
	color: var(--hrtg-muted);
	font-size: .82rem;
}

.hrtg-table__scroll {
	width: 100%;
	overflow-x: auto;
	background: var(--hrtg-card-bg);
	border-top: 4px solid var(--hrtg-green);
	border-radius: 10px;
	box-shadow: none;
}

.hrtg-table {
	width: 100%;
	min-width: 590px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: .9rem;
}

.hrtg-table th,
.hrtg-table td {
	padding: 11px 14px;
	border: 0;
	border-bottom: 1px solid var(--hrtg-line);
	text-align: right;
	white-space: nowrap;
}

.hrtg-table thead th {
	color: var(--hrtg-muted);
	background: rgba(255,255,255,.45);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.hrtg-table th:nth-child(2),
.hrtg-table tbody th {
	width: 100%;
	text-align: left;
	white-space: normal;
}

.hrtg-table tbody th {
	font-weight: 700;
}

.hrtg-table tbody tr:last-child th,
.hrtg-table tbody tr:last-child td {
	border-bottom: 0;
}

.hrtg-table__own th,
.hrtg-table__own td {
	background: var(--tvr-action-hover, #f1f8f3);
	font-weight: 800;
}

.hrtg-table__own td:first-child,
.hrtg-table__own th {
	color: var(--hrtg-green);
}

.hrtg-table-wrap--compact .hrtg-table th,
.hrtg-table-wrap--compact .hrtg-table td {
	padding-top: 8px;
	padding-bottom: 8px;
	font-size: .82rem;
}

/* Mannschaftsübersicht ------------------------------------------------- */
.hrtg-team-overview {
	display: grid;
	gap: 28px;
}

.hrtg-team-overview__section {
	margin: 0;
}

.hrtg-spielbetrieb > .hrtg-section-title,
.hrtg-team-overview__section > .hrtg-section-title {
	width: 100%;
	max-width: none;
	margin: 0 0 26px !important;
	color: var(--hrtg-black);
	font-size: clamp(2rem, 4vw, 3rem) !important;
	font-weight: 800 !important;
	line-height: 1 !important;
	letter-spacing: -0.03em;
}

.hrtg-team-overview__section > .hrtg-spielbetrieb__empty {
	margin: 0;
}

.hrtg-team-overview__section > .hrtg-results__list,
.hrtg-team-overview__section > .hrtg-spielbetrieb__grid {
	gap: 16px;
}

.hrtg-team-overview__section > .hrtg-table__competition {
	margin: -4px 0 14px;
}

.hrtg-team-snapshot {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.hrtg-team-snapshot--schedule-only {
	grid-template-columns: minmax(0, 1fr);
}

.hrtg-team-snapshot__item {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-height: 124px;
	padding: 18px 20px;
	background: #ffffff;
	border-top: 4px solid var(--hrtg-green);
	border-radius: 10px;
	box-shadow: none;
}

.hrtg-team-snapshot__item > span {
	color: var(--hrtg-green);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.hrtg-team-snapshot__item > strong {
	font-size: 1.55rem;
	line-height: 1.1;
}

.hrtg-team-snapshot__item > small {
	color: var(--hrtg-muted);
	font-size: .78rem;
	line-height: 1.35;
}

@media (max-width: 880px) {
	.hrtg-results__list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 760px) {
	.hrtg-spielbetrieb > .hrtg-section-title,
	.hrtg-team-overview__section > .hrtg-section-title {
		margin-bottom: 20px !important;
	}

	.hrtg-team-snapshot {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.hrtg-team-snapshot__item {
		min-height: 0;
	}

	.hrtg-result {
		grid-template-columns: 1fr;
		gap: 9px;
	}

	.hrtg-result__meta {
		flex-direction: row;
		justify-content: space-between;
	}

	.hrtg-result__competition {
		max-width: none;
		text-align: left;
	}
}

@media (max-width: 520px) {
	.hrtg-result {
		padding: 14px;
	}

	.hrtg-result__pairing {
		grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
		gap: 8px;
		font-size: .86rem;
	}

	.hrtg-result__pairing strong {
		min-width: 54px;
		font-size: 1.13rem;
	}

	.hrtg-table th,
	.hrtg-table td {
		padding: 9px 10px;
	}
}


/* Komplette Spielliste -------------------------------------------------- */
.hrtg-game-list {
	--hrtg-list-cols: 126px minmax(150px, 1fr) 82px minmax(150px, 1fr) minmax(120px, .72fr);
}

.hrtg-game-list--no-venue {
	--hrtg-list-cols: 126px minmax(150px, 1fr) 82px minmax(150px, 1fr);
}

.hrtg-game-list__head,
.hrtg-game-list__row {
	display: grid;
	grid-template-columns: var(--hrtg-list-cols);
	align-items: center;
	column-gap: 0;
}

.hrtg-game-list__head {
	padding: 0 14px 8px;
	color: var(--hrtg-muted);
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .035em;
	text-transform: uppercase;
}

.hrtg-game-list__head span:nth-child(3) {
	text-align: center;
}

.hrtg-game-list__rows {
	display: grid;
	gap: 8px;
}

.hrtg-game-list__row {
	min-height: 66px;
	color: var(--hrtg-black);
	background: var(--hrtg-card-bg);
	border-top: 3px solid var(--hrtg-green);
	border-radius: 9px;
	overflow: hidden;
	text-decoration: none !important;
	transition: background-color .2s ease;
}

.hrtg-game-list__row:hover,
.hrtg-game-list__row:focus-visible {
	color: var(--hrtg-black);
	background: var(--tvr-action-hover, #f1f8f3);
}

.hrtg-game-list__row:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--hrtg-green), transparent 60%);
	outline-offset: 2px;
}

.hrtg-game-list__row > span,
.hrtg-game-list__row > strong {
	box-sizing: border-box;
	min-width: 0;
	padding: 12px 14px;
}

.hrtg-game-list__date {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border-right: 1px solid var(--hrtg-line);
}

.hrtg-game-list__date strong {
	font-size: .84rem;
	line-height: 1.2;
}

.hrtg-game-list__date small,
.hrtg-game-list__venue {
	color: var(--hrtg-muted);
	font-size: .73rem;
	line-height: 1.25;
}

.hrtg-game-list__team {
	font-size: .86rem;
	font-weight: 700;
	line-height: 1.25;
}

.hrtg-game-list__score {
	font-size: 1rem;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
}

.hrtg-game-list__score:not(.hrtg-game-list__score--final) {
	color: var(--hrtg-muted);
	font-weight: 500;
}

.hrtg-game-list__venue {
	border-left: 1px solid var(--hrtg-line);
}

@media (max-width: 820px) {
	.hrtg-game-list__head {
		display: none;
	}

	.hrtg-game-list__row {
		grid-template-columns: 96px minmax(0, 1fr) 58px;
		grid-template-areas:
			"date home score"
			"date away score"
			"date venue venue";
		min-height: 82px;
	}

	.hrtg-game-list--no-venue .hrtg-game-list__row {
		grid-template-areas:
			"date home score"
			"date away score";
	}

	.hrtg-game-list__date {
		grid-area: date;
		align-self: stretch;
		justify-content: center;
	}

	.hrtg-game-list__team--home { grid-area: home; padding-bottom: 4px !important; }
	.hrtg-game-list__team--away { grid-area: away; padding-top: 4px !important; }
	.hrtg-game-list__score { grid-area: score; align-self: stretch; display: flex; align-items: center; justify-content: center; }
	.hrtg-game-list__venue { grid-area: venue; padding-top: 2px !important; border-left: 0; }
}

@media (max-width: 520px) {
	.hrtg-game-list__row {
		grid-template-columns: 82px minmax(0, 1fr) 52px;
	}

	.hrtg-game-list__row > span,
	.hrtg-game-list__row > strong {
		padding-right: 10px;
		padding-left: 10px;
	}

	.hrtg-game-list__team {
		font-size: .8rem;
	}
}

/* Live-Shortcode: WordPress-Hülle transparent halten. */
.wp-block-shortcode:has(.hrtg-live-root),
.wp-block-group:has(> .wp-block-shortcode .hrtg-live-root),
.wp-block-group:has(> .wp-block-group > .wp-block-shortcode .hrtg-live-root) {
	box-sizing: border-box !important;
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.wp-block-shortcode:has(.hrtg-live-root) {
	padding: 0 !important;
}

/* Live / Livescore ------------------------------------------------------ */
.hrtg-live-root {
	width: 100%;
	max-width: 1200px;
}

.hrtg-live-root[hidden] {
	display: none !important;
}

.hrtg-live-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	background: transparent !important;
}

.hrtg-live-grid--single {
	grid-template-columns: minmax(0, 1fr);
}

.hrtg-live-grid--single .hrtg-live-card__pairing {
	grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr);
	gap: 20px;
}

.hrtg-live-grid--single .hrtg-live-card__score {
	min-width: 124px;
	font-size: 2.35rem;
}

.hrtg-live-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
	min-height: 0;
	padding: 18px 22px 18px;
	color: var(--hrtg-black);
	background: #ffffff;
	border: 1px solid var(--hrtg-line);
	border-top: 4px solid var(--hrtg-green);
	border-radius: 10px;
	text-decoration: none !important;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
	transition: background-color .2s ease, border-color .2s ease;
}

.hrtg-live-card:hover,
.hrtg-live-card:focus-visible {
	color: var(--hrtg-black);
	background: var(--tvr-action-hover, #f7fbf8);
}

.hrtg-live-card:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--hrtg-green), transparent 60%);
	outline-offset: 2px;
}

.hrtg-live-card__meta {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
	margin-bottom: 16px;
	font-size: .72rem;
	font-weight: 850;
	letter-spacing: .045em;
	text-transform: uppercase;
}

.hrtg-live-card__status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #d72b22;
	white-space: nowrap;
}

.hrtg-live-card__dot {
	width: 8px;
	height: 8px;
	background: currentColor;
	border-radius: 999px;
	box-shadow: 0 0 0 3px rgba(215, 43, 34, .10);
}

.hrtg-live-card__team-label {
	min-width: 0;
	color: var(--hrtg-green);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hrtg-live-card__team-label::before {
	content: "·";
	margin-right: 9px;
	color: var(--hrtg-muted);
}

.hrtg-live-card__pairing {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.hrtg-live-card__name {
	min-width: 0;
	font-size: 1rem;
	font-weight: 780;
	line-height: 1.25;
}

.hrtg-live-card__name--home {
	text-align: right;
}

.hrtg-live-card__name--away {
	text-align: left;
}

.hrtg-live-card__score {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	min-width: 96px;
	font-size: 2.05rem;
	font-weight: 850;
	line-height: 1;
	letter-spacing: -.035em;
	white-space: nowrap;
}

.hrtg-live-card__colon {
	color: var(--hrtg-muted);
	font-size: .72em;
	font-weight: 750;
}

.hrtg-live-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--hrtg-line);
}

.hrtg-live-card__detail {
	color: var(--hrtg-muted);
	font-size: .82rem;
	font-weight: 650;
}

.hrtg-live-card__link {
	margin-left: auto;
	color: var(--hrtg-green);
	font-size: .78rem;
	font-weight: 800;
	white-space: nowrap;
}

.hrtg-live-card__source {
	margin-top: 8px;
	color: var(--hrtg-muted);
	font-size: .66rem;
}

@media (max-width: 880px) {
	.hrtg-live-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.hrtg-live-card {
		padding: 16px 14px 14px;
	}

	.hrtg-live-card__meta {
		margin-bottom: 14px;
	}

	.hrtg-live-card__pairing,
	.hrtg-live-grid--single .hrtg-live-card__pairing {
		grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
		gap: 8px;
	}

	.hrtg-live-card__name {
		font-size: .84rem;
	}

	.hrtg-live-card__score,
	.hrtg-live-grid--single .hrtg-live-card__score {
		min-width: 76px;
		gap: 5px;
		font-size: 1.55rem;
	}

	.hrtg-live-card__footer {
		margin-top: 14px;
		padding-top: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hrtg-live-card {
		transition: none;
	}
}
