/*
Design-Tokens uebernommen aus entwuerfe/design_handoff_skat_spielerprofil/README.md.
Farb-, Typo- und Abstandsentscheidungen sind dort verbindlich beschrieben.

*/
:root {
	--bg-screen:      #D3D3D3;
	--bg-archiv:      #f4f4f3;
	--bg-card:        #ffffff;
	--bg-canvas:      #dcdedf;
	--border-hair:    #d4d4d4;
	--border-divider: #eeedea;
	--border-header:  #e7e7e4;

	--ink:            #191b1d;
	--ink-secondary:  #41464b;
	--ink-muted:      #71767b;
	--ink-weak:       #8a8f94;

	--accent:         #3d6a8a;
	--accent-hover:   #2f5470;
	--accent-mid:     #7f9fb5;
	--accent-weak:    #b7c4cf;
	--accent-fill:    rgba(61,106,138,0.08);

	/* Referenz-/Vergleichs-Farbe (1:1-Vergleich in Cards, Auswahl-Icons in
	   der Turnier-Rangliste). Bewusst roetlich, um sich klar vom Blau des
	   Haupt-Wertes abzuheben. */
	--ref-accent:      #a04a4a;
	--ref-accent-fill: rgba(160,74,74,0.08);

	/*
	--accent-primary:         #3d6a8a;
	--accent-primary-hover:   #2f5470;
	--accent-primary:       #1f6b7a;   
	--accent-primary-hover: #14505c;
	*/
	
	
	--accent-primary:       #4f8a63;   /* = --good-dot, schon im :root */
	--accent-primary-hover: #3f7355;   /* = --good-ink */



	--pill-active:    #eef2f5;

	--good-ink:       #3f7355;
	--good-fill:      rgba(79,138,99,0.13);
	--good-dot:       #4f8a63;

	--track:          #eef0ef;
	--expect-line:    #c3c7ca;
	--expect-marker:  #9aa0a4;

	--segmented-rail: #e9e9e6;

	--radius-card:    10px;
	--radius-pill:    999px;
	--radius-button:  4px;

	--shadow-card:    0 1px 2px rgba(0,0,0,.03);
	--shadow-hover:   0 6px 20px rgba(0,0,0,.07);
	--shadow-pill:    0 1px 3px rgba(0,0,0,.12);
	--shadow-sidebar: 0 22px 60px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg-screen) !important;
	color: var(--ink);
	font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
	font-feature-settings: 'tnum' 1, 'lnum' 1;
	-webkit-font-smoothing: antialiased;
	line-height: 1.35;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline;}

/* --- Layout-Gerueste ---------------------------------------------- */

.app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	max-width: 850px;
  	margin: auto;
	background: var(--bg-archiv);
}

.main {
	min-width: 0;
	padding-bottom: 20px;
	flex: 1;
}

.footer {
	margin: 24px 0 40px;
	padding: 14px 16px 0;
	border-top: 1px solid var(--border-divider);
	text-align: center;
	font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
	font-size: 12px;
	color: var(--ink-muted);
	line-height: 1.6;
}
.footer-copyright {
	margin-top: 4px;
	font-size: 11px;
	color: var(--ink-weak);
}
.footer .ui-link {
	color: var(--ink-secondary);
	text-decoration: none;
	margin: 0 8px;
	transition: color .15s ease;
}
.footer .ui-link:hover {
	color: var(--accent);
}

/* --- accountsym (Login-Symbol; DOSKV-Mitglied = andere Variante) --- */
.accountsym {
	background: url(images/bgButtonHuetchen.png) no-repeat top center transparent;
	background-position: 0 -70px;
	padding-left: 35px;
	padding-right: 5px;
	height: 40px;
	line-height: 40px;
	font-size: 12px;
	color: var(--ink-secondary);
	display: flex;
	max-width: 120px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
}
div.accountsym {
	cursor: default;
}
.accountsym.ausgeloggt { 
	background-color: rgba(255,255,255,0.6);
  	background-blend-mode: lighten;
 }
.accountsym.doskv { background-position: 0 -130px; }

/* --- Top-Header (Logo links | Account rechts) --------------------- */

.topbar {
	background: var(--bg-card);
	border-bottom: 1px solid var(--border-header);
	padding: 0 16px;
	height: 42px;
	display: flex;
	align-items: center;
}
@media (min-width: 1024px) {
	.topbar { padding: 0 28px; height: 60px; }
}

.topbar-inner {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.topbar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}
.topbar-logo {
	width: 26px; height: 26px;
	display: block;
	object-fit: contain;
}
@media (min-width: 1024px) {
	.topbar-logo { width: 44px; height: 44px; }
}
.topbar-brand-text {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
	letter-spacing: 1.5px;
	color: var(--ink-secondary);
}

.topbar-account {
	display: flex;
	align-items: center;
	gap: 10px;
}
.topbar-suche {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: var(--ink-secondary);
	transition: background .15s ease, color .15s ease;
}
.topbar-suche:hover {
	background: var(--pill-active);
	color: var(--ink);
}

/* --- Menubar (horizontal, direkt unter Topbar) ------------------- */

.menubar {
	position: sticky; top: 0; z-index: 9;
	background: var(--bg-card);
	border-bottom: 1px solid var(--border-header);
	padding: 0;
	height: 48px;
	display: flex;
	align-items: stretch;
	gap: 0;
}
.menubar-link,
.menubar-text {
	position: relative;
	flex: 1;
	padding: 0 8px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	
	color: var(--ink-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color .15s ease;
	white-space: nowrap;
}
.menubar-link {
	/* Kein Element wird breiter als in einer 3er-Aufteilung; bei 1 oder 2
	   Elementen bleibt rechts Platz, statt dass sie sich aufblaehen. */
	max-width: 33.3333%;
	font-weight: 500;
}
.menubar-link:hover { color: var(--ink); }
.menubar-link.active {
	color: var(--accent);
	font-weight: 600;
	border-bottom-color: var(--accent);
}

/* --- Content-Titelzeile (Name | Zeitraum) ------------------------ */

.content-title-row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 8px;
}
@media (min-width: 768px) {
	.content-title-row { grid-column: 1 / -1; }
}

.content-filter-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}
@media (min-width: 768px) {
	.content-filter-row { grid-column: 1 / -1; }
}

.filter-referenz {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

/* Suchmaske - eine Zeile: Label | Input | Button. */
.home-suche-row {
	display: grid;
	grid-template-columns: minmax(110px, max-content) 1fr auto;
	align-items: center;
	gap: 10px;
}
.home-suche-row input,
.home-suche-row select {
	appearance: none;
	border: 1px solid var(--border-hair);
	background: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	min-height: 40px;
	min-width: 0;
	font: inherit;
	font-size: 14px;
	color: var(--ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}
/* Native Select-Pfeil ist durch appearance:none weg - eigenen Chevron als
   Hintergrund-SVG einblenden. Rechts genug Platz lassen, damit der Text
   nicht unter den Pfeil rutscht. */
.home-suche-row select {
	padding-right: 34px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='%23555'><path d='M0 0l5 6 5-6z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px 6px;
	cursor: pointer;
}
.home-suche-row input:focus,
.home-suche-row select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(61,106,138,0.18);
}
@media (max-width: 520px) {
	/* Auf schmalen Bildschirmen: Label oben, Input + Button darunter. */
	.home-suche-row { grid-template-columns: 1fr auto; }
	.home-suche-row .chart-stats-label { grid-column: 1 / -1; }
}

/* Trefferliste bei LIKE-Suche mit mehreren Ergebnissen. */
.suche-treffer {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
}
.suche-vergleich {
	display: inline-block;
	margin-left: 4px;
	padding: 0 6px;
	border: 1px solid var(--ink-weak, #b7c4cf);
	border-radius: 3px;
	font-size: 13px;
	color: var(--ink-muted);
	text-decoration: none;
	line-height: 1.4;
}
.suche-vergleich:hover {
	background: var(--accent, #3d6a8a);
	color: #fff;
	border-color: var(--accent, #3d6a8a);
}

/* Card-lokaler Referenz-Umschalter (Pool / Spielername).
   Kleinere Variante des globalen Umschalters, sitzt im card-head bzw. neben
   der Section-Ueberschrift. Aktiver Button erhaelt Accent-Farbe. */
.ref-toggle {
	display: inline-flex;
	gap: 2px;
	margin-left: 10px;
	vertical-align: middle;
	font-size: 12px;
}
.card-head .ref-toggle,
.card-split-title .ref-toggle { margin-left: auto; }
.ref-toggle button {
	border: 1px solid var(--ink-weak, #b7c4cf);
	background: transparent;
	padding: 2px 8px;
	font-size: 12px;
	color: var(--ink-muted);
	cursor: pointer;
	border-radius: 3px;
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ref-toggle button:hover {
	background: #eef;
}
.ref-toggle button.active {
	background: var(--accent, #3d6a8a);
	color: #fff;
	border-color: var(--accent, #3d6a8a);
}

/* Modal fuer die Referenzspieler-Eingabe. Fixed overlay ueber die gesamte
   Viewport, zentrierte Box. Escape/Overlay-Klick schliesst im JS. */
.ref-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.ref-modal-overlay[hidden] {
	display: none;
}
.ref-modal-box {
	background: #fff;
	border-radius: 6px;
	padding: 20px 22px;
	min-width: 320px;
	max-width: 90vw;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.ref-modal-title {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--ink-primary, #212121);
}
.ref-modal-hint {
	font-size: 13px;
	color: var(--ink-muted);
	margin-bottom: 12px;
}
.ref-modal-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ink-weak, #b7c4cf);
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	margin-bottom: 14px;
}
.ref-modal-input:focus {
	outline: none;
	border-color: var(--accent, #3d6a8a);
}
.ref-modal-buttons {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}
.ref-modal-buttons button {
	padding: 6px 14px;
	border: 1px solid var(--ink-weak, #b7c4cf);
	background: #fff;
	color: var(--ink-primary, #212121);
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
}
.ref-modal-buttons button:hover {
	background: #f0f2f5;
}
.ref-modal-buttons button.btn-primary {
	background: var(--accent, #3d6a8a);
	color: #fff;
	border-color: var(--accent, #3d6a8a);
}
.ref-modal-buttons button.btn-primary:hover {
	background: #2f5570;
}
/* Fehlerhinweis unter dem Nick-Input im Ref-Modal (z. B. "Nick nicht gefunden"). */
.ref-modal-fehler {
	font-size: 13px;
	color: #b93a3a;
	margin: -8px 0 12px 0;
}
/* Trefferliste: erscheint statt des Eingabefeldes, wenn die Suche mehrere
   Kandidaten geliefert hat. Jeder Treffer ist ein voll-breiter Button. */
.ref-modal-treffer {
	list-style: none;
	padding: 0;
	margin: 0 0 12px 0;
	max-height: 40vh;
	overflow-y: auto;
}
.ref-modal-treffer li {
	margin: 0 0 6px 0;
}
.ref-modal-treffer-btn {
	width: 100%;
	text-align: left;
	padding: 8px 10px;
	border: 1px solid var(--ink-weak, #b7c4cf);
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}
.ref-modal-treffer-btn:hover {
	background: #f0f2f5;
	border-color: var(--accent, #3d6a8a);
}
/* Hilfe-Modal - breiter fuer Fliesstext, mit Link "Alle Kennzahlen" links. */
.hilfe-modal-box {
	min-width: 360px;
	max-width: 640px;
}
.hilfe-modal-body {
	font-size: 14px;
	line-height: 1.55;
	color: var(--ink-secondary);
	margin-bottom: 14px;
	max-height: 60vh;
	overflow-y: auto;
}
.hilfe-modal-body p { margin: 0 0 10px; }
.hilfe-modal-body .hilfe-formel {
	background: var(--bg-canvas);
	padding: 8px 10px;
	border-radius: 4px;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
	color: var(--ink);
	margin-top: 8px;
}
.hilfe-modal-body .hilfe-formel-label {
	display: block;
	font-family: 'IBM Plex Sans', system-ui, sans-serif;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--ink-weak);
	margin-bottom: 4px;
}
.hilfe-modal-more {
	margin-right: auto;
	align-self: center;
	font-size: 13px;
	color: var(--ink-muted);
	text-decoration: none;
}
.hilfe-modal-more:hover {
	color: var(--accent);
}

.welcome-body {
	padding: 4px 0 8px;
	color: var(--ink-secondary);
	font-size: 15px;
	line-height: 1.55;
}
.welcome-body p { margin: 0 0 12px; }
.welcome-body p:last-child { margin-bottom: 0; }

.welcome-content h1.content-title-name {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
	font-family: inherit;
	letter-spacing: inherit;
}

.welcome-teaser-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	padding: 4px 0 8px;
}
.welcome-teaser {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.welcome-teaser-shot {
	background: var(--bg-canvas);
	border: 1px solid var(--border-hair);
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}
.welcome-teaser-shot img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
}
.welcome-teaser-titel {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
}
.welcome-teaser p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink-secondary);
}
.welcome-teaser--link {
	text-decoration: none;
	color: inherit;
	transition: transform .12s ease, box-shadow .12s ease;
}
.welcome-teaser--link:hover .welcome-teaser-shot { border-color: var(--ink-weak, #b7c4cf); }
.welcome-teaser--link:hover .welcome-teaser-titel { text-decoration: underline; }


.flex-container-1 {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
}   
/* CTA-Card: Grafik links, Slogans + Login-Button rechts.
   Layout uebernimmt der innere .flex-container-1; jede Spalte startet mit
   flex-basis 260px und bricht auf schmalen Bildschirmen um. Die Grafik
   nimmt so maximal ~50% der Kartenbreite ein. */
.welcome-cta-card > .flex-container-1 {
	justify-content: flex-start;
	align-items: center;
	gap: 24px;
}
.welcome-cta-card > .flex-container-1 > div {
	flex: 1 1 260px;
	min-width: 0;
}
.welcome-cta-card > .flex-container-1 img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}
.welcome-cta-slogans {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 15px;
	color: var(--ink);
	counter-reset: cta-num;
}
.welcome-cta-slogans li {
	position: relative;
	padding-left: 28px;
	font-weight: 500;
}
.welcome-cta-slogans li::before {
	counter-increment: cta-num;
	content: counter(cta-num) ".";
	position: absolute;
	left: 0;
	color: var(--accent);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.welcome-cta-slogans li::after {
	content: " ✓";
	margin-left: 8px;
	color: var(--accent);
	font-weight: 700;
}
.welcome-cta-btn {
	flex-shrink: 0;
}

.welcome-faq {
	padding: 4px 0 8px;
}
.welcome-faq details {
	border-top: 1px solid var(--border-divider);
	padding: 10px 0;
}
.welcome-faq details:last-child { border-bottom: 1px solid var(--border-divider); }
.welcome-faq summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--ink);
	list-style: none;
	position: relative;
	padding-right: 20px;
}
.welcome-faq summary::-webkit-details-marker { display: none; }
.welcome-faq summary::after {
	content: '+';
	position: absolute;
	right: 0;
	top: 0;
	font-weight: 400;
	color: var(--ink-weak);
}
.welcome-faq details[open] summary::after { content: '−'; }
.welcome-faq details p {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--ink-secondary);
}

.welcome-cta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
}
.ref-input {
	appearance: none;
	border: 1px solid var(--border-hair);
	background: #fff;
	border-radius: var(--radius-pill);
	padding: 7px 12px;
	min-height: 34px;
	font: inherit;
	font-size: 13px;
	color: var(--ink);
	min-width: 180px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.ref-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(0, 122, 255, .15);
}
.content-title-info { min-width: 0; }
.content-title-name-row {
	display: flex;
	align-items: baseline;
	gap: 2px;
	flex-wrap: wrap;
	margin-bottom: 10px;;
}
.content-title-name {
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.4px;
	line-height: 1.1;
	color: var(--ink);
}
@media (min-width: 1024px) {
	.content-title-name { font-size: 28px; }
}
.content-title-placement {
	font-size: 13px;
	color: var(--accent);
	font-weight: 600;
}
.content-title-realname {
	flex-basis: 100%;
	font-size: 13px;
	color: var(--ink-muted);
	line-height: 1.2;
	margin-top: 2px;
}
.content-title-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin-top: 5px;
}
.content-title-meta > .content-title-club,
.content-title-meta > .content-title-stats {
	margin-top: 0;
}
.content-title-club {
	font-size: 13px;
	color: var(--ink-muted);
	margin-top: 5px;
}
.content-title-url {
	font-size: 13px;
	color: var(--ink-muted);
	margin-top: 3px;
	word-break: break-all;
}
.content-title-url a {
	color: var(--accent);
}
.content-title-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-top: 6px;
	font-size: 13px;
	color: var(--ink-muted);
}
.content-title-stat {
	white-space: nowrap;
}
.content-title-stat + .content-title-stat {
	position: relative;
	padding-left: 14px;
}
.content-title-stat + .content-title-stat::before {
	content: "·";
	position: absolute;
	left: 4px;
	color: var(--ink-muted);
}

/* Hinweis unterhalb des Zeitraum-Switches:
   erklaert, dass die Kennzahlen unter dem Header nur die Archiv-Spiele umfassen.
   Ab 768px liegt der Container im Grid - dann volle Zeilenbreite erzwingen,
   damit der Text nicht in einer schmalen Grid-Zelle umbricht. */
.archiv-basis-hinweis {
	display: block;
	flex-basis: 100%;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--ink-muted);
	font-style: italic;
}
@media (min-width: 768px) {
	.archiv-basis-hinweis { grid-column: 1 / -1; }
}

/* --- view.turnier: Turnier-Liste mit Aufklapp-Details ----------- */
.turnier-filter-hint {
	margin: 4px 0 8px;
	font-size: 12.5px;
	color: var(--ink-muted);
	font-style: italic;
}
.turnier-filter-form {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
	margin: 4px 0 5px; 
	font-size: 12.5px;
}
.turnier-filter-label { color: var(--ink-muted); font-style: italic; }
.turnier-filter-prefix {
	background: #f0f0f0; border: 1px solid #ddd; border-right: 0;
	padding: 4px 6px; border-radius: 3px 0 0 3px; font-family: monospace;
}
.turnier-filter-prefix + input { border-radius: 0 3px 3px 0; margin-left: -1px; }
.turnier-filter-form input[type="text"] {
	padding: 4px 6px; border: 1px solid #ccc; border-radius: 3px;
	font-family: monospace; min-width: 140px;
}
.turnier-filter-form button {
	padding: 4px 10px; border: 1px solid #ccc; background: #f7f7f7;
	border-radius: 3px; cursor: pointer;
}
.turnier-filter-form button:hover { background: #eee; }
.turnier-filter-reset { color: var(--ink-muted); text-decoration: none; margin-left: 4px; }
.turnier-filter-reset:hover { text-decoration: underline; }
.turnier-filter-profil { margin: 0px 0 10px; font-size: 12.5px; }

.teilnahmen-turnier-head {
	margin: 12px 0 4px;
	padding: 4px 6px;
	font-weight: 600;
	background: #f5f7ff;
	border-left: 4px solid #6b7ba3;
	/* border-radius: 3px; */
	font-size: 13px;
}
.teilnahmen-turnier-head:first-of-type { margin-top: 4px; }
.teilnahmen-liste { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 4px; }
.teilnahmen-liste th, .teilnahmen-liste td { padding: 5px 8px; border-bottom: 1px solid #eee; text-align: left; }
.teilnahmen-liste th.num, .teilnahmen-liste td.num { text-align: right; }
.teilnahmen-liste td.hl { background: #fff3d6; font-weight: 600; }

.card--collapsible > summary { cursor: pointer; list-style: none; }
.card--collapsible > summary::-webkit-details-marker { display: none; }
.card--collapsible > summary::before {
	content: '+'; display: inline-block; width: 14px; margin-right: 6px;
	font-weight: bold; color: var(--ink-muted);
}
.card--collapsible[open] > summary::before { content: '−'; }
/* Marker und Titel links nebeneinander - .card-head hat sonst space-between,
   was das +/- an den linken und den Titel an den rechten Rand druecken wuerde. */
.card--collapsible > summary.card-head { justify-content: flex-start; }

.rangliste-liste { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rangliste-liste th, .rangliste-liste td { padding: 5px 8px; border-bottom: 1px solid #eee; text-align: left; }
.rangliste-liste th.num, .rangliste-liste td.num { text-align: right; }

/* Vergleichs-Icon in der Nick-Zelle. Ein Button pro Zeile, dessen data-rolle
   je nach Auswahl-Zustand wechselt (waehle/cancel/vs). Farbe entsprechend
   der Rolle - konsistent mit der Kartenglueck-Referenz-Farbe var(--ref-accent). */
.rangliste-liste td.rl-nick-cell { white-space: nowrap; }
.rl-icon {
	display: inline-block;
	margin-left: 6px;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--ink-muted);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	vertical-align: middle;
	border-radius: 3px;
}
.rl-icon:hover                     { color: var(--ref-accent); background: var(--ref-accent-fill); }
.rl-icon[data-rolle="vs"]          { color: var(--ref-accent); font-weight: bold; }
.rl-icon[data-rolle="cancel"]      { color: #a04a4a; }
.rangliste-liste tr.rl-selected    { background: var(--ref-accent-fill); }
.rangliste-liste tr.rl-selected td { font-weight: 600; }
/* Nick-Link im vs-Modus (Zeile ist nicht die markierte): wird zum Vergleichs-
   Trigger, deshalb visuell hervorheben, damit die neue Klick-Semantik erkennbar
   ist. */
.rangliste-liste tbody:has(tr.rl-selected) tr:not(.rl-selected) .rl-nick-link {
	color: var(--ref-accent);
	text-decoration-style: dotted;
}

.turnier-liste { width: 100%; border-collapse: collapse; }
.turnier-liste th, .turnier-liste td { padding: 6px 8px; border-bottom: 1px solid #eee; text-align: left; }
.turnier-liste th.num, .turnier-liste td.num { text-align: right; }
.turnier-liste .col-toggle { width: 32px; }
.turnier-toggle {
	width: 24px; height: 24px; border-radius: 4px; border: 1px solid #ccc;
	background: #f7f7f7; cursor: pointer; line-height: 22px; font-weight: bold; text-align: center;
}
.turnier-toggle:hover { background: #eee; }
.turnier-details-row td.turnier-details-cell { background: #fafafa; padding: 8px 10px; }
.turnier-details-body { font-size: 13px; }
.turnier-row.hl td { background: #fff8e6; }
.turnier-row.hl td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }

.serie-block { border: 1px solid #e5e7eb; border-radius: 4px; padding: 4px 6px; margin: 6px 0; }
.serie-block.hl { border-color: #f59e0b; background: #fff8e6; }
.serie-toggle {
	background: none; border: 0; padding: 4px 6px; cursor: pointer;
	font-weight: bold; font-size: 13px; text-align: left; width: 100%;
}
.serie-toggle:hover { background: rgba(0,0,0,.03); }
.serie-toggle .tri { display: inline-block; width: 14px; }
.tisch-liste-wrap {
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 6px 8px 4px 20px;
}
/* [hidden] hat als User-Agent-Style nur display:none - explizite
   Klassenregel oben ueberschreibt das sonst. */
.tisch-liste-wrap[hidden] { display: none; }
.tisch-zurueck-turnier {
	margin: 6px 0 8px;
	font-size: 13px;
}
.tisch-zurueck-turnier a { color: var(--accent); text-decoration: none; }
.tisch-zurueck-turnier a:hover { text-decoration: underline; }

.tisch-open {
	background: #f7f7f7; border: 1px solid #e5e7eb; border-radius: 4px;
	padding: 4px 8px; font-size: 12.5px; cursor: pointer;
	color: var(--ink); text-decoration: none;
	display: inline-block;
}
.tisch-open:hover { background: #eee; color: var(--ink); }
.tisch-open.hl { background: #fff3d6; border-color: #f59e0b; font-weight: 600; }

/* --- Segmented Control (Zeitraum) -------------------------------- */

.segmented {
	background: var(--segmented-rail);
	border-radius: var(--radius-pill);
	padding: 3px;
	display: inline-flex;
	gap: 2px;
	flex-shrink: 0;
}
.segmented button {
	appearance: none;
	background: transparent;
	border: 0;
	padding: 8px 16px;
	min-height: 34px;
	border-radius: var(--radius-pill);
	font: inherit;
	font-size: 13px;
	color: var(--ink-secondary);
	cursor: pointer;
	transition: all .15s ease;
}
.segmented button.active {
	background: #ffffff;
	color: var(--ink);
	font-weight: 600;
	box-shadow: var(--shadow-pill);
}
.segmented button[disabled] {
	color: #b0b0b0;
	cursor: not-allowed;
	opacity: .6;
}

/* --- Content-Grid ------------------------------------------------- */

.content {
	padding: 12px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
@media (min-width: 768px) {
	.content {
		padding: 20px 24px 24px;
		gap: 16px;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
		align-items: start;
	}
	.span-2 { grid-column: span 2; }
}

.content.schmal > .card {
	max-width: 600px;
	margin: auto;
}

/* --- Karte "Verteilung der Spiele" ------------------------------- */

/* Diese Karte soll immer die ganze Zeile einnehmen, auch wenn sonst nur
   eine 1-Spalten-Grid-Zelle aufgemacht ist. */
@media (min-width: 768px) {
	.span-2-wide { grid-column: 1 / -1; }
}

.verteilung-summary {
	/*width: 100%;*/
	margin: auto;
	border-collapse: collapse;
	font-size: 13px;
	color: var(--ink-secondary);
	font-variant-numeric: tabular-nums;
}
.verteilung-summary th,
.verteilung-summary td {
	padding: 4px 8px;
	text-align: right;
	white-space: nowrap;
}
.verteilung-summary thead th {
	font-weight: 500;
	color: var(--ink-weak);
	border-bottom: 1px solid var(--line, #e0e0e0);
}
.verteilung-summary tbody th {
	text-align: left;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	color: var(--ink-weak);
	font-weight: 500;
}
.verteilung-summary tbody td {
	color: var(--ink);
	font-weight: 600;
}
.verteilung-summary tr.vs-ref td {
	color: var(--ink-weak);
	font-weight: 500;
	font-size: 11.5px;
}
.verteilung-summary .lbl-kurz { display: none; }
.verteilung-summary .info-icon { margin-left: 4px; }
.verteilung-zeitraum {
	margin: auto;
	text-align: center;
	margin-top: 6px;
	font-size: 13px;
	color: var(--ink-secondary);
}
.verteilung-zeitraum b {
	color: var(--ink);
	font-weight: 600;
	margin-left: 4px;
}

@media (max-width: 520px) {
	.verteilung-summary .lbl-lang { display: none; }
	.verteilung-summary .lbl-kurz { display: inline; }
	.verteilung-summary th,
	.verteilung-summary td { padding: 3px 4px; font-size: 12px; }
}

.chart-stats-ref {
	color: var(--ink-weak);
	font-size: 11.5px;
	margin-left: 6px;
	font-variant-numeric: tabular-nums;
}
.chart-stats-ref:empty { display: none; }

.verteilung-rows {
	display: grid;
	gap: 6px;
}
.verteilung-row {
	display: grid;
	grid-template-columns: 80px 1fr;
	align-items: center;
	gap: 10px;
}
.verteilung-row-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ink-weak);
}
.verteilung-bar {
	display: flex;
	height: 26px;
	/* border-radius: 8px; */
	overflow: hidden;
	background: var(--track);
}
.verteilung-row--ref .verteilung-bar {
	height: 14px;
	opacity: 0.75;
}
.verteilung-bar .seg {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	overflow: hidden;
	white-space: nowrap;
	color: #fff;
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	transition: filter .15s ease;
}
.verteilung-bar .seg:hover { filter: brightness(1.08); }
.verteilung-bar .seg-count { font-weight: 600; }
.verteilung-bar .seg-pct   { opacity: 0.85; }
/* .verteilung-row--ref .verteilung-bar .seg { color: transparent; } */
.verteilung-bar .seg-empty {
	flex: 1;
	color: var(--ink-weak);
	font-size: 12px;
	background: transparent;
}

/* Segmentfarben. Positive Ausgaenge blau/gruen, negative rot/warm, eingepasst neutral. */
.seg-eigene     { background: var(--accent); }         /* eigene Spiele - Alleinspieler */
.seg-andere     { background: var(--accent-mid); }     /* andere Spiele - Gegenspieler */
.seg-eingepasst { background: #c3c7ca; color: var(--ink-secondary) !important; }

.seg-eg { background: #3d6a8a; } /* eigene gewonnen */
.seg-ev { background: #b23830; } /* eigene verloren */
.seg-ag { background: #4f8a63; } /* andere gewonnen */
.seg-av { background: #b07835; } /* andere verloren */

.verteilung-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 11.5px;
	color: var(--ink-muted);
}
.verteilung-legend .sw {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 3px;
	vertical-align: middle;
	margin-right: 6px;
}

/* --- Detail-Balkenpaare (Du vs Referenz je Kategorie) ------------ */

.verteilung-details-toggle {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}
.segmented--mini { margin-top: 0; padding: 2px; }
.segmented--mini button {
	padding: 4px 10px;
	min-height: 24px;
	font-size: 12px;
}

.verteilung-details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
	gap: 10px;
	margin-top: 4px;
}
.det {
	background: #f7f8f8;
	border-radius: 10px;
	padding: 10px 8px 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
}
.det-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10.5px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--ink-weak);
	text-align: center;
	line-height: 1.25;
	min-height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.det-label-short { display: none; }
@media (max-width: 960px) {
	.det-label-long { display: none; }
	.det-label-short { display: inline; }
}
.det-plot {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 8px;
	width: 100%;
	position: relative;
}
.det-marker {
	position: absolute;
	left: 0;
	right: 0;
	height: 0;
	top: 0;
	width: 110px;
	margin: auto;
	border-top: 2px dashed #a8b0b5;
	pointer-events: none;
}
.det-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 50px;
}
.det-bar-slot {
	width: 100%;
	height: 68px;
	display: flex;
	justify-content: center;
	align-items: flex-end;
	padding-top: 1px;
}
.det-bar {
	width: 22px;
	min-height: 2px;
	border-radius: 0;
	transition: filter .15s ease;
}
.det-bar:hover { filter: brightness(1.08); }
.det-bar--ref { opacity: 0.5; }
.det-num {
	font-size: 11px;
	color: var(--ink-secondary);
	font-variant-numeric: tabular-nums;
	margin-top: 4px;
	line-height: 1;
	white-space: nowrap;
	min-width: 50px;
	text-align: center;
}
.det-num b { color: var(--ink); font-weight: 600; }
.det-num-suffix { color: var(--ink-weak); }
.det-who {
	font-size: 10px;
	color: var(--ink-weak);
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-top: 2px;
}

/* --- Karten (generisch) ------------------------------------------ */

.card {
	background: var(--bg-card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	padding: 17px 16px;
	/*cursor: pointer;*/
	transition: box-shadow .18s ease;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.card:hover { box-shadow: var(--shadow-hover); }

@media (min-width: 1024px) {
	.card { padding: 20px 22px; }
}

.card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.card-title {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ink-weak);
}
.datenbasis-hinweis {
	margin: 10px 0 4px;
	padding: 8px 12px;
	background: #fff4d6;
	border: 1px solid #e6c97a;
	border-left-width: 3px;
	border-radius: 4px;
	font-size: 13px;
	color: var(--ref-accent);
}
.card-detail {
	font-size: 12px;
	color: var(--ink-muted);
}
button.card-detail {
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}
button.card-detail:hover { color: var(--ink-secondary); }

.card-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	align-items: start;
}
.card-split-item {
	min-width: 0;
}
.card-split-item + .card-split-item {
	border-left: 1px solid var(--border-divider);
	padding-left: 24px;
}
@media (max-width: 640px) {
	/* Bei umgebrochenem Grid statt Trennlinie links eine oben. */
	.card-split-item + .card-split-item {
		border-left: 0;
		padding-left: 0;
		border-top: 1px solid var(--border-divider);
		padding-top: 20px;
	}
}
.card-split-title {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-secondary);
	display: flex;
	align-items: center;
	gap: 4px;
}

.details-panel {
	margin-top: 16px;
	padding: 5px;
	background: var(--accent-fill);
	border-left: 3px solid var(--accent);
	/*border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
	*/
}
.details-panel-title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.details-panel-hint {
	font-size: 12px;
	color: var(--ink-muted);
	padding: 4px 0;
}
.details-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
/* Generischer Wrapper fuer Tabellen, die auf schmalen Bildschirmen breiter
   werden als die umgebende Card - erlaubt horizontales Scrollen statt Zellen-
   Quetschung oder Ueberlauf ausserhalb der Card. */
.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.formkurve-sockel {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	margin-bottom: 14px;
}
.sockel-item {
	background: var(--bg-card);
	border-radius: 6px;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.sockel-item .sockel-label {
	font-size: 11px;
	color: var(--ink-muted);
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
.sockel-item b {
	font-size: 16px;
	color: var(--ink);
}
.sockel-item .sockel-sub {
	font-size: 11px;
	color: var(--ink-muted);
}
.details-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	/*
	min-width: 640px;
	*/
}
.details-table th, .details-table td {
	padding: 6px 10px;
	border-bottom: 1px solid var(--line);
	text-align: right;
	white-space: nowrap;
}
.details-table th:first-child, .details-table td:first-child { text-align: left; }
.details-table thead th {
	background: #f7f8f8;
	font-weight: 500;
	color: var(--ink-secondary);
	font-size: 12px;
}
.details-table tr.sum td {
	font-weight: 600;
	background: #fafbfb;
}

.card-hint {
	background: #f7f8f8;
	color: var(--ink-secondary);
	font-size: 12px;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 10px;
}


/* --- Karte Kartenglueck ------------------------------------------ */

.card--highlight {
	/*border-top: 2px solid var(--accent);*/
	padding-top: 15px;
}
@media (min-width: 1024px) {
	.card--highlight { padding-top: 18px; }
}

/* Teaser-Kachel fuer gesperrte Auswertungen (Zugang basis).
   Icon + Titel/Hinweis + Login-Button. Bewusst schlicht - spaeter wird
   das Icon durch bearbeitete Screenshots ersetzt. */
.card--teaser {
	background: linear-gradient(180deg, #fafbfc 0%, #f2f4f7 100%);
	border: 1px dashed #cfd6de;
}
.card--teaser .card-title {
	color: #6b7280;
}
.teaser-body {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 4px 6px;
	flex-wrap: wrap;
}
.teaser-icon {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9aa3ad;
	background: #fff;
	border: 1px solid #e3e7ec;
	border-radius: 12px;
}
.teaser-text {
	flex: 1 1 200px;
	min-width: 160px;
}
.teaser-title {
	font-weight: 600;
	color: #374151;
	margin-bottom: 2px;
}
.teaser-hint {
	color: #6b7280;
	font-size: 0.92em;
	line-height: 1.35;
}
.teaser-cta {
	flex: 0 0 auto;
}

.big-figure {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}
.big-figure .val {
	font-size: 32px;
	font-weight: 600;
	letter-spacing: -0.7px;
	color: var(--ink);
	line-height: 1;
}
@media (min-width: 1024px) {
	.big-figure .val { font-size: 40px; }
}
.badge-good {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--good-fill);
	color: var(--good-ink);
	font-size: 12px;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: var(--radius-pill);
}
.badge-good .dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--good-dot);
}
.badge-warn {
	background: rgba(200,140,60,0.13);
	color: #7a5325;
}
.badge-warn .dot { background: #b07835; }
.badge-hot {
	background: rgba(200,80,60,0.13);
	color: #7a2f25;
}
.badge-hot .dot { background: #b23830; }

/* Kleiner "neu"-Marker fuer frisch dazugekommene Funktionen/Kennzahlen.
   Wird per label_neu=true im Feature-Katalog (data.features.inc.php) neben
   den Funktionsnamen in view.hilfe gerendert. Optik analog zu badge-good/
   -warn/-hot: tinted background + gedeckter Textton, damit es als Label
   wirkt und nicht wie ein anklickbarer Button. */
.badge-neu {
	display: inline-block;
	background: rgba(61,106,138,0.10);
	color: var(--accent);
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.3px;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 8px;
	position: relative;
	top: -8px;
}

/* Kompakte Info-Zeile ueber einem Chart: "Blaetter: N | Augen-Schnitt: X z=Y | Erwartung: Z". */
.chart-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 13px;
	color: var(--ink-secondary);
	font-variant-numeric: tabular-nums;
	align-items: center;
}
.chart-stats b { color: var(--ink); font-weight: 600; }
.chart-stats-label { color: var(--ink-muted); margin-right: 4px; }

.pill-z {
	display: inline-block;
	padding: 1px 8px;
	border-radius: var(--radius-pill);
	font-size: 11.5px;
	font-weight: 500;
	margin-left: 4px;
}
.pill-z.ok    { background: var(--good-fill); color: var(--good-ink); }
.pill-z.warn  { background: rgba(200,140,60,0.13); color: #7a5325; }
.pill-z.hot   { background: rgba(200,80,60,0.13);  color: #7a2f25; }
.pill-z.empty { display: none; }

.chart-line { width: 100%; height: 96px; display: block; }
@media (min-width: 1024px) {
	.chart-line { height: 110px; }
}
.chart-line--tall { height: 120px; }
@media (min-width: 1024px) {
	.chart-line--tall { height: 150px; }
}

/* Chart.js-Container. Feste Hoehe, damit maintainAspectRatio:false sauber wirkt. */
.kg-chart-wrap {
	position: relative;
	width: 100%;
	height: 200px;
}
@media (min-width: 1024px) {
	.kg-chart-wrap { height: 240px; }
}
.form-chart-wrap {
	position: relative;
	width: 100%;
	height: 180px;
}
@media (min-width: 1024px) {
	.form-chart-wrap { height: 220px; }
}
.spielart-chart-wrap {
	position: relative;
	width: 100%;
	height: 220px;
}

.spielanteil-chart-wrap {
	position: relative;
	width: 100%;
	height: 280px;
}
@media (min-width: 1024px) {
	.spielanteil-chart-wrap { height: 340px; }
}
.spielanteil-legende {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-top: 8px;
	font-size: 12px;
	color: var(--ink-secondary);
}
.spielanteil-legende .sw {
	display: inline-block;
	width: 12px; height: 12px;
	margin-right: 6px;
	vertical-align: middle;
	border-radius: 50%;
}
.spielanteil-legende .sw-anteil-alle { background: rgba(127,159,181,0.65); }
.spielanteil-legende .sw-anteil-rot  { background: #c85050; }
.spielanteil-legende .sw-anteil-du {
	background: transparent;
	border-radius: 0;
	width: 0; height: 0;
	border-left:  7px solid transparent;
	border-right: 7px solid transparent;
	border-bottom: 12px solid #3d6a8a;
}
.spielanteil-legende .sw-anteil-vergleich {
	background: #ffbf1eff;
	border-color: #898989ff;
	border-radius: 2px;
	width: 12px; height: 12px;
}
.spielanteil-legende .sw-anteil-median {
	border-radius: 0;
	width: 14px; height: 0;
	border-top: 2px solid #444;
	margin-right: 6px;
}
.spielanteil-legende .sw-anteil-q1q3 {
	background: rgba(80,80,80,0.18);
	border: 1.4px solid rgba(50,70,90,0.85);
	border-radius: 2px;
}
.spielanteil-legende .sw-anteil-p10p90 {
	background: rgba(80,80,80,0.10);
	border: 1.2px dashed rgba(90,110,130,0.75);
	border-radius: 2px;
}
.spielanteil-toggles {
	display: flex;
	gap: 6px;
	margin-left: auto;
	flex-wrap: wrap;
}
.spielanteil-toggle {
	border: 1px solid var(--ink-weak, #b7c4cf);
	background: transparent;
	padding: 2px 8px;
	font-size: 12px;
	color: var(--ink-muted);
	cursor: pointer;
	border-radius: 3px;
	font-family: inherit;
}
.spielanteil-toggle[aria-pressed="true"] {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

.chart-legend {
	display: flex;
	gap: 16px;
	font-size: 11.5px;
	color: var(--ink-muted);
	flex-wrap: wrap;
}
.chart-legend .sw {
	display: inline-block;
	width: 14px; height: 2px;
	vertical-align: middle;
	margin-right: 6px;
}
.chart-legend .sw-line { background: var(--accent); }
.chart-legend .sw-dash {
	background: linear-gradient(to right, var(--expect-line) 60%, transparent 40%);
	background-size: 5px 100%;
}
.chart-legend .sw-band {
	height: 8px;
	background: rgba(150,150,150,0.35);
	border-radius: 2px;
}

/* --- Rang-Balken (Kartenglueck) ---------------------------------- */

.ranks {
	display: grid;
	gap: 10px;
}
.rank-row {
	display: grid;
	grid-template-columns: 74px 1fr 44px;
	align-items: center;
	gap: 10px;
	font-size: 13px;
}
.rank-label { color: var(--ink-secondary); }
.rank-val {
	text-align: right;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.rank-track {
	position: relative;
	height: 6px;
	background: var(--track);
	border-radius: var(--radius-pill);
	overflow: visible;
}
.rank-fill {
	position: absolute; left: 0; top: 0; bottom: 0;
	background: var(--accent);
	border-radius: var(--radius-pill);
}
.rank-marker {
	position: absolute;
	top: -3px; bottom: -3px;
	width: 2px;
	background: var(--expect-marker);
	left: 83.3%;
}
/* Bei aktivem 1:1-Vergleich (Referenz-Marker im Track vorhanden) wird der Haupt-
   Balken auf --accent-mid (helleres Blau) umgestellt, damit der dunkelbraune
   Referenz-Marker klar dagegen absetzt. */
.rank-track:has(.rank-marker-ref) .rank-fill { background: var(--accent-mid); }
/* Referenzspieler-Marker im Rang-Track (nur bei aktivem 1:1-Vergleich). */
.rank-marker-ref {
	position: absolute;
	top: -3px; bottom: -3px;
	width: 2px;
	background: var(--ref-accent);
}
.rank-val-ref {
	margin-left: 6px;
	font-size: 11px;
	font-weight: normal;
	color: var(--ref-accent);
}
.chart-legend .sw-line-ref { background: var(--ref-accent); }

/* --- Karte Entscheidungsqualitaet -------------------------------- */

.progress-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	align-items: baseline;
	font-size: 13px;
}
.progress-row .label { color: var(--ink-secondary); }
.progress-row .value {
	font-variant-numeric: tabular-nums;
	color: var(--ink);
	font-weight: 600;
}
.progress-track {
	grid-column: 1 / -1;
	height: 8px;
	background: var(--track);
	border-radius: var(--radius-pill);
	overflow: hidden;
	margin-top: 2px;
	margin-bottom: 8px;
	position: relative;
}
.progress-fill {
	height: 100%;
	background: var(--accent);
	border-radius: var(--radius-pill);
	transition: width .3s ease;
}
/* Bei aktivem 1:1-Vergleich (Referenz-Overlay im Track vorhanden) wird der
   Haupt-Balken auf --accent-mid (helleres Blau) umgestellt, damit der
   dunkelbraune Referenz-Overlay klar dagegen absetzt. */
.progress-track:has(.progress-fill-ref) .progress-fill { background: var(--accent-mid); }
/* Referenzspieler-Balken (nur bei aktivem 1:1-Vergleich). Sitzt als
   duenner Overlay unten im Track, damit der Haupt-Balken weiter dominant
   bleibt und der Vergleich trotzdem auf einen Blick klar ist. */
.progress-fill-ref {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	background: var(--ref-accent);
	border-radius: var(--radius-pill);
	transition: width .3s ease;
}
.progress-row .value .value-ref {
	margin-left: 8px;
	font-weight: normal;
	font-size: 11px;
	color: var(--ref-accent);
}
/* Ref-Wert neben dem grossen Ausschoepfungs-Wert in der hero-metric. */
.hero-metric .val .val-ref {
	margin-left: 12px;
	font-size: 16px;
	font-weight: normal;
	color: var(--ref-accent);
	vertical-align: baseline;
}

.divider {
	height: 1px;
	background: var(--border-divider);
	margin: 6px 0 4px;
}

.hero-metric {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 4px;
}
.hero-metric .val {
	font-size: 32px;
	font-weight: 600;
	letter-spacing: -0.7px;
	color: var(--accent);
	line-height: 1;
}
@media (min-width: 1024px) {
	.hero-metric .val { font-size: 40px; }
}
.hero-metric .caption {
	font-size: 12px;
	color: var(--ink-muted);
}
.hero-vergleich {
	margin-top: 8px;
	padding-top: 6px;
	border-top: 1px dashed var(--border-weak, #d5d7dd);
	font-size: 11px;
	color: var(--ink-muted);
	line-height: 1.5;
}
.hero-vergleich b {
	color: var(--ink-weak);
	font-weight: 600;
}

/* --- Karte Spielart ---------------------------------------------- */

.game-row {
	display: grid;
	grid-template-columns: 60px 1fr 44px;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	margin-bottom: 8px;
}
.game-row:last-child { margin-bottom: 0; }
.game-label { color: var(--ink-secondary); }
.game-val {
	text-align: right;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}
.game-track {
	height: 8px;
	background: var(--track);
	border-radius: var(--radius-pill);
	overflow: hidden;
}
.game-fill {
	height: 100%;
	border-radius: var(--radius-pill);
	transition: width .3s ease;
}

/* --- Info-Icon + Tooltip-Popover --------------------------------- */

.info-icon, .hint-icon {
	appearance: none;
	background: transparent;
	border: 1px solid var(--border-hair);
	color: var(--ink-weak);
	width: 18px; height: 18px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10px;
	font-weight: 500;
	line-height: 1;
	padding: 0;
	margin-left: 6px;
	cursor: pointer;
	transition: all .12s ease;
	vertical-align: middle;
}
.info-icon:hover, .hint-icon:hover {
	color: var(--accent);
	border-color: var(--accent);
}
.info-icon:focus-visible, .hint-icon:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}



.info-popover {
	position: absolute;
	z-index: 30;
	max-width: 280px;
	background: var(--bg-card);
	color: var(--ink);
	border: 1px solid var(--border-hair);
	border-radius: 12px;
	padding: 12px 14px;
	box-shadow: var(--shadow-hover);
	font-size: 13px;
	line-height: 1.45;
	cursor: default;
}
.info-popover-title {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ink-weak);
	margin-bottom: 6px;
}
.info-popover-text { color: var(--ink-secondary); }
.info-popover-link {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 500;
}

/* Hint-Popover kann auch aus einem offenen Modal (z-index 1000) getriggert
   werden - deshalb ueber dem Modal-Overlay stacken, sonst wird's vom Backdrop
   verdeckt. */
.hint-popover {
	z-index: 1100;
}

/* --- Hilfeseite --------------------------------------------------- */

.hilfe-content {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
@media (min-width: 768px) {
	.hilfe-content {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
		gap: 16px;
	}
}
/* Intro-Card oberhalb des Kennzahl-Grids: spannt sich ueber die gesamte
   Breite des Grids und enthaelt Kurzbeschreibung, Feature-Tabelle und
   Bedien-Hilfe. */
.hilfe-intro { grid-column: 1 / -1; }
.hilfe-intro-body { font-size: 13.5px; color: var(--ink-secondary); line-height: 1.55; }
.hilfe-intro-body p { margin: 0 0 10px 0; }
.hilfe-abschnitt-titel {
	margin: 18px 0 8px 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
}
.hilfe-feature-label {
	margin-top: 20px;
	font-size: 14px;
	font-weight: 600;
}
.hilfe-feature-label i { 
	font-weight: 400;
	font-size: 13px;
	color: var(--ink-muted);
}
.hilfe-feature-text {
	font-size: 13px;
	line-height: 1.5;
	margin-top: 10px;
}
/* Zwischentitel vor dem Kennzahl-Grid: kleinerer Abstand, kein Zurueck-Link. */
.hilfe-kennzahlen-titel { grid-column: 1 / -1; margin-top: 6px; }

/* Feature-Tabelle: kompakt, mit horizontalem Scroll auf schmalen Displays. */
.hilfe-feature-tabelle-wrap { overflow-x: auto; margin-bottom: 6px; }
.hilfe-feature-tabelle {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.hilfe-feature-tabelle th,
.hilfe-feature-tabelle td {
	padding: 6px 10px;
	border-bottom: 1px solid var(--border-divider);
	text-align: left;
	vertical-align: middle;
}
.hilfe-feature-tabelle thead th {
	font-weight: 600;
	color: var(--ink);
	background: #f7f8f8;
}
.hilfe-feature-tabelle th.ftab-col { text-align: center; min-width: 80px; }
.hilfe-feature-tabelle td.ftab-cell { text-align: center; font-variant-numeric: tabular-nums; }
.hilfe-feature-tabelle td.ftab-ja   { color: #2a6b3a; font-weight: 600; }
.hilfe-feature-tabelle td.ftab-nein { color: var(--ink-weak); }
.hilfe-feature-fussnote {
	margin: 6px 0 0 0;
	font-size: 12px;
	color: var(--ink-muted);
	font-style: italic;
}

.hilfe-item { cursor: default; }
.hilfe-item:hover { box-shadow: var(--shadow-card); }
.hilfe-lang {
	font-size: 13.5px;
	color: var(--ink-secondary);
	margin: 0;
	line-height: 1.55;
}
.hilfe-formel {
	display: flex;
	align-items: baseline;
	gap: 10px;
	background: #f7f8f8;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 12px;
}
.hilfe-formel-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--ink-weak);
	white-space: nowrap;
}
.hilfe-formel code {
	color: var(--ink);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
}

/* --- Login/Logout ------------------------------------------------ */

/* Schmale, zentrierte Card fuer Login-Formular bzw. Logout-Ansicht. */
.login-wrap {
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
}
.verknuepfung-wrap {
  	max-width: 100%;
}
@media (min-width: 768px) {
	.login-wrap { grid-column: 1 / -1; }
}
@media (min-width: 460px) {
	.verknuepfung-wrap { 
		width: fit-content;
		grid-column: 1 / -1; 
		min-width: 420px;
		margin: auto;
	}
}
.verknuepfung-modal { position: fixed; inset: 0; z-index: 999; }
.verknuepfung-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.verknuepfung-modal-box { position: absolute; top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	background: #fff; padding: 20px 22px; border-radius: 8px;
	min-width: 320px; max-width: 90vw;
	box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.verknuepfung-modal-title { font-weight: bold; font-size: 1.05em; margin-bottom: 8px; }
.verknuepfung-modal-msg { margin-bottom: 14px; }
.verknuepfung-modal-box .verknuepfung-check { display: block; margin-bottom: 12px; }
.verknuepfung-modal-box .card-actions { display: flex; gap: 8px; justify-content: flex-end; }



/* Card ohne Klick-Cursor und ohne Hover-Shadow. */
.card--form { cursor: default; }
.card--form:hover { box-shadow: var(--shadow-card); }

.login-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.form-field-label {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10.5px;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--ink-weak);
}
.form-field input {
	appearance: none;
	border: 1px solid var(--border-hair);
	background: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	min-height: 40px;
	font: inherit;
	font-size: 14px;
	color: var(--ink);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(61,106,138,0.18);
}

.card-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
}

.btn,
.btn-primary {
	appearance: none;
	border: 0;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 10px 20px;
	min-height: 40px;
	border-radius: var(--radius-button);
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary {
	background: var(--accent-primary);
}
.btn:hover { 
	background: var(--accent-hover); color: #fff; 
}
.btn-primary:hover { 
	background: var(--accent-primary-hover); color: #fff; 
}
.btn:focus-visible,
.btn-primary:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.btn--ghost {
	background: transparent;
	color: var(--accent);
	border: 1px solid var(--accent-weak);
}
.btn--ghost:hover {
	background: var(--accent-fill);
	color: var(--accent-hover);
}
/* Mini-Variante fuer Inline-Nutzung in Tabellenzellen: sieht aus wie .btn,
   ist aber so tief gestapelt, dass sich die Zeilenhoehe nicht aendert
   (kein min-height, line-height fest). */
.btn-mini {
	display: inline-block;
	background: var(--accent-weak);
	color: var(--ink-secondary);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	padding: 3px 7px;
	border-radius: 3px;
	text-decoration: none;
	vertical-align: baseline;
	transition: background .15s ease;
}
.btn-mini:hover {
	background: var(--accent-hover);
	color: #fff;
}
.btn-mini:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.btnx {
	border: 1px solid var(--accent-weak);
	border-radius: 3px;
	border-color: transparent;
	background: transparent;
	cursor: pointer;
}
.btnx:hover { 
	background-color: var(--pill-active); 
	border-color: var(--accent-hover);
}

.turnierliste-tab {
	border-collapse: collapse;
	width: 100%;
	margin-top: 6px;
}
.turnierliste-tab th, .turnierliste-tab td {
	padding: 6px 10px;
	border-bottom: 1px solid var(--line);
	font-size: 14px;
}
.turnierliste-tab th {
	text-align: left;
	font-weight: 600;
	color: var(--ink-muted);
}
.turnierliste-tab .turnierliste-num {
	text-align: right;
	white-space: nowrap;
}
.turnierliste-tab a {
	text-decoration: none;
	font-weight: 500;
}
.turnierliste-tab a:hover {
	text-decoration: underline;
}

.verknuepfung-tab {
	margin:auto;
	border-collapse: collapse;
}
.verknuepfung-tab td, .verknuepfung-tab th {
	padding: 3px 4px;
	border-bottom: 1px solid var(--line);
	font-size: 14px;
}
.verknuepfung-tab td:not(:first-child) { 
	text-align: center; 
}
.verknuepfung-tab th:first-child { 
	text-align: left; 
}


.login-status {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 2px 0;
}
.login-status-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--accent-fill);
	color: var(--accent);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.login-status-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.login-status-nick {
	font-size: 16px;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.login-status-meta {
	font-size: 12px;
	color: var(--ink-muted);
}

.login-status-link {
	margin-top: 12px;;
}
.login-status-link a {
	font-size: 15px;
	line-height: 20px;
}
.login-status-link a:hover { text-decoration: underline; }

/* --- Platzhalter-Kennzeichnung ----------------------------------- */

.card[data-placeholder="1"] {
	position: relative;
}
.card[data-placeholder="1"]::after {
	content: "Beispieldaten";
	position: absolute;
	top: 12px; right: 14px;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--ink-weak);
	background: #f7f8f8;
	padding: 3px 8px;
	border-radius: var(--radius-pill);
}


/* ============================================================
   Spielsuche - "Meine Spiele suchen"-Card in view.suche
   ============================================================ */

/* Zeilenabstand innerhalb des Formulars, damit Zeilen nicht kleben. */
.spielesuche-form .home-suche-row + .home-suche-row {
	margin-top: 10px;
}

/* Native Checkbox/Radio zurueckholen - .home-suche-row input ist auf Textfelder
   getuned und wuerde die Kontrollen sonst als leere Kaesten rendern. */
.spielesuche-form input[type="checkbox"],
.spielesuche-form input[type="radio"] {
	appearance: auto;
	-webkit-appearance: auto;
	border: initial;
	background: initial;
	border-radius: initial;
	padding: 0;
	min-height: 0;
	width: auto;
	margin: 0;
	cursor: pointer;
}

/* Chip-Reihe: Optionen brechen um. Belegt Spalte 2-3 des 3-spaltigen Row-Grids. */
.spielesuche-optionen {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	grid-column: 2 / -1;
}

/* Zeitraum-Zeile: hat 4 Kinder (Label/Input/Label/Input) und passt nicht
   ins 3-spaltige Row-Grid. Als Flex zentriert darstellen, damit die beiden
   Datumsfelder mittig sitzen statt links zu kleben. Die Paare (Label+Input)
   sind in .sf-range-pair gruppiert, damit beim Wrap Label und Input
   zusammen umbrechen und "bis" nicht am oberen Zeilenende neben "von"
   haengen bleibt. */
#sf-range {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.sf-range-pair {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* Einzelne Option als klickbarer Chip mit umschliessendem <label>. */
.spielesuche-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--border-hair);
	border-radius: 6px;
	background: var(--bg-card);
	font-size: 13px;
	line-height: 1.2;
	color: var(--ink-secondary);
	cursor: pointer;
	user-select: none;
	transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.spielesuche-option:hover {
	border-color: var(--accent-weak);
}
.spielesuche-option:has(input:checked) {
	border-color: var(--accent);
	background: var(--accent-fill);
	color: var(--ink);
}

/* Zeitraum-Zeile: eigenes Grid mit von / bis Paaren. */
.spielesuche-form #sf-range {
	grid-template-columns: minmax(40px, max-content) minmax(120px, 1fr) minmax(40px, max-content) minmax(120px, 1fr);
}
.spielesuche-form input[type="date"] {
	max-width: 180px;
}

/* Submit-Zeile: Button rechtsbuendig. */
.spielesuche-form .home-suche-row:last-child {
	display: flex;
	justify-content: flex-end;
}

/* Ergebnis-Card: Hinweiszeile mit den angewandten Filtern. */
.spielesuche-hinweis {
	color: var(--ink-secondary);
	font-size: 12px;
	line-height: 1.5;
	margin: 0 0 12px;
	padding: 6px 10px;
	background: var(--bg-canvas);
	border-radius: 6px;
}

/* Trefferliste (Tabelle). Angelehnt an .rangliste-liste, mit Hover-Highlight. */
.spielesuche-treffer-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.spielesuche-treffer {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.spielesuche-treffer th,
.spielesuche-treffer td {
	padding: 6px 10px;
	border-bottom: 1px solid var(--border-divider);
	text-align: left;
	vertical-align: middle;
}
.spielesuche-treffer thead th {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--ink-weak);
	font-weight: 600;
	background: var(--bg-canvas);
	border-bottom: 1px solid var(--border-header);
}
.spielesuche-treffer .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Zweizeilen-Layout: Hauptzeile mit Datum/Uhrzeit/Spiele/Sitze,
   Unterzeile mit Bereich + Tischname (colspan 3). Sitze via rowspan=2 auf
   der Hauptzeile. */
.spielesuche-treffer .hauptzeile td {
	border-bottom: none;
	padding-bottom: 2px;
	vertical-align: middle;
}
.spielesuche-treffer .unterzeile td {
	padding-top: 0;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border-divider);
}
.spielesuche-treffer .tisch-info {
	font-size: 12px;
	color: var(--ink-secondary);
	white-space: nowrap;
}
.spielesuche-treffer .tisch-info a {
	color: var(--accent);
}
.spielesuche-treffer .bereich {
	display: inline-block;
	color: var(--ink-muted);
	font-size: 10px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	margin-right: 6px;
}
/* Meta-Bereich: erste 3 Spalten der Hauptzeile + die tisch-info-Zelle
   (colspan 3 der Unterzeile) bekommen eine dezente Hintergrundfarbe,
   damit die Sitzplatz-Nicks visuell staerker vom Meta-Block getrennt sind. */
.spielesuche-treffer .hauptzeile td:nth-child(-n+3),
.spielesuche-treffer .unterzeile .tisch-info {
	background: var(--bg-archiv);
}
/* Gruppierter Hover: fahren wir ueber irgendeine Zeile des Eintrags,
   wird das komplette 2-Zeilen-Paar hervorgehoben. Ueberschreibt den
   Meta-Hintergrund. */
.spielesuche-treffer .spielesuche-treffer-eintrag:hover td {
	background: var(--accent-fill);
}

/* Schmale Bildschirme: alles einspaltig, Chips unter das Label. */
@media (max-width: 520px) {
	.spielesuche-form .home-suche-row,
	.spielesuche-form #sf-range {
		grid-template-columns: 1fr;
	}
	.spielesuche-optionen {
		grid-column: 1;
	}
}


