:root {
  --bg-body: #050816;
  --bg-card: #001F18;      /* Grundfarbe der gesamten Tabelle */
  --bg-header: #01130F;
  --bg-row-alt: #001913;
  --border-subtle: #064E3B;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
}

/* ===========================
   GLOBAL LAYOUT
=========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #020617 0, #020617 50%, #000 100%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.wrapper {
  width: 100%;
}

/* Card – Rahmen um Tabelle */

.card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.65);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.5);
  padding: 1.6rem 1.6rem 1.1rem;
  width: fit-content;
  margin: 0 auto;
}

/* Header oben */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.1rem;
  gap: 1rem;

  /* NEU: Breite an Tabellenbreite koppeln */
  max-width: 1150px;   /* gleiche Breite wie table */
  margin-left: auto;
  margin-right: auto;
}


.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, #38bdf8 0, #0ea5e9 40%, #0369a1 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tabellen-Container */

.table-container {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 31, 24, 0.98);
  overflow: hidden;
  width: fit-content;
  margin: 0 auto;
}

.table-scroll {
  max-height: 85vh;
  overflow-x: auto;
  overflow-y: auto;
}

/* Footer */

.table-footer {
  padding: 0.55rem 0.9rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #001612;
  gap: 1rem;
}

.badge {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

/* Footer-Link nach außen */
.footer-link {
  color: #6ee7b7;
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(110, 231, 183, 0.25);
  transition: 0.25s ease;
}

.footer-link:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(110, 231, 183, 0.7);
  color: #a7f3d0;
}


/* Scrollbar (WebKit) */

.table-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-scroll::-webkit-scrollbar-track {
  background: #000f0b;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #064E3B;
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #16a34a;
}

/* ===========================
   HISTORY-NAVIGATION / DROPDOWN
=========================== */

.card-header-controls button {
  background: #01271e;  
  border: 1px solid #065f47;
  color: #e5e7eb;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.card-header-controls button:hover:not(:disabled) {
  background: #033b2d;
  border-color: #1ea67a;
  transform: translateY(-1px);
}

.card-header-controls button:active:not(:disabled) {
  transform: translateY(1px);
}

.card-header-controls button:disabled {
  background: #001711;
  border-color: #033126;
  color: #355e52;
  cursor: default;
  transform: none;
}

#history-select {
  background: #01271e;
  border: 1px solid #065f47;
  color: #e5e7eb;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

#history-select:hover {
  background: #033b2d;
  border-color: #1ea67a;
}

#history-select:focus {
  background: #033b2d;
  border-color: #32d8a5;
}

#history-select::-ms-expand {
  display: none;
}

/* ===========================
   MATCHLIST – Zeitraum-Dropdown
=========================== */

.matchlist-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  background: radial-gradient(circle at left, #02241b 0, #00130d 55%, #00140f 100%);
  border: 1px solid rgba(6, 95, 71, 0.8);
  box-shadow:
    0 0 10px rgba(0, 0, 0, 0.7),
    0 0 16px rgba(34, 197, 94, 0.18);
}

/* Label + grünes Kalender-Icon */
.matchlist-filters label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  padding-left: 1.4rem; /* Platz für das Icon links */
}

/* Grünes Flat-Design SVG Kalender Icon (inline, korrekt encodiert) */
.matchlist-filters label::before {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;

  /* SVG als Data-URI, # → %23 encodiert */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* Wrapper um das Select – für Custom-Pfeil */
.matchlist-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Das eigentliche Select im Pill-Style */
#date-range-select {
  background: #001b13;
  border: 1px solid #065f47;
  width: auto;
  color: #e5e7eb;
  padding: 0.25rem 2.1rem 0.25rem 0.8rem; /* rechts Platz für Pfeil */
  border-radius: 999px;
  font-size: 0.7rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

/* Custom-Pfeil, sauber zentriert */
.matchlist-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  pointer-events: none;
  color: #6ee7b7;
  opacity: 0.9;
}

/* Hover / Focus */
#date-range-select:hover {
  background: #02251b;
  border-color: #1ea67a;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

#date-range-select:focus-visible {
  border-color: #32d8a5;
  box-shadow: 0 0 0 1px rgba(50, 216, 165, 0.5);
}

/* alten Edge/IE-Pfeil verstecken */
#date-range-select::-ms-expand {
  display: none;
}



/* ===========================
   RESPONSIVE
=========================== */

.main-logo {
  height: 80px;
  width: auto;
  margin-right: 0.1rem;
  margin-left: auto;
  filter: drop-shadow(0 0 14px rgba(0, 0, 0, 0.6));
}

@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
    align-items: flex-start;
  }

  .card {
    width: 100%;
    max-width: 100%;
    padding: 1.1rem 0.9rem 0.9rem;
  }

  .card-header {
    flex-direction: column;
    max-width: 100%;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-header-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .card-header-controls button {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }

  #history-select {
    font-size: 0.75rem;
    margin-left: 0.4rem;
    flex-shrink: 0;
  }

  .table-container {
    width: 100%;
    max-width: 100%;
  }

  .table-scroll {
    max-height: 70vh;
    overflow-x: auto;
    overflow-y: auto;
  }

  table {
    width: 100%;
    min-width: 600px;
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 0.45rem 0.5rem;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.75rem;
  }

  .main-logo {
    display: none;
    height: 44px;
    margin-bottom: 0.5rem;
  }

  .card-header {
    flex-direction: column;
    align-items: center;
  }
  .matchlist-filters {
    padding: 0.15rem 0.6rem;
  }

  #date-range-select {
    font-size: 0.75rem;
    padding: 0.2rem 1.8rem 0.2rem 0.7rem;
  }

  .matchlist-filters label {
    font-size: 0.72rem;
  }
}


/* Link oben rechts: MatchList */

.nav-link,
.nav-link:visited {
  display: inline-flex;
  align-items: center;
  width: auto;
  justify-content: center;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #065f47;
  background: #01271e;
  color: #e5e7eb;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.nav-link:hover {
  background: #033b2d;
  border-color: #1ea67a;
  color: #e5e7eb;
  transform: translateY(-1px);
}

.nav-link:active {
  transform: translateY(1px);
}

.nav-link:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}
