html, body {
  height: 100%;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: #f0f2f5; 
}

main {
  flex: 1; 
}

/* --- NEUER HEADER STYLE (Schmal & Modern) --- */
.main-header {
  background: linear-gradient(90deg, #1e1e1e 0%, #3a3a3a 100%);
  color: #fff;
  height: 40px; /* NOCH SCHMALER wie gewünscht */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
}

.header-nav a {
  color: #bbb;
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: #fff;
}

.header-right {
  font-size: 0.8rem;
  color: #4caf50; /* Akzentfarbe für Turniername */
  font-weight: 600;
}

footer {
  background-color: #333;
  color: #888;
  padding: 5px;
  text-align: center;
  font-size: 0.8em;
}

/* Container für Bereiche */
.container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.column.group-table {
  flex: 0 1 20%;
  border-right: 1px solid #ddd;
  background: #fff;
}

.column.game-area {
  flex: 0 1 40%;
  background: #f9f9f9;
}

/* Mittlere Rechte Spalte (Spielplan) - ABSOLUTE FIX */
.column.match-schedule-area {
  flex: 0 1 20%;
  display: flex; 
  flex-direction: column;
  position: relative; 
  overflow: hidden;
  background: #fff;
  border-left: 1px solid #ddd;
}

/* Header im Spielplan fixieren */
.column.match-schedule-area > h3 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
  background-color: #fff; 
  border-bottom: 1px solid #eee;
  z-index: 10;
  font-size: 1em;
  color: #333;
}

#persistentScheduleScroll {
  position: absolute;
  top: 40px;    
  bottom: 0;    
  left: 0;
  right: 0;
  overflow-y: auto; 
  padding: 5px;
  flex: auto;
  height: auto;
  max-height: none;
  background-color: #fcfcfc;
}

/* T20 Tabelle - Sicherstellen, dass sie nicht "gequetscht" wird */
.column.t20-table {
  flex: 0 0 15%; /* Feste Breite */
  background: #fff;
  border-left: 1px solid #ddd;
  overflow-y: auto;
  max-height: 80vh;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
  background: #ccc; 
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #999; 
}


/* Button Wrapper & Container */
.button-wrapper{
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.tournament-container {
  gap: 20px; 
}

.centered {
  margin: 20px auto;
  max-width: 800px;
  text-align: center;
}

.einfach-nur-margin {
  margin: 20px auto;
}

.column {
  margin: 0;
}

/* Buttons */
.button {
  background-color: #007BFF;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
}
.button:hover { background-color: #0056b3; }

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.score-button, .toggle-button, .button {
  min-width: 50px;
  min-height: 50px;
  font-size: 1.2em;
}

#scoreButtons .score-button {
  width: 60px;
  height: 60px;
  font-weight: bold;
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
}
#scoreButtons .score-button:hover {
    background: #eef;
}

.busted { color: red; }

.currentplayer {
  color: #0061b1;
  font-size: 1.7em; 
  line-height: 1;
}

.bold { font-weight: bold; }

.toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f2f2f2;
  border: 2px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-button.active {
  background-color: #007bff; 
  border-color: #0056b3;     
  color: #fff;               
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}

/* --- Dashboard Styles --- */
.dashboard-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  min-width: 200px;
  flex: 1;
  border: 1px solid #eee;
}

.highlight-card h3 {
  margin-top: 0;
  color: #666;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 3rem;
  font-weight: bold;
  color: #007bff;
  margin: 10px 0;
}

.stat-player {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

.dashboard-table th, .dashboard-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.dashboard-table th {
  background-color: #f8f9fa;
  color: #333;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover { background-color: #f1f1f1; }

.player-name-clickable {
  cursor: pointer;
  border-bottom: none !important; 
  text-decoration: none; 
}
.player-name-clickable:hover {
  background-color: #f0f0f0;
  border-radius: 4px;
}

/* --- ADAPTIVE HÖHE FIX --- */
/* Gruppentabelle (Links) */
#persistentGroupTableScroll {
  overflow-y: auto;
  max-height: 80vh; 
  padding-right: 5px;
}