/* Tenis Magazyn – Polacy na korcie
   Pasek pod menu (w miejscu tickera): tło jak nagłówek, czcionki złote, czerwone i białe. */

.tm-mp {
	--tm-bg: #0E2240;          /* tło nagłówka */
	--tm-card: rgba(255, 255, 255, 0.05);
	--tm-line: rgba(255, 255, 255, 0.12);
	--tm-gold: #C8AD4F;        /* złoty z menu */
	--tm-red: #E5383B;         /* na żywo */
	--tm-white: #FFFFFF;
	--tm-muted: rgba(255, 255, 255, 0.62);
	--tm-gap: 10px;
	--tm-card-w: 248px;

	box-sizing: border-box;
	background: var(--tm-bg);
	color: var(--tm-white);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px;
	line-height: 1.3;
	padding: 10px 20px;
	border-top: 1px solid var(--tm-line);
}
.tm-mp *,
.tm-mp *::before,
.tm-mp *::after { box-sizing: border-box; }

/* ---------- Pasek: etykieta | karty | strzałki ---------- */
.tm-mp--pasek {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
}
.tm-mp__head { display: flex; align-items: center; }
.tm-mp__title {
	font-family: "Anton", "Oswald", Impact, sans-serif;
	font-weight: 400;
	font-size: 15px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--tm-gold);
	white-space: nowrap;
	line-height: 1.1;
	padding-right: 14px;
	border-right: 2px solid var(--tm-gold);
	margin: 0;
}

.tm-mp__body { min-width: 0; }

.tm-mp__track {
	display: flex;
	gap: var(--tm-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	outline: none;
}
.tm-mp__track::-webkit-scrollbar { display: none; }

.tm-mp--pasek .tm-mp__card {
	flex: 0 0 var(--tm-card-w);
	scroll-snap-align: start;
}

.tm-mp__nav { display: flex; gap: 6px; }
.tm-mp__arrow {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid var(--tm-gold);
	background: transparent;
	color: var(--tm-gold);
	font-size: 20px;
	line-height: 1;
	padding: 0 0 2px;
	cursor: pointer;
	transition: background .15s, color .15s, opacity .15s;
}
.tm-mp__arrow:hover,
.tm-mp__arrow:focus-visible { background: var(--tm-gold); color: var(--tm-bg); outline: none; }
.tm-mp__arrow[disabled] { opacity: .3; cursor: default; background: transparent; color: var(--tm-gold); }

/* ---------- Karta meczu ---------- */
.tm-mp__card {
	background: var(--tm-card);
	border: 1px solid var(--tm-line);
	border-radius: 8px;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}
.tm-mp__card--live { border-color: rgba(229, 56, 59, 0.65); box-shadow: inset 3px 0 0 var(--tm-red); }
.tm-mp__card--done { opacity: .82; }

.tm-mp__top {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}
.tm-mp__when {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: var(--tm-gold);
	white-space: nowrap;
}
.tm-mp__event {
	font-size: 11px;
	color: var(--tm-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tm-mp__live { color: var(--tm-red); display: inline-flex; align-items: center; gap: 5px; }
.tm-mp__live i {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--tm-red);
	animation: tm-mp-pulse 1.4s ease-in-out infinite;
}
@keyframes tm-mp-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.tm-mp__elapsed { color: var(--tm-white); font-weight: 700; text-transform: none; letter-spacing: 0; }
.tm-mp__done { color: var(--tm-muted); }

.tm-mp__players { display: flex; flex-direction: column; gap: 2px; }
.tm-mp__row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	color: rgba(255, 255, 255, 0.78);
}
.tm-mp__row.is-pl { color: var(--tm-white); font-weight: 800; }
.tm-mp__row.is-winner .tm-mp__name { color: var(--tm-white); }
.tm-mp__row.is-winner .tm-mp__name::after { content: " ✓"; color: var(--tm-gold); }
.tm-mp__name {
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tm-mp__pl {
	display: inline-block;
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	padding: 2px 3px;
	border-radius: 2px;
	color: var(--tm-white);
	background: var(--tm-red);
	text-decoration: none;
	vertical-align: 1px;
	border: 0;
}
.tm-mp__serve {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--tm-gold);
	flex: 0 0 6px;
}
.tm-mp__sets { display: flex; gap: 2px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.tm-mp__set {
	min-width: 16px;
	text-align: center;
	font-weight: 700;
	color: var(--tm-white);
}
.tm-mp__game {
	min-width: 22px;
	text-align: center;
	font-weight: 800;
	color: var(--tm-bg);
	background: var(--tm-gold);
	border-radius: 3px;
	margin-left: 2px;
}

.tm-mp__tv {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 700;
	color: var(--tm-gold);
	white-space: nowrap;
	overflow: hidden;
	border-top: 1px solid var(--tm-line);
	padding-top: 5px;
	margin-top: auto;
}
.tm-mp__tv svg { flex: 0 0 auto; }
.tm-mp__tv span { overflow: hidden; text-overflow: ellipsis; }
.tm-mp__tv a { color: inherit; text-decoration: none; }
.tm-mp__tv a:hover { color: var(--tm-white); }
.tm-mp__notv { color: var(--tm-muted); font-weight: 400; }

.tm-mp__empty { margin: 0; color: var(--tm-muted); font-size: 13px; }

/* ---------- Układ „lista” (np. do sidebaru) ---------- */
.tm-mp--lista .tm-mp__head { margin-bottom: 10px; }
.tm-mp--lista .tm-mp__title { border-right: 0; padding-right: 0; }
.tm-mp--lista .tm-mp__track { flex-direction: column; overflow: visible; scroll-snap-type: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	.tm-mp { padding: 10px 16px; }
	.tm-mp { --tm-card-w: 230px; }
}

/* ---------- Telefon: 2 mecze naraz, przewijanie palcem ---------- */
@media (max-width: 767px) {
	.tm-mp { padding: 8px 12px 10px; --tm-gap: 8px; }
	.tm-mp--pasek {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "head nav" "body body";
		row-gap: 8px;
		column-gap: 8px;
	}
	.tm-mp--pasek .tm-mp__head { grid-area: head; }
	.tm-mp--pasek .tm-mp__body { grid-area: body; }
	.tm-mp--pasek .tm-mp__nav { grid-area: nav; }
	.tm-mp__title { font-size: 14px; border-right: 0; padding-right: 0; }
	.tm-mp__arrow { width: 26px; height: 26px; font-size: 17px; }

	.tm-mp--pasek .tm-mp__card { flex: 0 0 calc((100% - var(--tm-gap)) / 2); padding: 7px 8px; }
	.tm-mp__card { font-size: 12px; gap: 4px; }
	.tm-mp__when { font-size: 10px; }
	.tm-mp__event, .tm-mp__tv { font-size: 10px; }
	.tm-mp__set { min-width: 12px; }
	.tm-mp__game { min-width: 18px; }
	.tm-mp__tv svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tm-mp__track { scroll-behavior: auto; }
	.tm-mp__live i { animation: none; }
}

/* ---------- Diagnostyka (tylko administrator, po włączeniu w ustawieniach) ---------- */
.tm-mp__debug {
	grid-column: 1 / -1;
	margin-top: 8px;
	padding: 6px 8px;
	border: 1px dashed var(--tm-gold);
	border-radius: 6px;
	font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: var(--tm-white);
	background: rgba(0, 0, 0, 0.25);
}
.tm-mp__debug strong { color: var(--tm-gold); margin-right: 6px; }
.tm-mp__debug span { display: inline-block; margin-right: 12px; }
.tm-mp__debug em { font-style: normal; color: var(--tm-gold); }
.tm-mp__dbg { font: 10px/1.3 ui-monospace, Menlo, Consolas, monospace; color: var(--tm-muted); }
.tm-mp__dbg b { color: var(--tm-red); }
@media (max-width: 767px) {
	.tm-mp--pasek .tm-mp__debug { grid-area: auto; grid-column: 1 / -1; }
}
.tm-mp__asof { color: var(--tm-muted); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* Gdzie oglądać: potwierdzone (program TV / redakcja) vs. tylko prawa do transmisji */
.tm-mp__tv.is-verified span::after { content: " ✓"; color: var(--tm-white); font-weight: 800; }
.tm-mp__tv.is-rights { color: var(--tm-muted); font-weight: 600; }
.tm-mp__tv.is-rights a { color: inherit; }

/* ---------- 1.5: wynik na żywo (tennis-api.com) ---------- */
.tm-mp__top { position: relative; padding-right: 0; }
.tm-mp__card.has-stats .tm-mp__top { padding-right: 78px; }
.tm-mp__row .tm-mp__serve { margin-left: -2px; }
.tm-mp__set { color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.tm-mp__set.is-won { color: var(--tm-white); font-weight: 800; }
.tm-mp__set.is-current { color: var(--tm-gold); font-weight: 800; }
.tm-mp__set.is-unfinished { opacity: 0.5; font-style: italic; font-weight: 600; }
.tm-mp__card--done .tm-mp__set.is-won { color: var(--tm-white); }

/* Przycisk „Statystyki” w rogu karty */
.tm-mp__statbtn {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font: 700 10px/1 "Manrope", system-ui, sans-serif;
	letter-spacing: .3px;
	text-transform: uppercase;
	color: var(--tm-gold);
	background: transparent;
	border: 1px solid rgba(200, 173, 79, 0.55);
	border-radius: 999px;
	padding: 4px 7px;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.tm-mp__statbtn:hover,
.tm-mp__statbtn:focus-visible,
.tm-mp__statbtn[aria-expanded="true"] { background: var(--tm-gold); color: var(--tm-bg); outline: none; }
.tm-mp__card.is-open { border-color: var(--tm-gold); }

/* Panel statystyk pod paskiem (na całą szerokość) */
.tm-mp__panel { grid-column: 1 / -1; }
.tm-mp__panel[hidden] { display: none !important; }
.tm-mp__sp {
	margin-top: 4px;
	border: 1px solid var(--tm-line);
	border-top: 2px solid var(--tm-gold);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
	padding: 12px 14px 10px;
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}
.tm-mp__sp-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
}
.tm-mp__sp-name { font-weight: 800; font-size: 14px; color: rgba(255, 255, 255, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-mp__sp-name.is-pl { color: var(--tm-white); }
.tm-mp__sp-name.is-pl::after { content: "PL"; font-size: 9px; font-weight: 800; color: var(--tm-white); background: var(--tm-red); border-radius: 2px; padding: 2px 3px; margin-left: 6px; vertical-align: 2px; }
.tm-mp__sp-name.is-right { text-align: right; }
.tm-mp__sp-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: .4px; }
.tm-mp__sp-mid b { font-family: "Anton", "Oswald", Impact, sans-serif; font-weight: 400; font-size: 20px; letter-spacing: 1px; color: var(--tm-gold); white-space: pre; text-transform: none; }
.tm-mp__sp-close {
	width: 28px; height: 28px; border-radius: 50%;
	border: 1px solid var(--tm-line); background: transparent; color: var(--tm-white);
	font-size: 18px; line-height: 1; cursor: pointer; padding: 0 0 2px;
}
.tm-mp__sp-close:hover, .tm-mp__sp-close:focus-visible { border-color: var(--tm-gold); color: var(--tm-gold); outline: none; }
.tm-mp__sp-sub { text-align: center; color: var(--tm-muted); font-size: 11px; margin: 2px 0 8px; }
.tm-mp__sp-rows { display: flex; flex-direction: column; }
.tm-mp__sp-row {
	display: grid;
	grid-template-columns: 1fr minmax(120px, 1.6fr) 1fr;
	grid-template-areas: "v1 l v2" "bar bar bar";
	align-items: baseline;
	column-gap: 8px;
	padding: 6px 0 7px;
	border-top: 1px solid var(--tm-line);
}
.tm-mp__sp-row:first-child { border-top: 0; }
.tm-mp__sp-v { grid-area: v1; font-weight: 700; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.78); }
.tm-mp__sp-v.is-right { grid-area: v2; text-align: right; }
.tm-mp__sp-v.is-lead { color: var(--tm-white); font-weight: 800; }
.tm-mp__sp-l { grid-area: l; text-align: center; color: var(--tm-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.tm-mp__sp-bar { grid-area: bar; height: 3px; margin-top: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.tm-mp__sp-bar i { display: block; height: 100%; background: var(--tm-gold); border-radius: 2px 0 0 2px; }
.tm-mp__sp-foot { margin-top: 6px; color: var(--tm-muted); font-size: 10px; text-align: right; }

@media (max-width: 767px) {
	.tm-mp--pasek .tm-mp__panel { grid-area: auto; grid-column: 1 / -1; }
	.tm-mp__card.has-stats .tm-mp__top { padding-right: 30px; }
	.tm-mp__statbtn { padding: 4px 5px; }
	.tm-mp__statbtn span { display: none; }
	.tm-mp__sp { padding: 10px 10px 8px; }
	.tm-mp__sp-head { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); row-gap: 4px; }
	.tm-mp__sp-close { grid-column: 3; grid-row: 1; justify-self: end; width: 24px; height: 24px; }
	.tm-mp__sp-head .tm-mp__sp-name { font-size: 12px; grid-row: 2; }
	.tm-mp__sp-head .tm-mp__sp-name:first-child { grid-column: 1; }
	.tm-mp__sp-head .tm-mp__sp-name.is-right { grid-column: 3; }
	.tm-mp__sp-mid { grid-column: 2; grid-row: 1 / span 2; }
	.tm-mp__sp-mid b { font-size: 17px; }
	.tm-mp__sp-row { grid-template-columns: 1fr minmax(96px, 1.4fr) 1fr; font-size: 12px; }
	.tm-mp__sp-l { font-size: 10px; }
}
.tm-mp__sp-v small { font-size: 11px; font-weight: 600; color: var(--tm-muted); }
@media (max-width: 767px) {
	.tm-mp__sp-v small { display: none; }
	.tm-mp__sp-row { grid-template-columns: 52px minmax(0, 1fr) 52px; }
}

/* ---------- 1.6: ranking, przebieg meczu, H2H ---------- */
.tm-mp__rank {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	color: var(--tm-muted);
	font-variant-numeric: tabular-nums;
	vertical-align: 1px;
}
.tm-mp__rank::before { content: "#"; opacity: .7; }
.tm-mp__sec { margin-top: 10px; }
.tm-mp__sec + .tm-mp__sec { border-top: 1px solid var(--tm-line); padding-top: 10px; }
.tm-mp__sec-t {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: var(--tm-gold);
	margin-bottom: 8px;
}
.tm-mp__lg { display: inline-flex; align-items: center; gap: 5px; color: var(--tm-muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.tm-mp__lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.tm-mp__lg i.g1, .tm-mp__pg-g i.g1 { background: var(--tm-gold); }
.tm-mp__lg i.g2, .tm-mp__pg-g i.g2 { background: rgba(255, 255, 255, 0.82); }
.tm-mp__lg i.gb { background: transparent; box-shadow: inset 0 -3px 0 var(--tm-red); border: 1px solid rgba(255,255,255,.35); }
.tm-mp__pg { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 0; }
.tm-mp__pg-l { font-size: 11px; color: var(--tm-muted); font-weight: 700; text-transform: uppercase; }
.tm-mp__pg-g { display: flex; flex-wrap: wrap; gap: 4px; }
.tm-mp__pg-g i { width: 18px; height: 18px; border-radius: 3px; display: inline-block; position: relative; }
.tm-mp__pg-g i.is-b { box-shadow: inset 0 -4px 0 var(--tm-red); }
.tm-mp__pg-g i.is-tb::after { content: "TB"; position: absolute; inset: 0; font: 800 7px/18px "Manrope", sans-serif; text-align: center; color: var(--tm-bg); }
.tm-mp__pg-g i.is-u { opacity: .38; }
.tm-mp__h2h { display: flex; justify-content: center; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 700; color: rgba(255,255,255,.8); }
.tm-mp__h2h b { font-family: "Anton", "Oswald", Impact, sans-serif; font-weight: 400; font-size: 24px; color: var(--tm-white); }
.tm-mp__h2h .is-lead b { color: var(--tm-gold); }
.tm-mp__h2h em { font-style: normal; color: var(--tm-muted); }
.tm-mp__mt { list-style: none; margin: 8px 0 0; padding: 0; }
.tm-mp__mt li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--tm-line); font-size: 12px; color: var(--tm-muted); }
.tm-mp__mt li b { color: var(--tm-white); }
.tm-mp__mt li span:last-child { text-align: right; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
	.tm-mp__pg { grid-template-columns: 36px minmax(0, 1fr); }
	.tm-mp__pg-g i { width: 15px; height: 15px; }
	.tm-mp__pg-g i.is-tb::after { line-height: 15px; font-size: 6px; }
	.tm-mp__lg { font-size: 10px; }
}
@media (max-width: 767px) {
	.tm-mp__card .tm-mp__rank { display: none; } /* na telefonie ranking tylko w panelu szczegółów */
}
.tm-mp__h2h.is-first { font-size: 14px; font-weight: 800; color: var(--tm-gold); text-transform: uppercase; letter-spacing: .4px; padding: 4px 0 2px; }
.tm-mp__sp-note { margin: 6px 0 2px; padding: 6px 10px; font-size: 12px; line-height: 1.4; color: var(--tm-gold); border: 1px solid rgba(200, 173, 79, 0.45); border-radius: 6px; background: rgba(200, 173, 79, 0.08); }
