/* === Grundlayout === */
body {
  background-color: #0D1117;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* === Header === */
.header {
  text-align: center;
  font-size: xx-large;
  color: red;
  margin-top: 1em;
}

/* === Hauptinhalt === */
.content {
  text-align: center;
  font-size: x-large;
  padding: 1em;
}

/* === Container: Chart + Stats nebeneinander === */
.middle {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3em;
  margin: 2em auto;
  width: 95%;
  max-width: 1800px;
}

/* === Chart-Bereich === */
.chart-container {
  flex: 0 0 38%;
  min-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-container canvas {
  width: 100%;
  height: auto;
  background-color: #0d1117;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.15);
}

/* === Stats-Bereich === */
.stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Überschrift === */
.stats h2 {
  text-align: center;
  font-size: 1.4em;
  margin: 1em 0 0.5em 0;
  color: #fff;
  font-weight: bold;
}

/* === Inputfeld für Spielernamen === */
.stats input {
  width: 80%;
  max-width: 400px;
  margin: 0 auto 1em auto;
  display: block;
  padding: 10px;
  border: 2px solid #ad0d0d;
  border-radius: 10px;
  font-size: 16px;
  color: #ffffff;
  background-color: #13181f;
  transition: all 0.3s ease;
}

.stats input::placeholder {
  color: #aaa;
}

.stats input:focus {
  border-color: #b65959;
  background-color: #303842;
  box-shadow: 0 0 5px rgba(182, 89, 89, 0.5);
  outline: none;
}

.stats input:hover {
  border-color: #c48787;
  background-color: #1a2028;
}

/* === Masonry Layout für Tabellen === */
#statsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5em;
  margin-top: 1.5em;
  width: 100%;
  max-width: 1200px;
  transition: opacity 0.3s ease;
  opacity: 1;
}

#statsContainer table {
  width: 100%;
  background-color: #1a1f27;
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeIn 0.4s ease;
}

#statsContainer table:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(182, 89, 89, 0.4);
}


/* Tabellenkopf */
#statsContainer th {
  background-color: #b65959;
  color: #fff;
  text-transform: capitalize;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  line-height: 1.2;
}

/* Tabelleninhalt */
#statsContainer td {
  padding: 6px 10px;
  text-align: left;
}

#statsContainer tr:nth-child(even) {
  background-color: #202630;
}

#statsContainer tr:hover {
  background-color: #2b3340;
}

/* Leere Tabellen leicht ausgegraut */
#statsContainer table:has(tr:nth-child(1):last-child) {
  opacity: 0.6;
}

/* === "Overall Stats" Tabelle === */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  font-size: 16px;
  background-color: #13181f;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  max-width: 700px;
  align-self: flex-start;
}

.stats-table th,
.stats-table td {
  padding: 12px 16px;
  text-align: left;
}

.stats-table thead {
  background-color: #ad0d0d;
}

.stats-table tr:nth-child(even) {
  background-color: #1e232b;
}

.stats-table tr:hover {
  background-color: #252b35;
  transition: background-color 0.2s ease;
}

/* === Animationen === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive Anpassungen === */
@media (max-width: 1600px) {
  #statsContainer {
    column-count: 2;
  }
}

@media (max-width: 1000px) {
  .middle {
    flex-direction: column;
    align-items: center;
  }

  .chart-container {
    width: 90%;
  }

  #statsContainer {
    column-count: 1;
  }

  .stats-table {
    align-self: center;
  }
}
