:root {
	--ctm-win: #2e7d32;
	--ctm-loss: #c62828;
	--ctm-draw: #e65100;
	--ctm-pending: #757575;
	--ctm-accent: #e53935;
	--ctm-bg: #14141c;
	--ctm-bg-alt: #1e1e2a;
	--ctm-border: #2c2c3a;
	--ctm-text: #f2f2f5;
	--ctm-text-dim: #9a9aab;
	--ctm-radius: 10px;
}

.ctm-single-wrap, .ctm-tournament-wrap, .ctm-shortcode-wrap, .ctm-widget, .ctm-widget-body { color: inherit; }

/* ═══════════ WSPÓLNE: znaczniki wyniku ═══════════ */
.ctm-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 4px; font-weight: 700; font-size: 12px; }
.ctm-badge.ctm-win { background: rgba(46,125,50,.16); color: var(--ctm-win); }
.ctm-badge.ctm-loss { background: rgba(198,40,40,.16); color: var(--ctm-loss); }
.ctm-badge.ctm-pending { background: rgba(117,117,117,.16); color: var(--ctm-pending); }

.ctm-score { font-weight: 700; }
.ctm-score.ctm-win { color: var(--ctm-win); }
.ctm-score.ctm-loss { color: var(--ctm-loss); }
.ctm-score.ctm-pending { color: var(--ctm-pending); }

.ctm-format-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .65; }
.ctm-flag { margin-right: 3px; }
.ctm-team-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 3px; vertical-align: middle; }
.ctm-no-matches { opacity: .6; font-style: italic; }
.ctm-demo-link { display: inline-block; background: var(--ctm-accent); color: #fff !important; padding: 6px 14px; border-radius: 6px; font-weight: 600; font-size: 13px; text-decoration: none !important; }

/* ═══════════ TABELA MECZÓW ═══════════ */
.ctm-matches-wrapper { overflow-x: auto; margin: 16px 0; }
.ctm-matches-table { width: 100%; border-collapse: collapse; }
.ctm-matches-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; padding: 8px 10px; }
.ctm-match-row td { padding: 10px; border-top: 1px solid var(--ctm-border, rgba(127,127,127,.2)); vertical-align: middle; }
.ctm-col-date { white-space: nowrap; font-size: 13px; }
.ctm-col-date .ctm-time { display: block; opacity: .6; font-size: 11px; }
.ctm-matchup { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctm-team-side { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ctm-team-side-right { justify-content: flex-end; }
.ctm-team-info { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ctm-team-info-right { flex-direction: row-reverse; }
.ctm-team-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctm-score-block { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 70px; }
.ctm-tournament-row td { padding: 4px 10px 10px; font-size: 12px; opacity: .75; }
.ctm-maps-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ctm-map-chip { font-size: 11px; border: 1px solid rgba(127,127,127,.3); border-radius: 4px; padding: 2px 6px; display: flex; gap: 4px; }
.ctm-map-chip.ctm-map-win { border-color: var(--ctm-win); color: var(--ctm-win); }
.ctm-map-chip.ctm-map-loss { border-color: var(--ctm-loss); color: var(--ctm-loss); }
.ctm-map-chip-score { font-weight: 700; }

/* ═══════════ STRONA POJEDYNCZEGO MECZU ═══════════ */
.ctm-single-wrap { max-width: 900px; margin: 0 auto 32px; }
.ctm-single-header { background: linear-gradient(180deg, var(--ctm-bg-alt), var(--ctm-bg)); border: 1px solid var(--ctm-border); border-radius: var(--ctm-radius); padding: 24px; color: var(--ctm-text); }
.ctm-single-scoreline { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; }
.ctm-single-badge { padding: 6px 16px; border-radius: 20px; font-weight: 800; font-size: 13px; letter-spacing: .05em; }
.ctm-single-badge.ctm-win { background: var(--ctm-win); color: #fff; }
.ctm-single-badge.ctm-loss { background: var(--ctm-loss); color: #fff; }
.ctm-single-badge.ctm-pending { background: var(--ctm-pending); color: #fff; }
.ctm-single-score { font-size: 40px; font-weight: 800; }
.ctm-single-score.ctm-win { color: var(--ctm-win); }
.ctm-single-score.ctm-loss { color: var(--ctm-loss); }

.ctm-single-teams { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ctm-single-team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ctm-single-logo-wrap img, .ctm-single-logo-placeholder { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; }
.ctm-single-logo-placeholder { background: var(--ctm-border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; text-transform: uppercase; }
.ctm-single-team-name { font-size: 17px; font-weight: 700; }
.ctm-single-center { flex: 0 0 220px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ctm-single-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--ctm-text-dim); }
.ctm-single-format { text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.ctm-single-tournament a { color: inherit; }

.ctm-single-section-title { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; margin: 28px 0 10px; opacity: .8; }
.ctm-maps-table, .ctm-standings-table { width: 100%; border-collapse: collapse; }
.ctm-maps-table th, .ctm-maps-table td, .ctm-standings-table th, .ctm-standings-table td { padding: 8px 10px; border-top: 1px solid var(--ctm-border, rgba(127,127,127,.2)); text-align: center; }
.ctm-maps-table th:first-child, .ctm-maps-table td:first-child { text-align: left; }
.ctm-map-row-win td:nth-child(2) { color: var(--ctm-win); font-weight: 700; }
.ctm-map-row-loss td:nth-child(3) { color: var(--ctm-loss); font-weight: 700; }

.ctm-lineups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ctm-lineup-team-name { font-weight: 700; margin-bottom: 6px; }
.ctm-lineup-list { margin: 0; padding-left: 20px; }

/* ═══════════ TABELA WYNIKÓW (LIGA/GRUPA) ═══════════ */
.ctm-standings-table th { text-align: center; font-size: 11px; text-transform: uppercase; opacity: .6; }
.ctm-standings-table .ctm-st-pos, .ctm-standings-table .ctm-st-team { text-align: left; }
.ctm-st-team { display: table-cell; }
.ctm-st-team img { margin-right: 6px; }
.ctm-st-points { font-weight: 800; }

/* ═══════════ DRABINKA – widok drzewa ═══════════ */
.ctm-bracket-section { margin: 20px 0 36px; overflow-x: auto; }
.ctm-bracket-gf { display: flex; flex-direction: column; align-items: center; }
.ctm-bracket-tree { display: inline-flex; padding: 10px 0; }

.ctm-bnode { display: flex; align-items: center; }
.ctm-bnode-children { display: flex; flex-direction: column; position: relative; margin-right: 22px; }
.ctm-bnode-children > * { flex: 1; display: flex; align-items: center; position: relative; padding: 6px 0; }
.ctm-bnode-children > *::after {
	content: "";
	position: absolute;
	right: -22px;
	top: 50%;
	width: 22px;
	height: 1px;
	background: var(--ctm-border, #444);
}
.ctm-bnode-children::before {
	content: "";
	position: absolute;
	right: -22px;
	top: 25%;
	bottom: 25%;
	width: 1px;
	background: var(--ctm-border, #444);
}
.ctm-bnode-empty { min-height: 58px; }

.ctm-bbox {
	display: block;
	width: 220px;
	background: var(--ctm-accent);
	border-radius: 6px;
	overflow: hidden;
	text-decoration: none !important;
	color: #fff !important;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.ctm-bbox-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: #fff; }
.ctm-bbox-row:first-child { border-bottom: 1px solid rgba(255,255,255,.25); }
.ctm-bbox-row.ctm-bbox-winner { background: rgba(0,0,0,.32); }
.ctm-bbox-row.ctm-bbox-winner .ctm-bbox-name::before { content: "✓ "; }
.ctm-bbox-row.ctm-bbox-loser { opacity: .5; }
.ctm-bbox-row.ctm-bbox-loser .ctm-bbox-name { text-decoration: line-through; text-decoration-color: rgba(255,255,255,.6); }
.ctm-bbox-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; background: #fff; }
.ctm-bbox-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctm-bbox-score { font-weight: 800; min-width: 24px; text-align: right; color: #fff; }
.ctm-bbox-maps { padding: 4px 10px 8px; font-size: 11px; color: rgba(255,255,255,.85); background: rgba(0,0,0,.18); text-align: center; }

/* ═══════════ UKŁAD KOLUMNOWY (LB / Swiss / Grupy) ═══════════ */
.ctm-round-columns { display: flex; gap: 24px; overflow-x: auto; padding: 6px 0; }
.ctm-round-col { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.ctm-round-col-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .65; margin-bottom: 2px; }

/* ═══════════ STRONA TURNIEJU ═══════════ */
.ctm-tournament-header { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.ctm-tournament-type-badge, .ctm-tournament-teams-badge {
	display: inline-block; padding: 6px 14px; border-radius: 20px;
	font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1.4;
}
/* Kolory ustawione jawnie (nie dziedziczone z motywu), żeby odznaki nie zlewały się z tłem
   niezależnie od tego, czy strona jest jasna czy ciemna. */
.ctm-tournament-type-badge { background: var(--ctm-accent); color: #fff; }
.ctm-tournament-teams-badge { background: #1e1e2a; color: #fff; border: 1px solid rgba(255,255,255,.2); }
.ctm-rules-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px;
	font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1.4;
	background: transparent; color: var(--ctm-accent); border: 1px solid var(--ctm-accent);
	text-decoration: none !important;
}
.ctm-rules-btn:hover { background: var(--ctm-accent); color: #fff; }

/* Przycisk "Regulamin" wygląda jak odznaki nad drabinką (ten sam kształt pigułki, ten sam rozmiar),
   ale stoi POD drabinką/tabelą, osobno — tylko styl jest pożyczony z góry. */
.ctm-rules-section { margin-top: 28px; }
.ctm-rules-summary {
	cursor: pointer; list-style: none; user-select: none;
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 14px; border-radius: 20px;
	background: var(--ctm-accent); color: #fff !important;
	font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1.4;
}
.ctm-rules-summary:hover { filter: brightness(1.12); }
.ctm-rules-summary::-webkit-details-marker { display: none; }
.ctm-rules-summary::after { content: "▾"; transition: transform .15s ease; }
.ctm-rules-section[open] .ctm-rules-summary::after { transform: rotate(180deg); }
.ctm-rules-body {
	margin-top: 12px; padding: 18px 20px; border-radius: 8px;
	border: 1px solid var(--ctm-border, rgba(127,127,127,.3));
}
.ctm-rules-content { line-height: 1.7; }
.ctm-rules-content p { margin: 0 0 1em; }
.ctm-rules-content ul, .ctm-rules-content ol { margin: 0 0 1em 1.4em; }
.ctm-rules-content .ctm-rules-btn { margin-top: 12px; }

/* ═══════════ WIDGET ═══════════ */
.ctm-widget-list { list-style: none; margin: 0; padding: 0; }
.ctm-widget-item { padding: 6px 0; border-top: 1px solid var(--ctm-border, rgba(127,127,127,.2)); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ctm-widget-item:first-child { border-top: none; }
.ctm-widget-opponent { text-decoration: none; color: inherit; font-weight: 600; }
.ctm-widget-vs { opacity: .7; font-weight: 400; margin: 0 4px; }
.ctm-widget-meta { font-size: 11px; opacity: .6; white-space: nowrap; }
.ctm-widget-more { margin-top: 8px; text-align: right; font-size: 12px; }
.ctm-widget-more a { text-decoration: none; }

.ctm-widget-expanded { display: flex; flex-wrap: wrap; gap: 10px; }
.ctm-widget-card { display: block; width: 100%; background: var(--ctm-bg-alt); border: 1px solid var(--ctm-border); border-radius: 8px; padding: 10px 12px; text-decoration: none !important; color: inherit !important; }
.ctm-widget-card-top { display: flex; justify-content: space-between; font-size: 11px; opacity: .6; margin-bottom: 6px; }
.ctm-widget-card-matchup { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctm-widget-card-matchup .ctm-team-side { flex-direction: column; text-align: center; gap: 4px; }
.ctm-widget-card-matchup .ctm-team-name { font-size: 12px; }
.ctm-widget-card-tournament { margin-top: 8px; font-size: 11px; opacity: .65; text-align: center; }

@media (max-width: 700px) {
	.ctm-single-teams { flex-direction: column; }
	.ctm-single-center { order: -1; }
	.ctm-lineups-grid { grid-template-columns: 1fr; }
}
