/*
 * Moderne Darstellung der (teils sehr alten) Freiland-Ergebnis-Dateien.
 * Das Markup in den .data-Dateien wird nicht veraendert - es wird nur ueber
 * den Wrapper .sk-freiland-body neu gestylt (Theme wie Interne Turniere).
 */

.sk-freiland-body {
	color: #3a3a3a;
	font-size: 15px;
	line-height: 1.65;
}

.sk-freiland-body center,
.sk-freiland-body div[align="center"] {
	text-align: left;
}

/* --- Sprungmarken-Navigation (Runde 1-9, Abschlusstabelle, Paarungen ...) --- */
.sk-freiland-body a[href^="#"] {
	display: inline-block;
	margin: 0 8px 8px 0;
	padding: 6px 14px;
	background: #f6ecd0;
	border: 1px solid #cbb98a;
	border-radius: 999px;
	color: #5c4d2a;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.sk-freiland-body a[href^="#"]:hover,
.sk-freiland-body a[href^="#"]:focus {
	background: #5c4d2a;
	color: #f6ecd0;
}

.sk-freiland-body a[href^="#"] b {
	font-weight: 600;
}

/* die <br> zwischen den Navigations-Links entfernen, damit sie als Reihe stehen */
.sk-freiland-body a[href^="#"] + br {
	display: none;
}

/* --- Abschnitts-Ueberschriften (Runden / Tabelle) als Balken --- */
.sk-freiland-body big,
.sk-freiland-body h4 {
	display: block;
	max-width: 460px;
	margin: 26px auto 10px;
	padding: 11px 16px;
	background: #5c4d2a;
	border-radius: 10px;
	color: #f6ecd0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
}

.sk-freiland-body big a,
.sk-freiland-body h4 a {
	color: inherit;
	text-decoration: none;
}

.sk-freiland-body h4:empty {
	display: none;
}

/* --- Allgemeine Tabellen (Standings, Kreuztabellen, ...) als Karte --- */
.sk-freiland-body table {
	max-width: 100%;
	margin: 0 auto 22px;
	border-collapse: collapse;
	background: #fffdf7;
	border: 1px solid #cbb98a;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(40, 28, 8, 0.12);
	overflow: hidden;
}

.sk-freiland-body th {
	padding: 9px 12px;
	background: #6b5a32;
	color: #f6ecd0;
	font-weight: 700;
	text-align: left;
	white-space: nowrap;
}

.sk-freiland-body td {
	padding: 7px 12px;
	border-top: 1px solid #e7dcc0;
	vertical-align: middle;
}

.sk-freiland-body tr:nth-child(even) td {
	background: #f7f0dc;
}

/* --- Paarungstabellen der alten Jahre --- */
/*
 * Das Markup ist ueber die Jahre/Runden voellig uneinheitlich: die Namens-
 * und Ergebniszellen tragen mal class="big"/"small", mal nur ein Inline-
 * WIDTH-Attribut, mal gar keine Klasse. Zuverlaessig sind nur die Spalten-
 * position (Name - Trenner - Name - Ergebnis) und die Tatsache, dass es
 * Paarungstabellen ohne <th> sind (Ergebnistabellen haben <th>). Daher
 * wird ueber die Position gestylt - festes Layout mit grosszuegiger Breite,
 * damit lange Namen ("Chaos Mannheim") und das Ergebnis nicht umbrechen.
 */
.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) {
	width: 100%;
	max-width: 620px;
	table-layout: fixed;
}

.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) td {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Namens-Spalten (1. und 3. Zelle) */
.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) td:nth-child(1),
.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) td:nth-child(3) {
	width: 40%;
	text-align: left;
}

/* Trenner-Spalte (2. Zelle) */
.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) td:nth-child(2) {
	width: 6%;
	text-align: center;
	color: #8a7647;
}

/* Ergebnis-Spalte (4. Zelle) hervorheben */
.sk-freiland-body table:not(:has(th)):not(.rundenauswahl):not(:has(td:nth-child(5))) td:nth-child(4) {
	width: 14%;
	text-align: right;
	font-weight: 600;
	color: #2a2a2a;
}

/* --- Spalten-Utilities fuer die per WinChessReader erzeugten Tabellen
       (Jahre ab 2008, results.php). Klassen kommen aus den *.info-Dateien. --- */
.sk-freiland-body .colhide {
	display: none;
}

.sk-freiland-body td.colcenter,
.sk-freiland-body th.colcenter {
	text-align: center;
}

.sk-freiland-body td.colnumber,
.sk-freiland-body th.colnumber {
	text-align: right;
}

/* Info-/Linkleiste (info.txt der Jahre ab 2008) */
.sk-freiland-body div.links {
	margin: 0 0 18px;
}

.sk-freiland-body div.links span {
	margin-right: 14px;
}

.sk-freiland-body div.links a {
	color: #5c4d2a;
}

/* --- Kreuztabelle (sehr breit): kompakt, scrollbar, mit senkrechten
       Trennlinien und fixierten ersten 3 Spalten. Markiert per Klasse
       .sk-kt (gesetzt in default.php / results.php). --- */
.sk-freiland-body table.sk-kt {
	display: block;
	width: max-content;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	font-size: 12px;
	/* getrennte Rahmen: sonst entsteht durch die geteilten Rahmen von
	   border-collapse ein 1px-Spalt zwischen den fixierten Spalten, durch
	   den beim Scrollen der Inhalt durchscheint. */
	border-collapse: separate;
	border-spacing: 0;
}

.sk-freiland-body table.sk-kt::-webkit-scrollbar {
	height: 12px;
}

.sk-freiland-body table.sk-kt::-webkit-scrollbar-track {
	background: #efe4c4;
	border-radius: 6px;
}

.sk-freiland-body table.sk-kt::-webkit-scrollbar-thumb {
	background: #5c4d2a;
	border-radius: 6px;
}

.sk-freiland-body table.sk-kt th,
.sk-freiland-body table.sk-kt td {
	padding: 4px 7px;
	text-align: center;
	white-space: nowrap;
	border-left: 1px solid #d8c89a;
}

.sk-freiland-body table.sk-kt th:first-child,
.sk-freiland-body table.sk-kt td:first-child {
	border-left: 0;
}

/* Mannschaftsname linksbuendig */
.sk-freiland-body table.sk-kt th:nth-child(3),
.sk-freiland-body table.sk-kt td:nth-child(3) {
	text-align: left;
}

/* Die ersten 3 Spalten (Rang, MNr, Mannschaft) beim horizontalen
   Scrollen stehen lassen. */
.sk-freiland-body table.sk-kt th:nth-child(1),
.sk-freiland-body table.sk-kt th:nth-child(2),
.sk-freiland-body table.sk-kt th:nth-child(3) {
	position: sticky;
	z-index: 3;
}

.sk-freiland-body table.sk-kt td:nth-child(1),
.sk-freiland-body table.sk-kt td:nth-child(2),
.sk-freiland-body table.sk-kt td:nth-child(3) {
	position: sticky;
	z-index: 1;
	background: #fffdf7;
}

.sk-freiland-body table.sk-kt tr:nth-child(even) td:nth-child(1),
.sk-freiland-body table.sk-kt tr:nth-child(even) td:nth-child(2),
.sk-freiland-body table.sk-kt tr:nth-child(even) td:nth-child(3) {
	background: #f7f0dc;
}

.sk-freiland-body table.sk-kt th:nth-child(1),
.sk-freiland-body table.sk-kt td:nth-child(1) {
	left: 0;
	width: 50px;
}

.sk-freiland-body table.sk-kt th:nth-child(2),
.sk-freiland-body table.sk-kt td:nth-child(2) {
	left: 50px;
	width: 50px;
}

.sk-freiland-body table.sk-kt th:nth-child(3),
.sk-freiland-body table.sk-kt td:nth-child(3) {
	left: 100px;
	width: 150px;
	/* rechte Kante der fixierten Spalten deutlich abgrenzen */
	border-right: 2px solid #c4a35a;
}

/* Zeile und Spalte der Zelle unter dem Mauszeiger hervorheben */
.sk-freiland-body table.sk-kt td.kt-col-hi,
.sk-freiland-body table.sk-kt tr.kt-row-hi td {
	background: #f3d56a !important;
}

.sk-freiland-body table.sk-kt th.kt-col-hi,
.sk-freiland-body table.sk-kt tr.kt-row-hi th {
	background: #f3d56a !important;
	color: #2a2a2a !important;
}

/* Kreuzungszelle (Zeile x Spalte) etwas kraeftiger */
.sk-freiland-body table.sk-kt tr.kt-row-hi td.kt-col-hi {
	background: #e6b34a !important;
}

/* Name des Gegners der gerade ueberfahrenen (gespielten) Ergebnis-Zelle */
.sk-freiland-body table.sk-kt td.kt-opp-hi {
	background: #e6b34a !important;
	color: #2a2a2a !important;
	font-weight: 700 !important;
}

/* --- Abschlusstabelle als <pre> (Jahr 1998) --- */
.sk-freiland-body pre {
	max-width: 460px;
	margin: 0 auto 22px;
	padding: 16px 20px;
	background: #fffdf7;
	border: 1px solid #cbb98a;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(40, 28, 8, 0.12);
	font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 13px;
	line-height: 1.75;
	color: #2a2a2a;
	white-space: pre;
	overflow-x: auto;
}

/* --- Bereichsauswahl der neueren Jahre (table.rundenauswahl) --- */
.sk-freiland-body table.rundenauswahl {
	max-width: none;
	margin: 0 auto 20px;
	background: transparent;
	border: 0;
	box-shadow: none;
	border-radius: 0;
}

.sk-freiland-body table.rundenauswahl td {
	border: 0;
	background: transparent;
	padding: 0;
}

.sk-freiland-body table.rundenauswahl td.auswahl {
	padding: 0 4px;
}

/* Listen (z. B. "Berichte teilnehmender Vereine") */
.sk-freiland-body ul {
	margin: 0 0 18px;
	padding-left: 20px;
}

.sk-freiland-body ul a {
	color: #5c4d2a;
}
