:root {
  --bg: #0e1117;
  --panel: #161b22;
  --panel-2: #1f262e;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2ea043;
  --accent-2: #58a6ff;
  --warn: #d29922;
  --bad: #f85149;
  --waiting: #d29922;
  --closed: #6e7681;
  --open: #2ea043;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topnav .brand { font-weight: 600; font-size: 18px; cursor: default;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.topnav .brand span { margin-left: 6px; }
.topnav .links { display: flex; gap: 4px; }
.topnav .links a {
  padding: 6px 12px; border-radius: 6px; color: var(--muted);
}
.topnav .links a.active { background: var(--panel-2); color: var(--text); }
/* "Live" im Menü: grüner, pulsierender Punkt + grüne Schrift (ersetzt das LIVE-Badge) */
.topnav .links a.nav-live,
.topnav .links a.nav-live.active { display: inline-flex; align-items: center; gap: 7px; color: var(--open); }
.nav-live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--open); animation: livePulse 2s infinite;
}
.topnav .status {
  margin-left: auto; white-space: nowrap;
  display: flex; flex-direction: column; align-items: stretch; line-height: 1.1;
}
/* Label und Zeit füllen identische Breite (= Breite der Uhrzeit, da diese tabular-nums ist
   und ohnehin die breiteste Zeile bildet). text-align-last:justify spreizt die Buchstaben
   von "Datensatz" so, dass Anfang und Ende exakt mit der Uhrzeit fluchten. */
.ds-label { font-size: 8px; color: var(--muted); text-transform: uppercase;
  text-align: justify; text-align-last: justify; }
.ds-time  { font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums;
  text-align: center; }
/* Crawler-Alter: gelb bei >15 min, rot bei >60 min (Daten hängen / Crawler tot) */
.topnav .status.ds-stale .ds-label,
.topnav .status.ds-stale .ds-time { color: var(--warn); }
.topnav .status.ds-dead .ds-label,
.topnav .status.ds-dead .ds-time { color: var(--bad); }
.topnav .status.ds-dead { animation: dotBlink 2s infinite; }

/* Pull-to-Refresh-Hinweis (nur am Handy sichtbar) */
.ptr-indicator {
  position: fixed; top: 0; left: 0; right: 0; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--muted); font-size: 12px;
  border-bottom: 1px solid var(--border);
  z-index: 200; pointer-events: none;
  transform: translateY(-100%); transition: transform 0.18s ease;
  opacity: 0;
}
.ptr-indicator.visible { opacity: 1; }

main { padding: 20px; max-width: 1600px; margin: 0 auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
/* margin-top:auto drückt die Zahl nach unten — so stehen alle Kacheln-Zahlen auf gleicher Höhe */
.kpi .value { font-size: 26px; font-weight: 600; margin-top: auto; padding-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chart-note { font-size: 11px; color: var(--muted); margin: -2px 0 8px; font-style: italic; }
.kpi .delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.delta.up   { color: var(--open); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* gemeinsamer grüner Live-Punkt */
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--open);
  display: inline-block; flex: none; animation: livePulse 2s infinite; }

/* ===== Live-Kennzahlen: Hero + Mini ===== */
.kpis-v3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-bottom: 20px; }
.kpi3-hero { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  background: linear-gradient(150deg, rgba(46,160,67,0.20), var(--panel) 70%);
  display: flex; flex-direction: column; justify-content: center; }
.kpi3-hero-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.kpi3-hero-num { font-size: 52px; font-weight: 800; line-height: 1; color: var(--open); margin: 4px 0; }
.kpi3-hero-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi3-mini-col { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.kpi3-mini { border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
  background: var(--panel); display: flex; align-items: baseline; gap: 10px; }
.kpi3-mini-num { font-size: 26px; font-weight: 700; }
.kpi3-mini-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }

.casino-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.casino-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.casino-card.empty { opacity: 0.55; }
/* Hover auf einer Karten-Bubble hebt das Casino hervor */
.casino-card.hl { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(88,166,255,0.4); }
/* per Bubble-Tap angeheftetes Casino (oben in der Liste) */
.casino-card.pinned { border-color: var(--open); box-shadow: 0 0 0 2px rgba(46,160,67,0.35); }
.casino-card.hl, .casino-card.pinned { opacity: 1; }
.casino-card header { display: flex; justify-content: space-between; align-items: baseline; }
.casino-card h3 { margin: 0; font-size: 16px; }
.casino-card .count { color: var(--muted); font-size: 12px; }
.casino-card.active h3::before { content: "●"; color: var(--open); display: inline-block; margin-right: 8px; animation: dotBlink 2.4s ease-in-out infinite; }
/* Nur Wartelisten, kein offener Tisch → orange pulsierender Punkt */
.casino-card.waiting-only h3::before { content: "●"; color: var(--waiting); display: inline-block; margin-right: 8px; animation: dotBlink 2.4s ease-in-out infinite; }
.casino-card.empty h3::before { content: "○"; color: var(--closed); display: inline-block; margin-right: 8px; }

/* Live indicators */
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,160,67,0.65); }
  70%  { box-shadow: 0 0 0 9px rgba(46,160,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,160,67,0); }
}
/* dezenter Puls für Karten-Bubbles — kleinerer Radius, damit sich Punkte nicht überlagern */
@keyframes mapPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,160,67,0.55); }
  70%  { box-shadow: 0 0 0 5px rgba(46,160,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,160,67,0); }
}
@keyframes dotBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.table-row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 8px 10px; border-radius: 6px; background: var(--panel-2);
  font-size: 13px;
}
.table-row .meta { color: var(--muted); font-size: 12px; }
.table-row .dur { font-variant-numeric: tabular-nums; color: var(--accent-2); }
.table-row.waiting-only { border-left: 3px solid var(--waiting); }

.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-start; }
.controls.page-controls { margin-top: 12px; }
.controls label { color: var(--muted); font-size: 12px; }
/* Alle Steuer-Labels (Zeitraum, Game, Von/Bis …) gleich wie die Casino-Auswahl stapeln:
   Beschriftung oben, Eingabe darunter — sorgt für eine ruhige, ausgerichtete Steuerleiste */
.controls > label { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.controls select, .controls input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  height: 32px; box-sizing: border-box; line-height: 1.4;
  font-family: inherit;
}
.controls > label > #fCasino,
.controls .ms-button { min-width: 160px; }
.controls > label > #fGame { min-width: 128px; }
.controls > label > #fPreset,
.controls > label > #fRange { min-width: 148px; }
/* Datums-Auswahl auf dunkles Thema bringen (Kalender-Popup, Icon-Farbe) */
.controls input[type=date] { color-scheme: dark; min-width: 138px; }
.controls button {
  background: var(--accent); color: white; border: 0; padding: 6px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.controls button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.controls button.danger    { background: var(--bad); }
/* Casino-Auswahl grün hervorgehoben — einheitlich wie auf der Analyse-Seite */
#fCasino { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
#fCasino option { background: var(--panel); color: var(--text); font-weight: 400; }

/* Sticky-Kopf — Steuerleiste + KPI-Reihe bleiben beim Scrollen sichtbar */
.sticky-top {
  position: sticky;
  top: 42px;
  z-index: 40;
  background: var(--bg);
  margin: 0 -20px 16px;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.sticky-top .controls { margin-bottom: 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.chart-box { position: relative; height: 280px; width: 100%; }

/* Panel-Überschrift mit rechtsbündigem Inline-Toggle */
.panel h2.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.trend-toggle {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; font-weight: 400; color: var(--text);
  text-transform: none; letter-spacing: normal;
}
.trend-toggle[hidden] { display: none; }
.trend-toggle input { margin: 0; }
/* Info-Text rechts in einer Panel-Überschrift (z.B. "X Sessions · Y h") */
.csv-btn {
  margin-left: auto; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px;
  font-size: 12px; cursor: pointer;
}
.csv-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.summary-info { font-size: 12px; font-weight: 400; color: var(--muted);
  text-transform: none; letter-spacing: normal; }

/* Multi-select casino picker */
.ms-wrap { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ms-wrap > label { color: var(--muted); font-size: 12px; }
/* gleiche Höhe wie die anderen Steuerfelder (Selects/Inputs) */
.controls .ms-button { height: 32px; box-sizing: border-box; line-height: 1.4; }
.ms-button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px; font-size: 13px; cursor: pointer;
  text-align: left; position: relative;
}
.ms-button::after { content: "▾"; position: absolute; right: 10px; color: var(--text); }
.ms-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; z-index: 50; min-width: 220px;
  max-height: 360px; overflow: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.ms-row { display: flex; gap: 6px; padding-bottom: 6px; }
.ms-row button { padding: 4px 8px; font-size: 12px; }
.ms-opt { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ms-opt:hover { background: var(--panel-2); }
.ms-opt input { margin: 0; }

/* Admin row action buttons */
/* Action buttons inside admin tables — alle gleich groß */
table.tbl td button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-right: 4px;
}
table.tbl td button.danger { background: transparent; color: var(--bad); border-color: var(--border); opacity: 0.75; }
table.tbl td button.danger:hover { background: rgba(248,81,73,0.12); border-color: var(--bad); opacity: 1; }
table.tbl td button.btn-status { min-width: 124px; }
table.tbl td button.btn-icon   { min-width: 36px; padding: 0 8px; }

/* Ø Tisch-Dauer Cards (kompakt) */
.avg-dur-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  min-height: 60px;
  align-items: stretch;
}
.avg-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  min-height: 58px;
  height: 58px;
  position: relative;
  overflow: hidden;
}
.avg-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--bar, 0%);
  background: linear-gradient(90deg, rgba(46,160,67,0.3) 0%, rgba(46,160,67,0.04) 100%);
  z-index: 0;
}
.avg-card > * { position: relative; z-index: 1; }
.avg-card .casino { font-weight: 600; font-size: 11px; line-height: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avg-card .value  { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 1px; }
.avg-card .value .unit { font-size: 11px; color: var(--muted); margin-left: 2px; }
.avg-card .meta   { font-size: 10px; line-height: 12px; color: var(--muted); margin-top: 2px; display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.avg-card .meta span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avg-card .meta span b { color: var(--text); font-weight: 600; }
.avg-card.is-avg { border-color: #ffd166; }
.avg-card.is-avg::before {
  background: linear-gradient(90deg, rgba(255,209,102,0.32) 0%, rgba(255,209,102,0.05) 100%);
}
.avg-card.is-avg .value { color: #ffd166; }
.avg-card-skeleton {
  --bar: 100%;
  pointer-events: none;
}
.avg-card-skeleton::before {
  background: linear-gradient(90deg, rgba(88,166,255,0.10) 0%, rgba(88,166,255,0.03) 100%);
}
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: rgba(139,148,158,0.16);
  border-radius: 999px;
}
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(230,237,243,0.14), transparent);
  animation: avgSkeletonShimmer 1.3s ease-in-out infinite;
}
.skeleton-title { width: 58%; height: 8px; margin-top: 2px; }
.skeleton-value { width: 42%; height: 15px; margin-top: 6px; }
.skeleton-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.skeleton-meta { width: 44%; height: 7px; }
.skeleton-meta.short { width: 34%; }
@keyframes avgSkeletonShimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line::after { animation: none; }
}
.chart-box.sm { height: 270px; }
.chart-box.lg { height: 360px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .row { grid-template-columns: 1fr; } }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.row3 .kpi { justify-content: space-between; }
@media (max-width: 1200px) { .row3 { grid-template-columns: 1fr 1fr; } }
/* Am Handy: 3 KPIs nebeneinander in einer Zeile, kompakt */
@media (max-width: 700px) {
  .row3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .row3 .kpi { padding: 8px 8px; }
  .row3 .kpi .label { font-size: 9px; letter-spacing: 0.2px; }
  .row3 .kpi .value { font-size: 17px; }
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
/* Scroll-Wrapper für breite Tabellen (statt aus der Box zu ragen) */
.table-scroll { overflow-x: auto; }
/* Desktop: Tabelle füllt die volle Panel-Breite. Mobil (Override unten) wird sie auf
   min-content geklemmt, damit horizontal gescrollt werden kann. */
.table-scroll table.tbl { width: 100%; }
.table-scroll table.tbl th, .table-scroll table.tbl td { white-space: nowrap; }
/* Status-Punkt in Tabellen */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.status-dot.live { background: var(--open); animation: livePulse 2s infinite; }
.status-dot.done { background: var(--closed); }
table.tbl th, table.tbl td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
table.tbl tr:hover td { background: var(--panel-2); }
/* Sessions-Tabelle: kurze Code-Spalten (Game/Blinds/Tisch/Status) zentriert,
   damit Werte unter ihren Überschriften sitzen statt linksbündig wegzulaufen */
#tbl th:nth-child(2), #tbl td:nth-child(2),
#tbl th:nth-child(3), #tbl td:nth-child(3),
#tbl th:nth-child(4), #tbl td:nth-child(4),
#tbl th:nth-child(5), #tbl td:nth-child(5) { text-align: center; }
#tbl th:nth-child(8), #tbl td:nth-child(8) { text-align: right; font-variant-numeric: tabular-nums; }

/* Gantt */
/* Zwei-Spalten-Layout: links fixe Label-Spalte, rechts separat scrollbarer Chart.
   Beide Spalten liegen NEBENeinander (kein Überlappen) → kein Durchscheinen/Jitter. */
.gantt-wrap {
  display: flex; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden;
}
.gantt-frozen { flex: none; position: relative; z-index: 2; }
.gantt-scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.gantt-chart  { position: relative; }

.gantt-row { position: relative; height: 26px; box-sizing: border-box; border-bottom: 1px dashed var(--border); }
.gantt-row:last-child { border-bottom: 0; }

/* Ecke oben links über der Label-Spalte (vertikal sticky, damit der Kopf beim Runterscrollen bleibt) */
.gantt-corner {
  height: 44px; box-sizing: border-box;
  position: -webkit-sticky; position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center;
  padding: 0 10px; font-size: 12px; color: var(--muted);
  background: var(--panel);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.gantt-label {
  height: 26px; box-sizing: border-box;
  position: relative; background: var(--panel);
  padding: 0 10px; border-right: 1px solid var(--border); border-bottom: 1px dashed var(--border);
  font-size: 12px;
  display: grid; grid-template-columns: 60px max-content 1fr; gap: 6px; align-items: center;
  overflow: hidden;
}
.gantt-label:last-child { border-bottom: 0; }
.gl-casino  { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-variant {
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  display: inline-flex; align-items: center; gap: 5px;
}
.gl-variant .badge,
.gl-variant .blind-badge { flex: none; }
.blind-badge,
.gl-blinds-chip {
  overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center; height: 18px;
  min-width: calc(5ch + 12px); box-sizing: border-box;
  justify-content: center;
  padding: 0 6px; border-radius: 4px;
  background: rgba(139,148,158,0.12);
  color: #b7c0cc;
  font-size: 11px; font-weight: 600; line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.gl-slot    { color: var(--accent-2); text-align: left; font-variant-numeric: tabular-nums; }
.gantt-axis {
  height: 44px; background: var(--panel); border-bottom: 1px solid var(--border);
  position: -webkit-sticky; position: sticky; top: 0; z-index: 3;
}
.gantt-future {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.025) 0 6px,
    rgba(255,255,255,0.005) 6px 12px
  );
  pointer-events: none;
  z-index: 0;
}
.gantt-now {
  position: absolute; top: 0; bottom: 0;
  border-left: 2px solid var(--open);
  box-shadow: 0 0 8px rgba(46,160,67,0.55);
  pointer-events: none;
  z-index: 4;
}
/* Durchgehende „Jetzt"-Linie über alle Tisch-Zeilen (eine Linie statt Segmente pro Zeile).
   top = Achsenhöhe, damit sie direkt unter dem Header beginnt. */
.gantt-now-line {
  position: absolute; top: 44px; bottom: 0;
  border-left: 2px solid var(--open);
  box-shadow: 0 0 8px rgba(46,160,67,0.55);
  pointer-events: none;
  z-index: 5;
}
.gantt-now-axis {
  z-index: 8;
  overflow: visible;
  /* Im Header keine Linie hinter dem Badge — Badge + Pfeil markieren "jetzt";
     die eigentliche Linie läuft erst darunter in den Tisch-Zeilen weiter. */
  border-left: none;
}
/* "Jetzt"-Pille sitzt mittig ÜBER der Linie und zeigt mit einem Pfeil nach unten darauf */
.gantt-now-label {
  position: absolute;
  top: 2px;
  left: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--open);
  box-shadow: 0 2px 10px rgba(46,160,67,0.55);
  color: #06210f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 20px;
  white-space: nowrap;
}
.gantt-now-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--open);
}
/* nah am rechten/linken Rand: Pille seitlich versetzen, damit sie nicht abgeschnitten wird */
.gantt-now-axis.near-right .gantt-now-label {
  left: auto; right: 3px; transform: none;
}
.gantt-now-axis.near-right .gantt-now-label::after {
  left: auto; right: 6px; transform: none;
}
.gantt-now-axis.near-left .gantt-now-label {
  left: 3px; right: auto; transform: none;
}
.gantt-now-axis.near-left .gantt-now-label::after {
  left: 6px; right: auto; transform: none;
}
.gantt-now-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06210f;
  animation: nowPulse 1.4s infinite;
}
@keyframes nowPulse {
  0%   { box-shadow: 0 0 0 0 rgba(6,33,15,0.55); }
  70%  { box-shadow: 0 0 0 5px rgba(6,33,15,0); }
  100% { box-shadow: 0 0 0 0 rgba(6,33,15,0); }
}
.gantt-tick {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border);
  font-size: 12px; color: var(--text); padding: 25px 0 0 6px; font-weight: 500;
  white-space: nowrap;
  z-index: 3;
}
.gantt-tick.minor {
  color: transparent;
  padding: 0;
  border-left-color: rgba(139,148,158,0.18);
  z-index: 1;
}
.gantt-tick b { color: var(--accent-2); font-weight: 700; margin-right: 3px; }
.gantt-bar {
  position: absolute; top: 4px; bottom: 4px; border-radius: 3px;
  background: var(--bar-color, var(--accent-2)); opacity: 0.86; cursor: default;
  z-index: 2;
}
/* Noch laufende Sessions: grün + pulsierender Punkt am rechten Rand. */
.gantt-bar.active {
  background: var(--bar-color, var(--open)); opacity: 1;
  box-shadow: 0 0 6px color-mix(in srgb, var(--bar-color, var(--open)) 50%, transparent);
}
.gantt-bar.active::after {
  content: ""; position: absolute; right: -4px; top: 50%;
  width: 10px; height: 10px; transform: translateY(-50%);
  border-radius: 50%; background: var(--bar-color, var(--open));
  animation: livePulse 1.6s infinite;
}
.gantt-bar:hover { opacity: 1; outline: 1px solid white; }

/* Heatmap */
.heatmap-scroll { overflow-x: auto; }
.heatmap { display: grid; gap: 2px; position: relative; min-width: 640px; }
.heatmap .cell { aspect-ratio: 1.4 / 1; min-height: 22px; border-radius: 3px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.85); }
/* "Noch keine Daten"-Zellen (Zeitraum liegt in der Zukunft) ausgegraut + diagonal schraffiert */
.heatmap .cell.future {
  background: repeating-linear-gradient(45deg,
    rgba(255,255,255,0.04) 0 4px, rgba(255,255,255,0) 4px 8px);
  border: 1px dashed rgba(255,255,255,0.08);
}
.heatmap .label { color: var(--muted); font-size: 11px; padding: 2px 4px; display: flex; align-items: center; justify-content: center; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; min-width: 380px; max-width: 90vw; max-height: 90vh; overflow: auto;
}
.modal h3 { margin: 0 0 12px; }
.modal .form-row { display: grid; grid-template-columns: 140px 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 18px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.casino-card .badge { font-size: 13px; padding: 3px 9px; border-radius: 5px; font-weight: 600; }
.badge.nlh            { background: #1f3a1f; color: #6cc66c; }
.badge.plo            { background: #3a1f3a; color: #c66cc6; }
.badge.plo5           { background: #3a2f1f; color: #f0b45d; }
.badge.plo6           { background: #3a281f; color: #f08d5d; }
.badge.dealers_choice { background: #332b4f; color: #b79cff; }
.badge.nlh_omaha      { background: #1f3a38; color: #56d4dd; }
.badge.eight_game     { background: #3a2828; color: #ff9b93; }
.badge.mixed_limit    { background: #26364a; color: #8ec5ff; }
.badge.sviten         { background: #263f2a; color: #7ee787; }
.badge.stud           { background: #3a1f2b; color: #e58fb0; }
.badge.other          { background: #1f2f3a; color: #79b8d8; }
.badge.nlh,
.badge.plo,
.badge.plo5,
.badge.plo6,
.badge.dealers_choice,
.badge.eight_game,
.badge.mixed_limit,
.badge.sviten,
.badge.stud,
.badge.other { min-width: calc(4ch + 12px); box-sizing: border-box; }
.badge.nlh_omaha { min-width: 76px; box-sizing: border-box; }
.badge.waiting { background: #3a2f1f; color: #d29922; }

.empty-note { color: var(--muted); text-align: center; padding: 30px; }
.tooltip {
  position: fixed; pointer-events: none; background: #000; color: white;
  padding: 6px 10px; border-radius: 4px; font-size: 12px; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ===== Karten-Seite ===== */
.map-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.map-sub { color: var(--muted); font-size: 14px; }
.map-sub b { color: var(--text); font-weight: 600; }
/* Karten-Umschalter Österreich / Region */
.map-toggle { display: flex; gap: 4px; justify-content: center; margin: 0 0 12px; }
.mt-btn { background: var(--panel, #1b2330); color: var(--muted); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.mt-btn:hover { color: var(--text); }
.mt-btn.active { background: #2a3a52; color: #fff; border-color: #3a5a86; }
/* Länder-Beschriftungen (nur in der Region-Ansicht sichtbar) */
.region-label { display: none; fill: var(--muted); font-size: 29px; font-weight: 800; letter-spacing: 4px; opacity: .22; pointer-events: none; }
.map-wrap.region .region-label { display: block; }
.dot-flag { font-size: 11px; }
/* Karte + Detail-Panel (auf dem PC nebeneinander) */
.map-area { display: flex; gap: 18px; align-items: flex-start; justify-content: center; }
.map-wrap { position: relative; flex: 1 1 auto; max-width: 880px; margin: 0; }
.map-detail {
  flex: 0 0 340px; position: relative;
  display: flex; flex-direction: column; gap: 10px;
}
.map-detail[hidden] { display: none; }
.md-close {
  position: absolute; top: 6px; right: 8px; z-index: 2;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.md-close:hover { background: var(--panel-2); color: var(--text); }
/* damit der ✕-Button nicht auf die Tisch-Anzahl-Anzeige im Karten-Header rutscht */
.map-detail .casino-card header { padding-right: 32px; }
/* gewählte Bubble klar markieren — outline kollidiert nicht mit dem mapPulse-box-shadow */
.map-dot.selected .dot-mark { outline: 2px solid #fff; outline-offset: 2px; }

.map-legend {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin: 12px auto 20px; color: var(--muted); font-size: 12px;
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-active { background: var(--open); }
.lg-waiting { background: var(--waiting); }
.lg-inactive { background: var(--closed); opacity: 0.6; }
.at-map { width: 100%; height: auto; display: block; }
.at-outline {
  fill: rgba(88, 166, 255, 0.05);
  stroke: #44515f; stroke-width: 1.5; stroke-linejoin: round;
}
#mapDots { position: absolute; inset: 0; }
.map-dot { position: absolute; cursor: pointer; }
.dot-mark {
  position: absolute; transform: translate(-50%, -50%);
  border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-variant-numeric: tabular-nums;
}
.dot-name {
  position: absolute; left: 0; top: 0; z-index: 6;
  white-space: nowrap; font-size: 13px;
  color: var(--text); font-weight: 600;
  background: rgba(13, 17, 23, 0.85);
  padding: 3px 8px; border-radius: 6px;
  text-shadow: 0 1px 2px #000;
}
/* feste Label-Positionen relativ zum Punkt */
.dot-name.pos-bottom { transform: translate(-50%, 16px); }
.dot-name.pos-top    { transform: translate(-50%, calc(-100% - 16px)); }
.dot-name.pos-right  { transform: translate(16px, -50%); }
.dot-name.pos-left   { transform: translate(calc(-100% - 16px), -50%); }

.map-dot.active .dot-mark {
  width: 24px; height: 24px; background: var(--open); font-size: 12px;
  z-index: 3; animation: mapPulse 2s infinite;
}
.dot-mark.two-digit { font-size: 10px; letter-spacing: -0.5px; }
.map-dot.waiting .dot-mark {
  width: 19px; height: 19px; background: var(--waiting); font-size: 11px;
  color: #1a1205; z-index: 2;
}
.map-dot.inactive .dot-mark {
  width: 9px; height: 9px; background: var(--closed); opacity: 0.55;
}
.map-dot.inactive .dot-name { color: var(--muted); font-weight: 400; }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  main { padding: 12px; }
  /* Topnav kompakt: nur das ♠-Symbol als Logo, kein Text */
  .topnav { gap: 8px; padding: 8px 12px; }
  .topnav .brand { font-size: 20px; }
  .topnav .brand span { display: none; }
  .topnav .links { gap: 2px; }
  .topnav .links a { padding: 5px 8px; }
  .topnav .links a.nav-live { gap: 5px; }
  .nav-live-dot { width: 7px; height: 7px; }
  .topnav .status { font-size: 10px; line-height: 1.2; }
  /* Sticky-Kopf an das schmalere main-padding anpassen */
  .sticky-top { margin: 0 -12px 12px; padding: 10px 12px; top: 40px; }
  /* Timeline: Label 2-zeilig — Casino-Name voll lesbar oben, Badges/Slot darunter.
     Label- UND Chart-Zeilen auf gleiche Höhe (42px), damit beide Spalten zeilengenau fluchten. */
  .gantt-label, .gantt-row { height: 42px; }
  .gantt-label {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas: "casino casino" "variant slot";
    align-content: center; gap: 1px 5px; padding: 3px 6px;
  }
  .gantt-label .gl-casino  { grid-area: casino; }
  .gantt-label .gl-variant { grid-area: variant; }
  .gantt-label .gl-slot    { grid-area: slot; }
  /* Steuerleiste: 2 Bedienelemente nebeneinander pro Zeile */
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
  .controls.page-controls { margin-top: 10px; }
  .controls > label,
  .controls .ms-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .controls select,
  .controls .ms-button { width: 100%; box-sizing: border-box; }
  .controls > label > #fCasino,
  .controls .ms-button,
  .controls > label > #fGame,
  .controls > label > #fPreset,
  .controls > label > #fRange { min-width: 0; }
  #statsInline { grid-column: 1 / -1; font-size: 11px; }

  /* Live-KPIs: 3 kompakt nebeneinander */
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .kpis .kpi { padding: 8px; }
  .kpis .kpi .value { font-size: 17px; }
  .kpis .kpi .label { font-size: 9px; letter-spacing: 0.2px; }
  .kpis .kpi .sub { display: none; }

  /* Live-Kennzahlen (Hero + Mini) am Handy etwas niedriger */
  .kpis-v3 { gap: 8px; margin-bottom: 14px; }
  .kpi3-hero { padding: 9px 13px; }
  .kpi3-hero-lbl { font-size: 10px; letter-spacing: 0.4px; }
  .kpi3-hero-num { font-size: 32px; margin: 1px 0; }
  .kpi3-hero-sub { font-size: 10px; gap: 6px; }
  .kpi3-mini-col { gap: 8px; }
  .kpi3-mini { flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 11px; }
  .kpi3-mini-num { font-size: 19px; }
  .kpi3-mini-lbl { font-size: 8.5px; letter-spacing: 0.2px; }

  /* Karten-Legende kompakter; Detail-Panel rechts entfällt auf dem Handy */
  .map-area { display: block; }
  .map-detail { display: none; }
  .map-legend { font-size: 10px; gap: 12px; margin: 8px auto 14px; }
  .lg-dot { width: 8px; height: 8px; }

  /* Karte: kleinere Bubbles + Labels, damit sie sich auf schmalem Display nicht überdecken */
  .map-dot.active .dot-mark   { width: 19px; height: 19px; font-size: 11px; }
  .map-dot.waiting .dot-mark  { width: 16px; height: 16px; font-size: 10px; }
  .map-dot.inactive .dot-mark { width: 7px; height: 7px; }
  .dot-mark.two-digit { font-size: 9px; }
  .dot-name { font-size: 9px; padding: 1px 5px; }
  .dot-name.pos-bottom { transform: translate(-50%, 13px); }
  .dot-name.pos-top    { transform: translate(-50%, calc(-100% - 13px)); }
  .dot-name.pos-right  { transform: translate(13px, -50%); }
  .dot-name.pos-left   { transform: translate(calc(-100% - 13px), -50%); }

  /* Panels kompakter */
  .panel { padding: 10px; margin-bottom: 12px; }
  .panel h2 { font-size: 13px; margin-bottom: 8px; }
  .row { gap: 12px; }
  .row3 { margin-bottom: 0; }

  /* Charts etwas flacher auf kleinem Display */
  .chart-box    { height: 230px; }
  .chart-box.sm { height: 240px; }
  .chart-box.lg { height: 270px; }

  /* Tabellen kompakter */
  table.tbl th, table.tbl td { padding: 5px 6px; font-size: 12px; }
  /* Mobil: Tabelle auf min-content geklemmt → horizontal scrollbar statt überstehend */
  .table-scroll table.tbl { width: 1px; }
  table.tbl th { font-size: 10px; }

  /* Korrektur-Dialoge passen auf schmale Screens */
  .modal { min-width: 0; width: 92vw; padding: 14px; }
  .modal .form-row { grid-template-columns: 1fr; gap: 3px; margin-bottom: 8px; }

  /* Casino-Karten + KPI-Kacheln kompakter */
  .kpi { padding: 10px; }
  .kpi .value { font-size: 22px; }
}
