@font-face {
  font-family: 'Quicks';
  src: url('../fonts/Quicks.woff2') format('woff2'),
       url('../fonts/Quicks.woff') format('woff'),
       url('../fonts/Quicks.ttf') format('ttf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body, .league-table, .schedule-table, .upcoming-games-container {
  font-family: 'Quicks', 'Segoe UI', Arial, sans-serif;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #ffffff;
  margin: 0;
  padding: 0;
}

.header {
  background: #555;
  color: #fff;
  text-align: center;
  font-size: 20px;
  padding: 0.4rem 0 0.4rem 0;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 6px 6px 0 0;
}

.table-container, .schedule-container {
  max-width: 800px;
  margin: 0 auto 0.2rem auto;
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* Roter Scrollbalken für den Spielplan */
.schedule-container {
  scrollbar-color: #cd2324 #f0f0f0;
  scrollbar-width: thin;
}
.schedule-container::-webkit-scrollbar {
  height: 8px;
  background: #f0f0f0;
}
.schedule-container::-webkit-scrollbar-thumb {
  background: #cd2324;
  border-radius: 4px;
}

.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.league-table th, .league-table td,
.schedule-table th, .schedule-table td {
  font-size: 14px;
  line-height: 1.7;
}

.league-table th {
  background: #555;
  color: #fff;
  font-weight: 500;
  border: none;
}

.league-table tr {
  background: #fafbfc;
}

.league-table tr:nth-child(even) {
  background: #f0f0f0;
}

.league-table .highlight {
  background: #cd2324 !important;
  color: #fff;
  font-weight: 600;
}

.league-table td.team, .schedule-table td.team {
  text-align: left;
}

.league-table td.centered {
  text-align: center;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.schedule-table tr {
  background: #fafbfc;
}

.schedule-table tr:nth-child(even) {
  background: #f0f0f0;
}

.schedule-table .highlight {
  color: #cd2324;
  font-weight: 600;
}

.team-link {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.team-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.team-link.hve-team {
  color: #cd2324;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.team-link.hve-team:hover {
  color: #555555;
  text-decoration: underline;
}

/* Team logo styles */
.team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 2px;
  display: inline-block;
}

.team-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Halle-Button */
.halle-btn,
.halle-btn-mobile {
  background: #555555;
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.halle-btn:hover {
  background: #cd2324;
}

/* Popup styles */
.halle-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

.popup-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.popup-body {
  padding: 20px;
}

.address {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 1rem;
}

.maps-btn {
  display: inline-block;
  background: #555555;
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.maps-btn:hover {
  background: #cd2324;
}

/* Nächste Spiele */
.upcoming-games-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.upcoming-games-container h2 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 1.8rem;
}

/* New tabular layout styles */
.date-section {
  text-align: center;
  position: relative;
  margin-bottom: 0.5em;
}
.date-header {
  display: inline-block;
  position: relative;
  padding: 0 1em;
  background: #fff;
  z-index: 1;
  color: #555555;
}
        .date-divider {
          border: none;
          border-top: 2px solid #cd2324;
          height: 0;
          width: 90%;
          position: absolute;
          left: 5%;
          top: 1.2em;
          z-index: 0;
        }
.date-line { display: none; }

.games-section {
  padding: 0rem 0.5rem;
}

.games-section:not(:last-child) {
  border-bottom: 1px solid #eee;
}

/* Kompaktere Zeilen und Überschriften */
.section-title {
  text-align: left;
  padding-left: 8px;
  max-width: 320px;
  margin-left: 0;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  color: #555555;
  font-size: 14px;
  font-weight: 400;
}
@media (max-width: 600px) {
  .section-title {
    max-width: none;
    padding-left: 0;
    text-align: center;
  }
}

/* Tabellarisches Layout für nächste Spiele */
.game-row {
  display: grid;
  grid-template-columns: 90px 80px 1fr 60px;
  gap: 0.7rem;
  align-items: center;
  padding: 0.3rem 0 0.3rem 8px;
  border-bottom: 1px solid #f0f0f0;
  min-width: 0;
  width: 100%;
}
.game-row:last-child {
  border-bottom: none;
}
.game-liga {
  font-size: 14px;
  color: #555555;
  font-weight: 600;
  min-width: 80px;
  word-break: break-word;
  text-align: left;
}
.game-time {
  color: #555555;
  font-weight: 400;
  font-size: 14px;
  min-width: 70px;
  text-align: center;
}
.game-liga a {
  color: #555555;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.game-liga a:hover {
  opacity: 0.8;
  text-decoration: underline;
  color: #cd2324;
}
.game-teams {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  color: black;
}
.game-halle {
  font-size: 0.98rem;
  color: #cd2324;
  text-align: right;
  font-weight: 500;
  min-width: 60px;
}
@media (max-width: 600px) {
  .upcoming-games-container, .date-section {
    max-width: 100vw;
    padding: 0 0.1rem;
  }
  .game-row {
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 0.5rem;
  }
  .game-liga, .game-halle {
    font-size: 0.9rem;
  }
  .game-teams {
    font-size: 1rem;
  }
}

.halle-link {
  color: #cd2324;
  text-decoration: none;
  border-bottom: 1px dotted #cd2324;
  transition: border-bottom 0.2s, opacity 0.2s;
}
.halle-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Responsive design for mobile */
@media (max-width: 600px) {
  .game-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }

  .game-time {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .game-liga {
    font-size: 0.8rem;
  }

  .game-teams {
    font-size: 1.1rem;
  }

  .game-halle {
    text-align: center;
  }
}

.no-games {
  text-align: center;
  color: #666;
  font-style: italic;
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  .header {
    font-size: 1.1rem;
    padding: 0.7rem 0 0.5rem 0;
  }
  .table-container, .schedule-container {
    max-width: 100vw;
    border-radius: 0;
  }
  .league-table, .schedule-table {
    font-size: 0.95rem;
  }
}

.schedule-table td.halle {
  text-align: center;
  vertical-align: middle;
}

.schedule-table td.team {
  text-align: center !important;
  vertical-align: middle;
}

.schedule-table td.team img.team-logo {
  vertical-align: middle;
  display: inline-block;
}

.schedule-table td:nth-child(3) {
  text-align: center !important;
  vertical-align: middle;
}

.teams-flex {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.teams-flex .dash {
  text-align: center;
  font-weight: 500;
  font-size: 1.2em;
  color: #222;
  justify-self: center;
}
.teams-flex .heim {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.teams-flex .gast {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.teams-flex .heim img.team-logo {
  margin-left: 8px;
  margin-right: 0;
}

.schedule-table th:first-child {
  text-align: center;
}

.schedule-table td:first-child {
  text-align: center;
}

.schedule-table td .date {
  margin-right: 6px;
}
.schedule-table td .weekday {
  margin-right: 6px;
  color: #888;
  min-width: 35px;
  display: inline-block;
  text-align: center;
}
.schedule-table td .time {
  letter-spacing: 0.5px;
}

/* Mobile optimizations for schedule */
@media (max-width: 600px) {
  .schedule-container {
    max-width: 100%;
    margin: 0 10px 2rem 10px;
  }

  .schedule-table {
    display: none; /* Hide table on mobile */
  }

  /* Mobile cards layout */
  .schedule-mobile {
    display: block !important;
  }

  .game-card,
  .upcoming-games-container .game-row {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    padding: 16px;
    border-left: 4px solid #cd2324;
  }

  .game-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
  }

  .game-teams-mobile {
    text-align: center;
    margin: 12px 0;
  }

  .team-home, .team-away {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    font-size: 16px;
    font-weight: 500;
  }

  .team-home img.team-logo, .team-away img.team-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
  }

  .game-vs {
    font-size: 14px;
    color: #888;
    margin: 8px 0;
    font-weight: 500;
  }

  .game-result {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 8px 0;
  }

  .game-halle-mobile {
    text-align: center;
    margin-top: 12px;
  }

}

/* Hide mobile layout on desktop by default */
.schedule-mobile {
  display: none;
}

.team-link.highlight {
  color: #cd2324 !important;
  font-weight: 600;
}
.team-link.highlight:hover {
  color: #555 !important;
  opacity: 1 !important;
}

.last-modified-info {
  text-align: left;
  margin: 0.4em auto 0.1em auto !important;
  max-width: 800px;
  color: #888;
  font-size: 0.65em !important;
}

.upcoming-games-container + .last-modified-info {
  text-align: center !important;
}

@media (max-width: 600px) {
  .last-modified-info {
    text-align: center !important;
  }
  .game-time,
  .game-liga,
  .game-halle {
    text-align: center !important;
  }
  .game-time {
    font-size: 1.1rem;
    font-weight: 500;
  }
    .game-liga {
      font-size: 1.1rem;
      font-weight: 700;
  }
  .game-teams {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  .date-header,
  .section-title {
    text-align: center !important;
  }
}

.schedule-container,
.schedule-table,
.table-container {
  scrollbar-color: #cd2324 #f0f0f0;
  scrollbar-width: thin;
}
.schedule-container::-webkit-scrollbar,
.schedule-table::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
  height: 8px;
  background: #f0f0f0;
}
.schedule-container::-webkit-scrollbar-thumb,
.schedule-table::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
  background: #cd2324;
  border-radius: 4px;
}

.game-liga-und-zeit {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #555555;
  margin-bottom: 0.2em;
}
.dot-sep {
  color: #cd2324;
  margin: 0 0.5em;
  font-weight: bold;
}

/* Standard: Mobile-Zeile ausblenden, Desktop-Zeilen anzeigen */
.game-liga-und-zeit { display: none; }
.game-time, .game-liga { display: block; }

@media (max-width: 600px) {
  .game-liga-und-zeit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    font-size: 1.05rem;
    font-weight: 600;
    color: #555555;
    margin-bottom: 0.05em;
    position: relative;
  }
  .game-liga-und-zeit a {
    color: #555555 !important;
    text-decoration: none;
    font-weight: 600;
  }
  .game-liga-und-zeit a:hover {
    color: #cd2324 !important;
    text-decoration: underline;
  }
  .dot-sep {
    color: #555555;
    font-weight: bold;
    font-size: 1.3em;
    line-height: 1;
    display: inline-block;
    position: relative;
    top: 0.08em;
  }
  .teams-flex {
    justify-content: center;
    gap: 6px;
  }
  .dash {
    display: inline-block;
    min-width: 1.2em;
    text-align: center;
  }
  .game-time, .game-liga { display: none; }
  .schedule-container {
    max-width: 100%;
    margin: 0 10px 2rem 10px;
  }
  .schedule-table {
    display: none; /* Hide table on mobile */
  }
  .schedule-mobile {
    display: block !important;
  }
  .game-card,
  .upcoming-games-container .game-row {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    padding: 16px;
    border-left: 4px solid #cd2324;
  }
  .game-date {
    font-size: 16px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    text-align: center;
  }
  .game-teams-mobile {
    text-align: center;
    margin: 12px 0;
  }
  .team-home, .team-away {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #555 !important;
  }
  .team-home img.team-logo, .team-away img.team-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px; 
  }
  .game-vs {
    font-size: 14px;
    color: #888;
    margin: 8px 0;
    font-weight: 500;
  }
  .game-result {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    margin: 8px 0;
  }
  .game-halle-mobile {
    text-align: center;
    margin-top: 12px;
  }
  .header {
    font-size: 1.1rem;
    padding: 0.7rem 0 0.5rem 0;
  }
  .table-container, .schedule-container {
    max-width: 100vw;
    border-radius: 0;
  }
  .league-table, .schedule-table {
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .game-card-group {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 18px;
    padding: 10px 0 6px 0;
    border-left: 4px solid #cd2324;
  }
  .game-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cd2324;
    text-align: center;
    margin-bottom: 8px;
    margin-top: 2px;
  }
  .game-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2px;
  }
  .game-mobile-block {
    background: #f8f8f8;
    border-radius: 6px;
    padding: 10px 8px 8px 8px;
    margin: 0 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .game-mobile-heim {
    margin-top: 8px;
  }
  .game-mobile-gast {
    margin-bottom: 8px;
  }
  .game-liga-und-zeit {
    font-size: 0.98rem;
    color: #555;
    text-align: center;
    margin-bottom: 4px;
    font-weight: 500;
  }
  .game-teams-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .game-halle-mobile {
    text-align: center;
    margin-top: 2px;
  }
}
@media (min-width: 601px) {
  .desktop-only { display: block !important; }
  .mobile-only { display: none !important; }
}

@media (max-width: 600px) {
  .game-teams-mobile-3lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0;
    gap: 0.2em;
  }
  .game-mobile-heim {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
    gap: 8px;
  }
  .game-mobile-heim .team-logo {
    margin-left: 8px;
    margin-right: 0;
  }
  .game-mobile-vs {
    font-size: 14px;
    color: #888;
    font-weight: 500;
    margin: 2px 0;
    text-align: center;
  }
  .game-mobile-gast {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
    gap: 8px;
  }
  .game-mobile-gast .team-logo {
    margin-right: 8px;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .date-header {
    font-size: 1.2rem !important;
    color: #cd2324 !important;
    font-weight: 700 !important;
    margin-bottom: 0.2em;
  }
  .section-title, .game-section-title {
    font-size: 14px !important;
    color: #555555 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem;
    margin-top: 0.4rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .dot-sep {
    display: inline-block;
    font-size: 1.3em;
    vertical-align: middle;
    line-height: 1;
    margin: 0 0.18em 0 0.18em;
    position: static;
  }
}

@media (max-width: 600px) {
  .game-mobile-heim img.team-logo {
    margin-left: 8px;
    margin-right: 0;
  }
  .game-mobile-gast img.team-logo {
    margin-right: 8px;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  /* Nur für Spielpläne, nicht für nächste Spiele! */
  .schedule-mobile .game-card .game-date .date-part,
  .schedule-mobile .game-card .game-date .time-part {
    color: #cd2324;
    font-weight: 600;
  }
  .schedule-mobile .game-card .game-date .weekday-part {
    color: #888;
    font-weight: normal;
  }
}

/* Datum in naechste.html (nächste Spiele) rot */
body.naechste .game-date .date-part,
body.naechste .game-date .weekday-part {
  color: #cd2324;
  font-weight: bold;
}

body.naechste .game-date .weekday-comma {
  color: #cd2324;
  font-weight: bold;
}

@media (max-width: 600px) {
  .schedule-mobile .game-teams-mobile-3lines .team-link.highlight,
  .schedule-mobile .game-teams-mobile-3lines .highlight {
    color: #cd2324 !important;
    font-weight: 600;
  }
}

/* Verstecke die Differenz-Spalte (5. Spalte) in der mobilen Ansicht der Tabellen */
@media (max-width: 600px) {
  .league-table td:nth-child(5),
  .league-table th:nth-child(5) {
    display: none;
  }
  
  /* Verstecke "/ Gesamt" in der Spiele-Spalte (3. Spalte) */
  .league-table td:nth-child(3)::after {
    content: attr(data-spiele-only);
  }
  .league-table td:nth-child(3) {
    font-size: 0;
  }
  .league-table td:nth-child(3)::after {
    font-size: 0.85rem; /* Gleiche Größe wie die Standard-Tabellenschriftgröße */
  }
}

@media (max-width: 600px) {
  /* Spalte 1 (Position) in der Tabelle: mehr Abstand */
  .league-table td:nth-child(1) {
    padding-left: 1px;
    padding-right: 3px;
  }
  
  /* Spalte 4 (TorePlus : ToreMinus) in der Tabelle: mehr Abstand und helleres Grau */
  .league-table td:nth-child(4) {
    padding-left: 5px;
    padding-right: 5px;
    color: #888888;
    font-weight: 500;
  }
  
  /* Letzte Spalte (Punkte) in der Tabelle: mehr Abstand rechts */
  .league-table td:last-child {
    padding-right: 3px;
  }
}

@media (max-width: 600px) {
  .header {
    line-height: 1.2;
    padding: 0.5em 0 0.3em 0;
  }
  .header .saison-header {
    font-weight: 400;
    font-size: 0.95em;
    color: #888;
    display: block;
    margin-top: 2px;
  }
}
