
.tssd-leaderboard { margin: 1em 0; font-family: var(--sd-font); }
.tssd-lb-title { margin: 0 0 8px; }

.tssd-lb-intro { margin: -4px 0 10px; font-size: var(--sd-fs-xs); color: #777; line-height: 1.4; }

.tssd-lb-why { margin: 12px 0 16px; }
.tssd-lb-table { width: 100%; border-collapse: collapse; }
.tssd-lb-table th, .tssd-lb-table td {
	padding: 6px 10px; text-align: left; border-bottom: 1px solid #eee;
}
.tssd-lb-table thead th {
	background: var(--sd-highlight); border-bottom: 2px solid var(--sd-gold); font-weight: 700;
}
.tssd-lb-table tbody tr:nth-child(odd) { background: #fffdf5; }
.tssd-lb-table td:first-child { width: 3em; font-variant-numeric: tabular-nums; }

.tssd-lb-table--newest { table-layout: auto; }
.tssd-lb-table--newest td:first-child { width: auto; } /* reset rank-column rule */
.tssd-lb-table td.tssd-lb-col-date,
.tssd-lb-table th.tssd-lb-col-date,
.tssd-lb-table td.tssd-lb-col-level,
.tssd-lb-table th.tssd-lb-col-level,
.tssd-lb-table td.tssd-lb-col-time,
.tssd-lb-table th.tssd-lb-col-time {
	width: 1%;
	white-space: nowrap;
}
.tssd-lb-table td.tssd-lb-col-time,
.tssd-lb-table th.tssd-lb-col-time { font-variant-numeric: tabular-nums; }
.tssd-lb-table td.tssd-lb-col-player,
.tssd-lb-table th.tssd-lb-col-player { width: auto; }
/* Spieler kann lang sein → kein Umbruch, bei Überlänge sauber kürzen. */
.tssd-lb-table td.tssd-lb-col-player {
	max-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tssd-lb-table--levels { table-layout: auto; }
.tssd-lb-table--levels td:first-child { width: auto; } /* generische 3em-Regel zurücksetzen */
.tssd-lb-table td.tssd-lb-col-rank,
.tssd-lb-table th.tssd-lb-col-rank,
.tssd-lb-table td.tssd-lb-col-mode,
.tssd-lb-table th.tssd-lb-col-mode {
	width: 1%;
	white-space: nowrap;
}
.tssd-lb-table td.tssd-lb-col-rank,
.tssd-lb-table th.tssd-lb-col-rank { text-align: right; font-variant-numeric: tabular-nums; }

.tssd-lb-table--levels tr.tssd-lb-group th {
	background: #fff3cd;
	font-weight: 700;
	text-align: left;
	padding-top: .55em;
}

.tssd-lb-levels { margin: 1em 0; font-family: var(--sd-font); }
.tssd-lb-grouphead {
	margin: 10px 0 2px; padding: 2px 0;
	font-size: calc(var(--sd-font-size-base) * (11 / 14)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	color: var(--sd-gold-dark); border-bottom: 1px solid var(--sd-gold);
}
.tssd-lb-grouphead:first-of-type { margin-top: 4px; }
.tssd-lb-rows { list-style: none; margin: 0 0 4px; padding: 0; }
.tssd-lb-row {
	display: flex; align-items: baseline; gap: 8px;
	padding: 3px 4px; border-bottom: 1px solid #eee;
}
.tssd-lb-row:nth-child(odd) { background: #fffdf5; }
.tssd-lb-rank {
	flex: 0 0 auto; min-width: 1.4em; text-align: right;
	font-variant-numeric: tabular-nums; color: #8a8a8a; font-size: var(--sd-fs-xs);
}
.tssd-lb-name {
	flex: 1 1 auto; min-width: 0;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tssd-lb-time {
	flex: 0 0 auto; font-variant-numeric: tabular-nums; color: #555; white-space: nowrap;
}
.tssd-lb-empty { color: #777; font-style: italic; }

.tssd-rail .tssd-leaderboard { margin: 10px 0; font-size: var(--sd-fs-xs); }
.tssd-rail .tssd-lb-title { font-size: var(--sd-fs-sm); text-align: center; }
.tssd-rail .tssd-lb-intro { font-size: calc(var(--sd-font-size-base) * (10.5 / 14)); text-align: center; margin: -2px 0 8px; }
.tssd-rail .tssd-lb-table th,
.tssd-rail .tssd-lb-table td { padding: 3px 5px; }
/* In the tight rail width the "Modus" column is dropped to keep it readable. */
.tssd-rail .tssd-lb-table th:last-child,
.tssd-rail .tssd-lb-table td:last-child { display: none; }
.tssd-rail .tssd-lb-table td:first-child { width: 2em; }
/* …and the compact list shrinks a touch more in the rail. */
.tssd-rail .tssd-lb-grouphead { font-size: calc(var(--sd-font-size-base) * (10 / 14)); margin-top: 8px; }
.tssd-rail .tssd-lb-row { padding: 2px 3px; font-size: var(--sd-fs-xs); }

/* ===========================================================================
   Global fair leaderboard + components (points ranking, podium, callout,
   player-of-week strip, profile rank badge). Cream/gold site card style.
   =========================================================================== */
.tssd-lb-player { color: #0088cc; text-decoration: none; font-weight: 600; }
.tssd-lb-player:hover { text-decoration: underline; }

.tssd-lb-anon, .tssd-lb-textonly { color: var(--sd-muted); }
.tssd-lb-empty { color: var(--sd-muted); font-style: italic; margin: 8px 0; }

/* Tabs (Heute / Woche / Monat / Gesamt) */
.tssd-lb-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.tssd-lb-tab {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 6px 14px; border: 1px solid var(--sd-line); border-radius: var(--sd-radius-pill);
  background: var(--sd-surface-2); color: var(--sd-muted);
}
.tssd-lb-tab.is-active { background: var(--sd-gold); border-color: var(--sd-gold-line); color: var(--sd-gold-ink); }
.tssd-lb-pane { display: none; }
.tssd-lb-pane.is-active { display: block; }

.tssd-lb-table--global .tssd-lb-col-rank { width: 2.4em; text-align: center; }
.tssd-lb-table--global .tssd-lb-col-mix { letter-spacing: 1px; color: var(--sd-gold-dark); white-space: nowrap; }
.tssd-lb-table--global .tssd-lb-col-streak { white-space: nowrap; }
.tssd-lb-table--global .tssd-lb-col-pts { text-align: right; font-weight: 700; white-space: nowrap; }

/* Podium der Woche */
.tssd-lb-podium { margin: 14px 0; }
.tssd-lb-podium__title { margin: 0 0 10px; }

.tssd-lb-podium__row { display: flex; justify-content: center; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding-top: 18px; }
.tssd-lb-pod {
  flex: 0 1 150px; text-align: center; background: var(--sd-surface-2);
  border: 1px solid var(--sd-line); border-radius: var(--sd-radius); padding: 12px 10px 14px;
  box-shadow: var(--sd-shadow-sm);
}
.tssd-lb-pod.is-first { border-color: var(--sd-gold); transform: translateY(-10px); box-shadow: var(--sd-shadow-md); }
.tssd-lb-pod__medal { font-size: calc(var(--sd-font-size-base) * (30 / 14)); line-height: 1; }
.tssd-lb-pod__name { margin: 6px 0 2px; }
.tssd-lb-pod__pts { font-size: calc(var(--sd-font-size-base) * (20.01 / 14)); font-weight: 800; color: var(--sd-gold-ink); }
.tssd-lb-pod__lbl { font-size: var(--sd-fs-xs); color: var(--sd-muted); }

.tssd-lb-podium--empty {
  background: var(--sd-surface-2);
  border: 1px solid var(--sd-line);
  border-left: 6px solid var(--sd-gold);
  border-radius: var(--sd-radius);
  padding: 14px 16px 20px;
}
.tssd-lb-podium--empty .tssd-lb-podium__title { font-size: var(--sd-fs-lg); }
/* Zustandssatz + Einladung stehen in EINEM Absatz (Reopen 2, 1b): der Link sitzt direkt
   hinter dem Satz, nicht als eigene Zeile unter der Reihe (1c). Link-Ton aus dem Token —
   das Browser-Blau war die alte, zwischengespeicherte Stylesheet-Fassung. */
.tssd-lb-podium__lead { margin: 0; }
.tssd-lb-podium__lead a { color: var(--sd-link); font-weight: 700; text-decoration: none; }
.tssd-lb-podium__lead a:hover { text-decoration: underline; }
/* Empty 2nd/3rd slot: a "this could be you" call-to-action instead of a hole. */
.tssd-lb-pod--empty {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  border-style: dashed; background: #fffdf3;
}
.tssd-lb-pod--empty .tssd-lb-pod__medal { opacity: .45; filter: grayscale(1); }
.tssd-lb-pod__cta { margin-top: 8px; font-size: var(--sd-fs-sm); color: var(--sd-muted); }
/* Der Kasten heisst „…__cta", das gestylte Element ist aber ein TEXT-LINK im leeren
   Podestplatz (Link-Ton, Unterstreichung im Hover) — kein Button: keine Füllung,
   kein Rand, kein Padding. Die Button-Schriftstärke gilt hier bewusst nicht.
   sd324-allow: button-font-weight — SD324_Design_System.md §3. */
.tssd-lb-pod__cta a { color: var(--sd-link); font-weight: 700; text-decoration: none; }
.tssd-lb-pod__cta a:hover { text-decoration: underline; }

.tssd-lb-switch {
	margin: 0; padding: 16px;
	background: var(--sd-surface-2);
	border: 1px solid var(--sd-line); border-radius: var(--sd-radius);
	box-shadow: var(--sd-shadow-sm);
}
.tssd-lb-switch .tssd-lb-title { margin: 0 0 8px; font-size: calc(var(--sd-font-size-base) * (17 / 14)); text-align: center; }
.tssd-lb-switch .tssd-lb-intro { text-align: center; }

/* Dropdown row (under the grey intro text). */
.tssd-lb-switch .selrow { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: var(--sd-fs-xs); color: #555; }
.tssd-lb-switch .selrow label { flex: 0 0 auto; }
.tssd-lb-switch .selrow select {
	flex: 1 1 auto; min-width: 0; font-size: calc(var(--sd-font-size-base) * (12.5 / 14)); padding: 4px 6px;
	border: 1px solid var(--sd-field-line); border-radius: var(--sd-radius-sm); background: var(--sd-field-bg);
}

.tssd-lb-switch .selrow select:focus-visible {
	outline: 2px solid var(--sd-gold-line);
	outline-offset: 1px;
	box-shadow: var(--sd-focus);
}

/* Stack every view in the same grid cell → height = tallest view = constant.
   Inactive views stay laid out (visibility, not display) so the height never
   shifts; only their visibility toggles. */
.tssd-lb-switchbody { display: grid; }
.tssd-lb-switchbody > .tssd-lb-view { grid-area: 1 / 1; visibility: hidden; }
.tssd-lb-switchbody > .tssd-lb-view.is-active { visibility: visible; }

/* Difficulty column in the overview (fixed width + no wrap → equal row heights). */
.tssd-lb-switch .lvl {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; width: 9.2em;
	font-size: calc(var(--sd-font-size-base) * (11 / 14)); font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
	color: #9a6a00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tssd-lb-switch .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #333; flex: 0 0 auto; }
.tssd-lb-switch .d-sl { background: #66CC33; } .tssd-lb-switch .d-l { background: #FFFF00; }
.tssd-lb-switch .d-n { background: #FF9933; }  .tssd-lb-switch .d-s { background: #FF0000; }
.tssd-lb-switch .d-ss { background: #0066FF; } .tssd-lb-switch .d-k { background: #CC00CC; }
.tssd-lb-switch .tssd-lb-grouphead .dot { display: inline-block; vertical-align: -1px; margin-right: 5px; }
.tssd-lb-switch .tssd-lb-grouphead:first-of-type { margin-top: 2px; }
.tssd-lb-rows--detail { margin: 0; }

.tssd-lb-row--empty .tssd-lb-name,
.tssd-lb-row--empty .tssd-lb-time,
.tssd-lb-row--empty .lvl { color: var(--sd-muted); font-weight: 400; }

/* Rail points widget (switchable mode) — compact list for the narrow sidebar. */
.tssd-lb-railintro { font-size: var(--sd-fs-xs); color: #555; margin: 0 0 6px; }
.tssd-lb-raillist { list-style: none; margin: 0; padding: 0; }
.tssd-lb-railrow { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; font-size: var(--sd-fs-sm); }
.tssd-lb-railrow .tssd-lb-rank { min-width: 1.4em; color: var(--sd-link); font-weight: 700; }
.tssd-lb-railrow .tssd-lb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tssd-lb-railrow .tssd-lb-pts { font-weight: 700; color: var(--sd-gold-ink); }

/* Tagesrätsel-Sieger-Callout */
.tssd-lb-callout {
  display: flex; align-items: center; gap: 12px;
  background: var(--sd-surface-2); border: 1px solid var(--sd-line); border-left: 6px solid var(--sd-gold);
  border-radius: var(--sd-radius); padding: 12px 16px; margin: 12px 0;
}
.tssd-lb-callout__big { font-size: calc(var(--sd-font-size-base) * (26 / 14)); line-height: 1; }
.tssd-lb-callout__meta { color: #555; }

/* Spieler der Woche strip */
.tssd-lb-strip {
  background: var(--sd-surface-2); border: 1px solid var(--sd-line); border-radius: var(--sd-radius-pill);
  padding: 8px 16px; margin: 10px 0; text-align: center;
}

.tssd-lb-rankbadge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sd-gold-soft); border: 1px solid var(--sd-gold);
  border-radius: var(--sd-radius-pill); padding: 2px 10px;
  font-size: var(--sd-fs-xs); font-weight: 700; letter-spacing: .02em;
  color: var(--sd-gold-ink); white-space: nowrap; vertical-align: middle;
}
.tssd-lb-rankbadge__pts { color: var(--sd-muted); }
.tssd-lb-rankbadge--none { background: var(--sd-white); border-color: var(--sd-line); color: var(--sd-muted); font-weight: 400; }

@media (max-width: 600px) {
  .tssd-lb-pod.is-first { transform: none; }
}

html[data-theme="dark"] .tssd-lb-intro,
html[data-theme="dark"] .tssd-lb-empty,
html[data-theme="dark"] .tssd-lb-anon,
html[data-theme="dark"] .tssd-lb-textonly,
html[data-theme="dark"] .tssd-lb-pod__lbl,
html[data-theme="dark"] .tssd-lb-pod__cta,
html[data-theme="dark"] .tssd-lb-callout__meta,
html[data-theme="dark"] .tssd-lb-railintro,
html[data-theme="dark"] .tssd-lb-switch .selrow { color: #9aa3b2; }
html[data-theme="dark"] .tssd-lb-table th,
html[data-theme="dark"] .tssd-lb-table td,
html[data-theme="dark"] .tssd-lb-row { border-bottom-color: #2c313b; }
html[data-theme="dark"] .tssd-lb-table thead th,
html[data-theme="dark"] .tssd-lb-table--levels tr.tssd-lb-group th { background: #2b2410; border-bottom-color: #f0ba37; }
html[data-theme="dark"] .tssd-lb-table tbody tr:nth-child(odd),
html[data-theme="dark"] .tssd-lb-row:nth-child(odd) { background: #211d16; }
html[data-theme="dark"] .tssd-lb-grouphead,
html[data-theme="dark"] .tssd-lb-switch .lvl { color: #e0b968; border-bottom-color: #f0ba37; }
html[data-theme="dark"] .tssd-lb-rank { color: #9aa3b2; }
html[data-theme="dark"] .tssd-lb-time { color: #b0b6c0; }
html[data-theme="dark"] .tssd-lb-player { color: #66b2ff; }
html[data-theme="dark"] .tssd-lb-tab { background: #241f16; border-color: #3a3324; color: #c9b78a; }
html[data-theme="dark"] .tssd-lb-tab.is-active { background: #f0ba37; border-color: #e1a400; color: #3a2e00; }
html[data-theme="dark"] .tssd-lb-pod,
html[data-theme="dark"] .tssd-lb-callout,
html[data-theme="dark"] .tssd-lb-strip { background: #241f16; border-color: #3a3324; }
html[data-theme="dark"] .tssd-lb-callout { border-left-color: #f0ba37; }
html[data-theme="dark"] .tssd-lb-pod.is-first { border-color: #f0ba37; }
html[data-theme="dark"] .tssd-lb-pod--empty { background: #24272f; }
html[data-theme="dark"] .tssd-lb-pod__pts,
html[data-theme="dark"] .tssd-lb-railrow .tssd-lb-pts { color: #e8c979; }
html[data-theme="dark"] .tssd-lb-pod__cta a,
html[data-theme="dark"] .tssd-lb-railrow .tssd-lb-rank { color: #e0b968; }
html[data-theme="dark"] .tssd-lb-switch .selrow select { background: #2a2e37; border-color: #3a4049; color: #e6e9ef; }

html[data-theme="dark"] .tssd-lb-switch {
	background: #241f16; border-color: #3a3324;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .tssd-lb-row--empty .tssd-lb-name,
html[data-theme="dark"] .tssd-lb-row--empty .tssd-lb-time,
html[data-theme="dark"] .tssd-lb-row--empty .lvl { color: var(--sd-muted); }
html[data-theme="dark"] .tssd-lb-rankbadge { border-color: #6a531c; color: #e8c979; }
html[data-theme="dark"] .tssd-lb-rankbadge__pts { color: #b0b6c0; }
html[data-theme="dark"] .tssd-lb-rankbadge--none { background: #24272f; border-color: #2c313b; color: #9aa3b2; }
