/* =========================================
   styles/live.css – NFS Trophy Live-Ticker
   Mobile-first, NFS-Grün, Dark + Light
========================================= */

:root {
    --bg: #071510;
    --surface: #0d2117;
    --surface-2: #122b1e;
    --surface-3: #183626;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #eef5ef;
    --text-2: #b9cbbe;
    --muted: #84998a;
    --accent: #5cb874;
    --accent-strong: #6fd089;
    --accent-soft: rgba(92, 184, 116, 0.14);
    --accent-ink: #062012;
    --warn: #e0a53b;
    --warn-soft: rgba(224, 165, 59, 0.14);
    --danger: #ef6a5a;
    --danger-soft: rgba(239, 106, 90, 0.14);
    --gold: #e3b341;
    --silver: #b8c2cc;
    --bronze: #d08b4f;
    --fav: #f2c94c;
    --fav-soft: rgba(242, 201, 76, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --radius: 14px;
    --radius-sm: 9px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Archivo', 'Inter', system-ui, sans-serif;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f2f5f1;
    --surface: #ffffff;
    --surface-2: #f5f8f4;
    --surface-3: #e9efe8;
    --border: #e1e8e0;
    --border-strong: #ccd8cb;
    --text: #0f2418;
    --text-2: #3d5445;
    --muted: #6b7f70;
    --accent: #2f8a4a;
    --accent-strong: #26743d;
    --accent-soft: rgba(47, 138, 74, 0.1);
    --accent-ink: #ffffff;
    --warn: #b7791f;
    --warn-soft: rgba(183, 121, 31, 0.1);
    --danger: #c9412f;
    --danger-soft: rgba(201, 65, 47, 0.08);
    --gold: #b8860b;
    --silver: #7d8792;
    --bronze: #a0602c;
    --fav: #a77d00;
    --fav-soft: rgba(242, 201, 76, 0.18);
    --shadow: 0 1px 2px rgba(15, 36, 24, 0.05), 0 6px 20px rgba(15, 36, 24, 0.06);
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h2,
h3,
h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

a {
    color: var(--accent);
}

.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.num {
    font-variant-numeric: tabular-nums;
}

.muted {
    color: var(--muted);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ----- HEADER ----- */
.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}

.top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.brand .t1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand .t2 {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.status .dot.live {
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent);
    animation: pulse 1.8s infinite;
}

.status .dot.poll {
    background: var(--accent);
}

.status .dot.loading {
    background: var(--warn);
}

.status .dot.offline {
    background: var(--danger);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
    }

    70% {
        box-shadow: 0 0 0 8px transparent;
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
}

/* Bewerb-Chips */
.chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 10px;
    scrollbar-width: none;
}

.chips-scroll[hidden] {
    display: none;
}

.chips-scroll::-webkit-scrollbar {
    display: none;
}

.chips-scroll button {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}

.chips-scroll button[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.chips-scroll button .cnt {
    font-weight: 500;
    opacity: 0.75;
    margin-left: 4px;
}

/* Tabs */
.tabs {
    border-top: 1px solid var(--border);
}

.tabs[hidden] {
    display: none;
}

.tabs-inner {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-inner::-webkit-scrollbar {
    display: none;
}

.tabs button {
    flex-shrink: 0;
    border: 0;
    background: none;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tabs button[aria-selected="true"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ----- MAIN ----- */
.main {
    padding-top: 16px;
    padding-bottom: 40px;
}

.tab-panel[hidden] {
    display: none;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 22px 0 10px;
}

.section-title:first-child {
    margin-top: 4px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--muted);
}

.empty .big {
    font-size: 30px;
    margin-bottom: 6px;
}

/* ----- FAVORIT-BANNER ----- */
.fav-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--fav-soft);
    border: 1px solid color-mix(in srgb, var(--fav) 35%, transparent);
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.fav-banner .star {
    color: var(--fav);
    font-size: 20px;
}

.fav-banner .body {
    flex: 1;
    min-width: 0;
}

.fav-banner .who {
    font-weight: 700;
}

.fav-banner .what {
    font-size: 13px;
    color: var(--text-2);
}

/* ----- TISCHE ----- */
.tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.tcard {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tcard .thead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.tcard .tnr {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
}

.tcard .tnr small {
    font-family: var(--font);
    font-weight: 500;
    color: var(--muted);
    font-size: 12px;
    margin-left: 6px;
}

.tcard .timer {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tcard .timer::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.8s infinite;
}

.tcard .vs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tcard .pl {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
}

.tcard .pl .club {
    font-weight: 500;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.tcard .vs .pl+.pl {
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.tcard.free {
    padding: 10px 14px;
    color: var(--muted);
    box-shadow: none;
    background: transparent;
    border-style: dashed;
}

.tcard.free .tnr {
    color: var(--text-2);
}

.tcard.other {
    opacity: 0.6;
}

.tcard.is-fav {
    border-color: color-mix(in srgb, var(--fav) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--fav) 35%, transparent), var(--shadow);
}

.fav-mark {
    color: var(--fav);
}

/* ----- LISTEN (Ergebnisse, Warteschlange) ----- */
.list {
    display: flex;
    flex-direction: column;
}

.list-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row.is-fav {
    background: var(--fav-soft);
}

.list-row .lead {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    color: var(--muted);
    min-width: 28px;
    text-align: center;
}

.list-row .players {
    min-width: 0;
}

.list-row .players .p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row .players .p.win {
    font-weight: 700;
}

.list-row .players .p.lose {
    color: var(--text-2);
}

.list-row .meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.list-row .score {
    text-align: right;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    white-space: nowrap;
}

.list-row .score small {
    display: block;
    font-family: var(--font);
    font-weight: 500;
    font-size: 11px;
    color: var(--muted);
}

/* ----- RANGLISTE ----- */
.search {
    position: relative;
    margin-bottom: 12px;
}

.search .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.search input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    outline: none;
}

.search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
}

.rank-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: right;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.rank-table th.l,
.rank-table td.l {
    text-align: left;
}

.rank-table td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rank-table tr:last-child td {
    border-bottom: 0;
}

.rank-table tbody tr {
    cursor: pointer;
}

.rank-table tbody tr:hover td {
    background: var(--surface-2);
}

.rank-table tr.is-fav td {
    background: var(--fav-soft);
}

.rank-table .rk {
    width: 40px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 800;
}

.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    color: #1b1b1b;
}

.medal.g {
    background: var(--gold);
}

.medal.s {
    background: var(--silver);
}

.medal.b {
    background: var(--bronze);
}

.rank-table .nm {
    font-weight: 600;
    white-space: normal;
}

.rank-table .nm .club {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--muted);
}

.rank-table .w {
    font-weight: 800;
    font-family: var(--font-display);
    font-size: 16px;
}

.tie {
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
}

.legend {
    font-size: 12px;
    color: var(--muted);
    margin-top: 10px;
    line-height: 1.6;
}

/* ----- SPIELER ----- */
.suggest {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.suggest:empty {
    display: none;
}

.suggest button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    text-align: left;
}

.suggest button:hover {
    border-color: var(--accent);
}

.suggest .s-name {
    font-weight: 600;
}

.suggest .s-meta {
    font-size: 12px;
    color: var(--muted);
}

.player-hero {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(400px 200px at 100% 0%, rgba(92, 184, 116, 0.2), transparent 70%),
        var(--surface);
}

.player-hero .ph-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.player-hero h2 {
    font-size: 24px;
}

.player-hero .ph-meta {
    color: var(--text-2);
    font-size: 14px;
    margin-top: 2px;
}

.ph-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ph-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
}

.ph-actions button.on {
    border-color: var(--fav);
    color: var(--fav);
    background: var(--fav-soft);
}

.next-up {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.next-up.wait {
    background: var(--warn-soft);
    border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.next-up.idle {
    background: var(--surface-2);
    border-color: var(--border);
}

.next-up .k {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.next-up .v {
    font-weight: 700;
    font-size: 15px;
}

.next-up .big {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    min-width: 44px;
    text-align: center;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.kpi {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
}

.kpi .k {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi .v {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    margin-top: 2px;
}

.bw-block {
    margin-top: 18px;
}

.bw-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.bw-block-head h3 {
    font-size: 17px;
}

.match {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.match:last-child {
    border-bottom: 0;
}

.match .opp {
    font-weight: 600;
}

.match .round {
    font-size: 12px;
    color: var(--muted);
}

.match .sets {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}

.match .res {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.match .res .sc {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
}

.badge.win {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge.loss {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.run {
    background: var(--accent);
    color: var(--accent-ink);
}

.badge.queue {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge.open {
    background: var(--surface-3);
    color: var(--text-2);
}

/* ----- TÖPFE ----- */
.pots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.pot h3 {
    font-size: 15px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.pot h3 small {
    font-family: var(--font);
    font-weight: 500;
    color: var(--muted);
    font-size: 12px;
}

.pot .row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
    padding: 8px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.pot .row:last-child {
    border-bottom: 0;
}

.pot .row.is-fav {
    background: var(--fav-soft);
}

.pot .row .sd {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ----- STATISTIK ----- */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.stat-tile {
    padding: 12px 14px;
}

.stat-tile .k {
    font-size: 12px;
    color: var(--muted);
}

.stat-tile .v {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    margin-top: 2px;
}

.upset {
    padding: 16px;
    margin-top: 10px;
}

.upset .k {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.upset .v {
    font-weight: 600;
    margin-top: 4px;
}

/* ----- SYSTEM ----- */
.system {
    padding: 20px;
    line-height: 1.65;
}

.system h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.system p,
.system ol {
    color: var(--text-2);
    margin-bottom: 12px;
}

.system ol {
    padding-left: 20px;
}

.system li {
    margin-bottom: 8px;
}

.system strong,
.system .hl {
    color: var(--text);
    font-weight: 600;
}

.system hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.system .note {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    font-size: 14px;
}

/* ----- FOOTER / TOAST ----- */
.foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.foot a {
    color: var(--muted);
}

.toast-container {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 16px;
    border-radius: 99px;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: toastIn 0.25s ease-out;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

.toast.fade-out {
    opacity: 0;
    transition: opacity 0.3s;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (min-width: 720px) {
    .wrap {
        padding-left: 24px;
        padding-right: 24px;
    }

    .main {
        padding-top: 22px;
    }

    .toast-container {
        left: auto;
        right: 24px;
        align-items: flex-end;
    }
}

@media (max-width: 420px) {
    .rank-table .hide-xs {
        display: none;
    }

    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .status #statusText {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ----- NOCH NICHT LIVE (TTOP pausiert) ----- */
.not-live {
    padding: 36px 22px;
    text-align: center;
    background:
        radial-gradient(500px 240px at 50% 0%, rgba(92, 184, 116, 0.18), transparent 70%),
        var(--surface);
}

.not-live h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.not-live p {
    max-width: 460px;
    margin: 0 auto 10px;
}

.not-live .nl-when {
    color: var(--text-2);
}

.nl-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

/* Gleichstände: Kürzel in der Tabelle */
.tb-chip {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--muted);
    vertical-align: 1px;
}

.tb-chip.tb-h2h {
    background: var(--warn-soft);
    color: var(--warn);
}

.tie-card {
    margin-top: 12px;
    padding: 12px 14px;
}

.tie-card .tie-notes {
    margin-top: 0;
}

.tie-hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: -4px 0 10px;
}

.rank-table .show-xs {
    display: none;
}

@media (max-width: 420px) {
    .rank-table .show-xs {
        display: block;
        font-size: 11px;
        color: var(--muted);
        font-weight: 500;
    }
}

/* ----- Gleichstände erklärt (Admin und Live-Ticker gleich, src/live/tie-notes.js) ----- */
.tie-notes {
    margin-top: 12px;
    font-size: 13px;
}

.tie-notes > summary {
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tie-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--surface-3);
    font-size: 11px;
}

.tie-group {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}

.tie-group > summary {
    cursor: pointer;
    padding: 9px 12px;
    font-weight: 600;
}

.tie-block {
    padding: 0 12px 12px;
}

.tie-block + .tie-block {
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.tie-heading {
    font-weight: 600;
    margin-bottom: 2px;
}

.tie-intro {
    color: var(--muted);
    margin-bottom: 6px;
}

.tie-duel {
    font-weight: 600;
    color: var(--accent);
}

.tie-table-wrap {
    overflow-x: auto;
}

.tie-table {
    border-collapse: collapse;
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.tie-table th,
.tie-table td {
    padding: 4px 8px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.tie-table th:first-child,
.tie-table td:first-child {
    text-align: left;
    white-space: normal;
}

.tie-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.tie-table .eq {
    opacity: 0.7;
}

.tie-table .dec {
    color: var(--accent);
    font-weight: 700;
}

.tie-table th.dec {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.tie-table tr.me td {
    background: var(--accent-soft);
}

.tie-legend {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--muted);
}

/* ----- Endstand und Siegerehrung ----- */
.standing-state {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin: 4px 2px 8px;
    font-size: 13px;
    font-weight: 600;
}

.standing-state.done {
    color: var(--accent);
}

.podium {
    padding: 14px 12px 0;
    margin-bottom: 12px;
    overflow: hidden;
}

.pod-title {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.pod-steps {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    align-items: end;
    gap: 6px;
    max-width: 520px;
    margin: 0 auto;
}

.pod-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    min-width: 0;
    cursor: pointer;
}

.pod-name {
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.2;
    overflow-wrap: break-word;
    max-width: 100%;
}

.pod-club {
    font-size: 11px;
    color: var(--muted);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pod-block {
    width: 100%;
    margin-top: 6px;
    border-radius: 8px 8px 0 0;
    border-top: 4px solid currentColor;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.pod-block span {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text);
}

/* Getönte Blöcke mit kräftiger Oberkante – in hellem und dunklem Design gut lesbar */
.pod-step.g .pod-block { height: 74px; color: var(--gold); background: color-mix(in srgb, var(--gold) 26%, var(--surface)); }
.pod-step.s .pod-block { height: 54px; color: var(--silver); background: color-mix(in srgb, var(--silver) 26%, var(--surface)); }
.pod-step.b .pod-block { height: 40px; color: var(--bronze); background: color-mix(in srgb, var(--bronze) 26%, var(--surface)); }
.pod-step.g .medal { width: 32px; height: 32px; font-size: 15px; }

/* Dunkles Design: volle Metallfarben, dunkle Schrift (getönt wirkt es dort matt) */
:root:not([data-theme="light"]) .pod-step.g .pod-block { background: var(--gold); }
:root:not([data-theme="light"]) .pod-step.s .pod-block { background: var(--silver); }
:root:not([data-theme="light"]) .pod-step.b .pod-block { background: var(--bronze); }
:root:not([data-theme="light"]) .pod-block span { color: #1b1b1b; }

/* ==========================================
   GRUPPEN & KO (src/live/bw-view.js)
   ========================================== */
.live-note { padding: 12px 14px; margin-bottom: 12px; border-left: 4px solid var(--warn); background: var(--warn-soft); font-weight: 600; }

/* Gruppen: Karten nebeneinander, sobald Platz ist */
.lg-grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .lg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.lg-card { padding: 0; overflow: hidden; }
.lg-card.done { border-color: var(--accent-soft); }
.lg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; }
.lg-head h3 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.lg-state { font-size: 12px; color: var(--muted); font-weight: 600; }
.lg-state.done { color: var(--accent); }
.lg-live { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 7px; }
.lg-table td.nm .lg-live { vertical-align: middle; }
.lg-table tr.q-up td { background: var(--accent-soft); }
.lg-table tr.q-out td { background: var(--danger-soft); }
.lg-table tr.q-up.is-fav td:first-child, .lg-table tr.q-out.is-fav td:first-child { box-shadow: inset 3px 0 0 var(--fav); }
.lg-up { margin-left: 3px; font-size: 12px; color: var(--accent); opacity: .45; }
.lg-up.sure { opacity: 1; }
.lg-tie { white-space: nowrap; }

.lg-games { margin: 12px 0 0; background: var(--surface-2); border-top: 1px solid var(--border); }
.lg-games > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 700; user-select: none; }
.lg-games > summary::-webkit-details-marker { display: none; }
.lg-games > summary::after { content: '›'; font-size: 18px; line-height: 1; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.lg-games[open] > summary::after { transform: rotate(-90deg); }
.lg-games > summary > span:first-child { flex: 1; }
.lg-games-n { font-weight: 600; color: var(--muted); font-size: 12px; }
.lg-games[open] { padding-bottom: 10px; }
.lg-games .lg-round { padding: 0 14px; }
.lg-games .lg-round-h { margin-top: 4px; }
.lg-round-h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.lg-game { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.lg-game:last-child { border-bottom: 0; }
.lg-game .p { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-game .p2 { text-align: right; }
.lg-game .p.win { font-weight: 700; }
.lg-game .r { text-align: center; min-width: 52px; }
.lg-game .sc { font-family: var(--font-display); font-weight: 800; }
.lg-game .s { grid-column: 1 / -1; text-align: center; font-size: 11px; color: var(--muted); }
.lg-game.is-fav { background: var(--fav-soft); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.lg-card .table-wrap { margin-bottom: 0; }
.sw-games { padding: 2px 14px 8px; }
.lg-retired { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; white-space: nowrap; }
.sw-live { display: flex; flex-direction: column; gap: 12px; }
.sw-live > .card { margin: 0; }
.sw-fold > summary { list-style: none; cursor: pointer; }
.sw-fold > summary::-webkit-details-marker { display: none; }
.sw-fold > summary h3::before { content: '▾'; display: inline-block; width: 1.1em; opacity: .5; font-size: .85em; }
.sw-fold:not([open]) > summary h3::before { content: '▸'; }
.sw-fold:not([open]) > summary { border-bottom: 0; }
.lg-game .p2.win { font-weight: 700; }
.lg-game .p2 { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Raster */
.lk-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.lk-bracket { display: grid; column-gap: 18px; row-gap: 8px; min-width: min-content; padding: 3px; }
.lk-tree { --q: 24px; row-gap: 0; }
.lk-tree .lk-cell { --slot: calc(4 * var(--q)); padding: 4px 0; }
.lk-link { position: absolute; left: 100%; width: 9px; pointer-events: none; }
.lk-link.down { top: 50%; height: calc(var(--dy) * var(--slot)); border-top: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); }
.lk-link.up { bottom: 50%; height: calc(var(--dy) * var(--slot)); border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); }
.lk-rh { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.lk-rh small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.lk-cell { position: relative; display: flex; align-items: center; min-width: 150px; }
.lk-cell > .lk-match, .lk-cell > div { width: 100%; }
.lk-cell.next::after { content: ''; position: absolute; left: 100%; width: 9px; top: 50%; border-top: 1px solid var(--border-strong); }
.lk-cell.next.lk-top::before { content: ''; position: absolute; left: calc(100% + 9px); top: 50%; bottom: -4px; border-left: 1px solid var(--border-strong); }
.lk-cell.next.lk-bot::before { content: ''; position: absolute; left: calc(100% + 9px); top: -4px; bottom: 50%; border-left: 1px solid var(--border-strong); }
.lk-cell.prev .lk-match::before { content: ''; position: absolute; right: 100%; width: 9px; top: 50%; border-top: 1px solid var(--border-strong); }
.lk-cell.p3 { margin-top: 14px; align-items: flex-start; }
.lk-match { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.lk-match.bye { opacity: .6; }
.lk-match.running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.lk-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; cursor: default; }
.lk-line[data-player] { cursor: pointer; }
.lk-line + .lk-line { border-top: 1px solid var(--border); }
.lk-line .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: .2em; }  /* Kursiv (A1) nicht abschneiden */
.section-title.sub { margin-top: 14px; font-size: 13px; opacity: .85; }
.lk-seed { margin-right: 6px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); font-variant-numeric: tabular-nums; border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px; font-style: normal; }
.lk-seed.ll { margin: 0 0 0 4px; }
.lk-win-group { margin: 12px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.lk-way { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; opacity: .8; white-space: nowrap; }
.lk-way > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.lk-gf-wrap { max-width: 560px; }
.lk-match.lk-route-win { box-shadow: 0 0 0 2px var(--accent); }
.lk-match.lk-route-lose { box-shadow: 0 0 0 2px #d08a1c; }
.lk-fold { margin-top: 18px; }
.lk-fold > summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 2px 0; }
.lk-fold > summary::-webkit-details-marker { display: none; }
.lk-fold > summary::before { content: '▾'; display: inline-block; width: 1.2em; opacity: .6; }
.lk-fold:not([open]) > summary::before { content: '▸'; }
.lk-gfline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; }
.lk-gfline .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-gfline .nm.r { text-align: right; }
.lk-gfline .nm.win { font-weight: 700; }
.lk-gfline .sc { font-weight: 700; text-align: center; }
.lk-gfline .colon { opacity: .6; }
.lk-more { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13px; }
.lk-more b { opacity: .7; margin-right: 3px; }
.lk-more .open { opacity: .6; }
.lk-line.win .nm { font-weight: 700; }
.lk-line .sc { font-weight: 700; font-family: var(--font-display); }
.lk-line .ph { color: var(--muted); font-style: italic; }
.lk-line.is-fav { background: var(--fav-soft); }
.lk-meta { padding: 3px 9px 6px; font-size: 11px; }

/* Siegerliste */
.lk-winners { padding: 14px; margin-bottom: 12px; }
.lk-win { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.lk-win.open { cursor: default; color: var(--muted); }
.lk-win .nm { font-weight: 700; }
.lk-win .club { font-size: 12px; color: var(--muted); }
.lk-cons { display: flex; gap: 10px; align-items: baseline; padding-top: 10px; }
.lk-cons .nm { font-weight: 700; cursor: pointer; }

/* Bewerb, der gerade angezeigt wird (Tabelle/Gruppen, Raster, Warteschlange, Töpfe, Statistik) */
.bewerb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 2px 0 14px; padding-left: 12px; border-left: 4px solid var(--accent); }
.bh-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.15; }
.bh-sub { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Ohne Emojis: Logo, Icons, System-Tab */
.not-live .nl-logo { display: block; margin: 0 auto 12px; border-radius: 50%; }
.sys-src { font-size: 12px; color: var(--muted); margin: -4px 0 10px; letter-spacing: .02em; }
.system ul { padding-left: 20px; color: var(--text-2); }
.system ul li { margin-bottom: 8px; }
.live-note { font-weight: 600; }

/* Statistik */
.stat-tile .v small { font-size: 15px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.stat-tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-dist { padding: 8px 14px; }
.sd-row { display: grid; grid-template-columns: 44px 1fr 84px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sd-row:last-child { border-bottom: 0; }
.sd-k { font-family: var(--font-display); font-weight: 800; }
.sd-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sd-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.sd-v { text-align: right; font-weight: 700; }
.sd-v small { margin-left: 8px; color: var(--muted); font-weight: 600; }
.stat-table td:last-child, .stat-table th:last-child { padding-right: 14px; }
.stat-bal:not(.all) tr.more { display: none; }
.stat-more { display: block; width: 100%; padding: 11px 14px; font-size: 13px; font-weight: 700; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); cursor: pointer; text-align: left; }

/* System-Tab: Karten mit Abstand, Eckdaten je Bewerb */
#tab-system .card + .card { margin-top: 12px; }
.sys-bewerb + .sys-bewerb { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sys-bewerb h4 { font-size: 16px; margin: 0 0 8px; }
.sys-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.sys-facts dt { font-weight: 600; color: var(--muted); font-size: 13px; padding-top: 1px; }
.sys-facts dd { margin: 0; color: var(--text-2); }
@media (max-width: 420px) { .sys-facts { grid-template-columns: 1fr; gap: 0; } .sys-facts dd { margin-bottom: 8px; } }
/* Statistik: Kacheln zentriert */
.stat-tile { text-align: center; }

/* CL-Modus: Topffarben (Tabelle, Töpfe) – wie im Admin */
.cl-pot.pot-1 { --pot: #2f9e5b; }
.cl-pot.pot-2 { --pot: #3b7dd8; }
.cl-pot.pot-3 { --pot: #d08a1c; }
.cl-pot.pot-4 { --pot: #9a62d1; }
.rank-table tr.cl-pot td { background: color-mix(in srgb, var(--pot, transparent) 9%, transparent); }
.rank-table tr.cl-pot td:first-child { box-shadow: inset 3px 0 0 var(--pot, transparent); }
.pot.cl-pot { border-top: 3px solid var(--pot); }
.pot.cl-pot h3 { color: var(--pot); }

/* freie Tische: voraussichtlich nächstes Spiel */
.tcard .tnext { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--text); }
.tcard .tnext .muted { font-size: 11.5px; }
.tcard .tnext.is-fav b { color: var(--fav); }
.tcard .tnr small + small::before { content: '· '; }

@media (max-width: 600px) {
    .tables { gap: 8px; }
    .tcard { padding: 10px 12px; gap: 6px; }
    .tcard .vs { gap: 2px; }
}

/* Hallenplan über den Tischen (optional) */
.hall-plan { padding: 12px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hp-grid { display: grid; gap: 4px; flex: 0 1 auto; }
.hp-t { display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 24px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.hp-t.free { background: var(--accent-soft); color: var(--accent); }
.hp-t.busy { background: var(--accent); color: #fff; }
.hp-t.off { border: 1px dashed var(--border); color: var(--muted); }
.hp-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.hp-legend .hp-t { height: 12px; min-width: 12px; margin-left: 8px; }

/* Teamkampf: Einzelspiele aufklappbar */
.lg-team {
    grid-column: 1 / -1;
    font-size: 12px;
}
.lg-team summary {
    cursor: pointer;
    color: var(--muted);
}
.lg-team-game {
    display: grid;
    grid-template-columns: 18px 1fr auto 1fr;
    gap: 6px;
    padding: 2px 0;
}
.lg-team-game .n {
    color: var(--muted);
}
.lg-team-game span:last-child {
    text-align: right;
}
.lg-team-game .win {
    font-weight: 600;
}
.lg-team-game .pts {
    grid-column: 2 / -1;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

/* Raster: Spielnummer, läuft und Verlierer-Weg in einer Zeile */
.lk-way .lg-live { flex: none; }
