/* Dashboard – Aufbau: Tab-Leiste (schmal) ↔ Seitenleiste (breit) */

.app { min-height: 100vh; }
.main-col { min-width: 0; }
#content { outline: none; }
.page {
  max-width: 880px; margin: 0 auto;
  padding: 4px 16px calc(110px + env(safe-area-inset-bottom));
}
.large-title { margin: 2px 4px 2px; padding: 0 var(--pad) 0; }
.large-title h1 { margin: 0; }
.page-sub { margin: 2px 4px 22px; padding: 0 var(--pad); color: var(--label-2); font-size: .88rem; }

/* Tab-Leiste: schwebend, Glas, Symbole gefüllt, ein Wort je Tab */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 4px;
  border-radius: 30px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(0,0,0,.14), inset 0 0 0 .5px var(--glass-line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 86px; min-height: 52px; padding: 4px 10px; border-radius: 26px;
  color: var(--label); font-size: .64rem; font-weight: 600; text-decoration: none;
}
.tabbar a .ico { width: 1.55rem; height: 1.55rem; }
.tabbar a[aria-current="page"] { color: var(--tint); background: var(--fill); }
.tabbar a:hover { text-decoration: none; }

/* Seitenleiste ab 900 px */
.sidebar { display: none; }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 280px 1fr; }
  .tabbar { display: none; }
  .trainer-link { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto;
    padding: 14px 10px 14px; background: var(--card); border-right: .5px solid var(--sep);
  }
  .page { padding-bottom: 48px; }
  .toast-root { bottom: 28px; }
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 16px; font-weight: 700; font-size: 1.18rem; font-family: var(--font-display); }
.sidebar-brand img { border-radius: 7px; }
.side-list { list-style: none; margin: 0 0 14px; padding: 0; }
.side-list a {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px;
  border-radius: 9px; color: var(--label); text-decoration: none; font-size: .94rem;
}
.side-list a .ico { color: var(--tint); width: 1.2rem; height: 1.2rem; }
.side-list a:hover { background: var(--fill); }
.side-list a[aria-current="page"] { background: var(--tint-soft); font-weight: 600; }
.side-list .side-meta { margin-left: auto; color: var(--label-2); font-size: .8rem; font-variant-numeric: tabular-nums; }
.side-head { margin: 10px 10px 4px; font-size: .72rem; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: .5px solid var(--sep); }
.side-trainer { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 9px; color: var(--label); font-size: .94rem; }
.side-trainer .ico { color: var(--label-2); width: 1.3rem; height: 1.3rem; }
.side-trainer:hover { background: var(--fill); text-decoration: none; }

/* ── Live-Anzeigetafel (Kennzeichen des Dashboards) ───────────────────── */
.live-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.board {
  display: block; color: inherit; text-decoration: none;
  background: var(--card); border-radius: var(--radius-lg); padding: 14px 16px 16px;
  box-shadow: inset 0 0 0 1.5px var(--tint-soft);
}
.board:hover { text-decoration: none; background: color-mix(in srgb, var(--card) 94%, var(--tint)); }
.board-top { display: flex; align-items: center; gap: 8px; font-size: .765rem; font-weight: 600; color: var(--tint); text-transform: uppercase; letter-spacing: .04em; }
.board-top .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: auto; }
.board-teams { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; margin-top: 12px; }
.board-team { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-team.ours { color: var(--label); }
.board-team.theirs { color: var(--label-2); font-weight: 500; }
.board-sets { font-family: var(--font-score); font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; min-width: 1.2em; }
.board-current { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.board-current .now { font-family: var(--font-score); font-size: 1.18rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--fill); border-radius: 10px; padding: 2px 10px; }
.set-chip { font-family: var(--font-score); font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--label-2); background: var(--fill); border-radius: 8px; padding: 2px 7px; }
.serve { width: .45rem; height: .45rem; border-radius: 50%; background: var(--tint); display: inline-block; margin-left: 6px; vertical-align: middle; }

/* ── Spielzeilen ──────────────────────────────────────────────────────── */
.m-time { width: 3.2em; flex: none; font-variant-numeric: tabular-nums; color: var(--label-2); font-size: .88rem; padding-top: 1px; align-self: flex-start; }
.m-teamlabel { font-weight: 600; }
.m-opp { display: block; color: var(--label); margin-top: 1px; }
.m-sets { color: var(--label-2); }
.m-where { color: var(--label-2); font-size: .765rem; margin-top: 2px; display: flex; gap: 4px; align-items: center; }
.m-where .ico { width: .9rem; height: .9rem; }
.tag { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--fill); color: var(--label-2); vertical-align: 1px; }
.tag.home { background: var(--tint-soft); color: var(--tint); }
.tag.live { background: var(--tint); color: var(--on-tint); }
.day-label { font-size: .765rem; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .03em; margin: 0 4px 6px; padding: 0 var(--pad); }
.day-label.today { color: var(--tint); }

/* ── Team-Kacheln ─────────────────────────────────────────────────────── */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 112px;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; color: inherit; text-decoration: none;
}
.tile:hover { text-decoration: none; background: color-mix(in srgb, var(--card) 92%, var(--label)); }
.tile-label { font-weight: 600; font-size: .94rem; }
.tile-liga { color: var(--label-2); font-size: .72rem; line-height: 1.25; }
.tile-rank { margin-top: auto; display: flex; align-items: baseline; gap: 6px; }
.tile-rank .big { font-family: var(--font-score); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.tile-rank .of { color: var(--label-2); font-size: .72rem; }
.form { display: inline-flex; gap: 4px; align-items: center; }
.zone-up { color: var(--up); }
.zone-down { color: var(--down); }

/* ── Team-Seite ───────────────────────────────────────────────────────── */
.team-hero { background: var(--card); border-radius: var(--radius-lg); padding: 18px 18px 16px; margin-bottom: 16px; position: relative; overflow: hidden; }
.team-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tint); }
.team-hero h1 { margin: 0; }
.team-hero .liga { color: var(--label-2); margin-top: 2px; font-size: .94rem; }
.hero-stats { display: flex; align-items: flex-end; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.hero-rank .big { font-family: var(--font-score); font-size: 3rem; font-weight: 700; line-height: .95; font-variant-numeric: tabular-nums; }
.hero-rank .cap, .hero-stat .cap { color: var(--label-2); font-size: .765rem; margin-top: 4px; }
.hero-stat .v { font-family: var(--font-score); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.zone-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .765rem; font-weight: 600; padding: 3px 8px; border-radius: 8px; margin-top: 10px; }
.zone-badge.up { background: var(--win-soft); color: var(--up); }
.zone-badge.down { background: rgba(255,149,0,.16); color: var(--down); }
.seg-wrap .segmented { background-color: var(--bg); background-image: linear-gradient(var(--fill), var(--fill)); }
.seg-wrap { position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 20; padding: 6px 0 12px; margin: 0 -2px; background: linear-gradient(var(--bg) 70%, transparent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); background: var(--card); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 12px 14px; box-shadow: .5px .5px 0 var(--sep); }
.stat .v { font-family: var(--font-score); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--label-2); font-size: .765rem; margin-top: 2px; }

.dist { display: grid; gap: 8px; padding: 14px var(--pad); }
.dist-row { display: grid; grid-template-columns: 3em 1fr 2em; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; font-size: .88rem; }
.dist-bar { height: 10px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.dist-bar > span { display: block; height: 100%; border-radius: 5px; }
.dist-bar > span.S { background: var(--win); }
.dist-bar > span.N { background: var(--loss); }

.chart-card { background: var(--card); border-radius: var(--radius); padding: 12px 14px 10px; }
.chart-card svg { width: 100%; height: auto; overflow: visible; }
.chart-card .axis { fill: var(--label-2); font-size: 11px; font-family: var(--font); }
.chart-card .grid { stroke: var(--sep); stroke-width: 1; }
.chart-card .line { fill: none; stroke: var(--tint); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-card .pt { fill: var(--card); stroke: var(--tint); stroke-width: 2; }
.chart-card .pt.last { fill: var(--tint); }

/* Tabelle */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border-radius: var(--radius); }
table.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .88rem; }
.standings th { text-align: right; font-weight: 600; font-size: .72rem; color: var(--label-2); padding: 10px 8px 8px; white-space: nowrap; border-bottom: .5px solid var(--sep); }
.standings td { text-align: right; padding: 10px 8px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.standings tr:last-child td { border-bottom: 0; }
.standings th.l, .standings td.l { text-align: left; }
.standings td.team { white-space: normal; min-width: 9em; }
.standings tr.ours td { background: var(--tint-soft); font-weight: 600; }
.standings .rank { width: 2.4em; }
.standings .z { font-size: .7rem; margin-left: 2px; }
.standings .pts { font-weight: 700; }
.standings th:first-child, .standings td:first-child { padding-left: 14px; }
.standings th:last-child, .standings td:last-child { padding-right: 14px; }
@media (max-width: 560px) { .standings .wide { display: none; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 4px 0; padding: 0 var(--pad); color: var(--label-2); font-size: .72rem; }

/* Kreuztabelle */
table.cross { border-collapse: separate; border-spacing: 0; font-size: .765rem; font-variant-numeric: tabular-nums; }
.cross th, .cross td { padding: 8px 6px; text-align: center; border-bottom: .5px solid var(--sep); border-right: .5px solid var(--sep); min-width: 4.4em; }
.cross th { color: var(--label-2); font-weight: 600; white-space: nowrap; }
.cross th.rowh { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 8em; padding-left: 14px; }
.cross td.self { background: var(--fill); }
.cross tr.ours th.rowh, .cross th.ours { color: var(--tint); }
.cross td.ours-cell { background: var(--tint-soft); }
.cross .w { color: var(--win); font-weight: 600; }
.cross .multi { display: block; }

/* Spiele-Liste der Staffel */
.match-row { display: block; padding: 11px var(--pad); }
.match-row + .match-row { border-top: .5px solid var(--sep); }
.match-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.match-teams .ours { font-weight: 600; }
.match-score { font-family: var(--font-score); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; text-align: right; }
.match-meta { color: var(--label-2); font-size: .765rem; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.match-sets { color: var(--label-2); font-size: .765rem; font-variant-numeric: tabular-nums; }
details.more summary { list-style: none; cursor: pointer; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] .match-detail { display: grid; }
.match-detail { display: none; gap: 4px; margin-top: 8px; padding: 10px 12px; background: var(--inset); border-radius: 10px; font-size: .82rem; }
.match-detail a { display: inline-flex; gap: 4px; align-items: center; }

.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar-row .grow { flex: 1; }


.src-link { display: inline-flex; align-items: center; gap: 6px; }
.src-link .ico { width: 1em; height: 1em; }
@media (min-width: 900px) { .nav-back { display: none; } .navbar { min-height: 44px; } }
