/* --- NEUE CSS-VARIABLEN FÜR EINFACHE FARBWAHL (Glows) --- */
:root {
  --logo-glow-left-color: #e40613; /* für den linken Glow (z.B. Heimteam) */
  --logo-glow-right-color: orangered; /* für den rechten Glow (z.B. Gastteam) */
}
/* ------------------------------------------------ */

html
{
  scrollbar-width: none;
}

*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Banner */
header {
  background-image: url('hintergrund.png');
  background-size: cover;
  background-position: center 60%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

header h1 {
  color: red;
  font-size: 2.5rem;
 -webkit-text-stroke: 2px white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hauptbereich Layout */
main {
  display: flex;
  flex: 1;
  padding: 2rem;
  gap: 2rem;
}

/* Sektionen */
section {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.links {
  flex: 2;
}

.rechts {
  flex: 1;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.08);
  color: black;
}

.rechts h3 {
  margin-bottom: 1rem;
  font-weight: bold;
  border-bottom: 2px solid #e40613;
  padding-bottom: 0.5rem;
}

.rechts p {
  margin-bottom: 0.6rem;
  font-size: 1.4rem; 
}

h2 {
  margin-bottom: 1rem;
  color: #333;
  text-align: center;
}

h3 {
  margin-bottom: 1rem;
  color: #333;
}

/* Tabelle Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.75rem;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: red;
  font-weight: bold;
  color: white;
}

tr:hover {
  background-color: #f5f5f5;
}

/* Teams Spalte */
.team-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* Legende */
.legende {
  margin-top: 1rem;
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
}

.legende span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.blue-cell {
  background-color: #2092f6;
  font-weight: bold;
  text-align: center;
}

.light-blue-cell {
  background-color: #add8e6;
  font-weight: bold;
  text-align: center;
}

.light-red-cell {
  background-color: #ffcdcd;
  font-weight: bold;
  text-align: center;
}

.blue-box, .light-blue-box, .light-red-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 4px;
}

.blue-box { background-color: #2092f6; }
.light-blue-box { background-color: #add8e6; }
.light-red-box { background-color: #ffcdcd; }

/* --- OVERLAY STYLING --- */
#animationOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none; /* Standardmäßig aus, Aktivierung via Klasse */
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Arial Black', sans-serif;
    transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

#animationOverlay.active {
    display: flex;
}

/* Wisch-Animation nach unten aus dem Bildschirm */
#animationOverlay.slide-down {
    transform: translateY(100%);
}

.animation-content {
    text-align: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Logo & Namen Container */
.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
}

/* Team Seiten (Links & Rechts) */
.team-side {
    display: flex;
    align-items: center;
    width: 45%;
    position: relative;
    z-index: 2;
}

.team-side-left {
    justify-content: flex-end;
    text-align: right;
}

.team-side-right {
    justify-content: flex-start;
    text-align: left;
}

/* Namen & Coaches */
.team-name {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.coach-name {
    font-size: 1.2rem;
    color: #bbb;
    margin-top: 5px;
}

.team-side-left .coach-name { margin-right: 0px; }
.team-side-right .coach-name { margin-left: 0px; }

/* Logos */
.logo {
    width: 150px;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logo img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

.logo-left { margin-left: 30px; }
.logo-right { margin-right: 30px; }

/* VS Element */
.score-vs {
    font-size: 3.5rem;
    font-style: italic;
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255,51,51,0.6);
    z-index: 3;
    width: 10%;
    text-align: center;
}

/* GLOW EFFEKTE */
.glow {
    position: absolute;
    top: 50%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    transform: translateY(-50%);
    filter: blur(80px);
    opacity: 0.35;
    z-index: 1;
}

.glow-left {
    left: 10%;
    background-color: var(--logo-glow-left-color);
}

.glow-right {
    right: 10%;
    background-color: var(--logo-glow-right-color);
}

/* Main & Sub Text */
.score-main {
    font-size: 4rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0,0,0,0.7);
    margin-top: 20px;
}

.score-sub {
    font-size: 1.8rem;
    color: #00ffcc;
    letter-spacing: 2px;
    margin-top: 10px;
    text-shadow: 0 2px 5px rgba(0,255,204,0.4);
}

/* Dismiss Info */
.dismiss-info {
    position: absolute;
    bottom: 30px;
    font-size: 1rem;
    color: #666;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* --- FIXIERTER ENDZUSTAND (SCORE-BOARD OBEN) --- */
#animationOverlay.fixed-score {
    position: static;
    height: 90px;
    background: linear-gradient(180deg, #111 0%, #222 100%);
    display: flex;
    border-bottom: 4px solid #ff3333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transform: none;
    padding: 0 40px;
}

.fixed-score .dismiss-info {
    display: none;
}

.fixed-score .animation-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    padding: 0;
}

.fixed-score .logo-container {
    margin-bottom: 0;
    width: 65%;
}

.fixed-score .team-side {
    width: 42%;
}

.fixed-score .team-name {
    font-size: 1.4rem;
}

.fixed-score .coach-name {
    display: none;
}

.fixed-score .logo {
    width: 60px;
    height: 60px;
    border-width: 1.5px;
}

.fixed-score .logo-left { margin-left: 15px; }
.fixed-score .logo-right { margin-right: 15px; }

.fixed-score .score-vs {
    font-size: 1.8rem;
}

.fixed-score .glow {
    width: 120px;
    height: 120px;
    filter: blur(40px);
}

.fixed-score .score-main {
    margin-top: 0;
    font-size: 1.6rem;
    width: 20%;
    text-align: right;
}

.fixed-score .score-sub {
    margin-top: 0;
    font-size: 1.2rem;
    width: 15%;
    text-align: right;
}

.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 15px;
}

.socials a {
  display: inline-block;
  transition: transform 0.2s ease-in-out;
}

.socials a:hover {
  transform: scale(1.1);
}

.socials img {
  display: block;
  height: auto;
}

/* --- OVERLAY FÜR LIGA-ANIMATION (Taste 0) --- */
.league-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.league-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #04F404;
    z-index: -1;
}

.league-content {
    width: 85%;
    max-width: 1200px;
}

.league-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: white;
}

.league-row {
    display: flex;
    align-items: center;
    background: black;
    margin-bottom: 10px;
    padding: 12px 25px;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out, background-color 0.8s ease-in-out;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.league-row.show {
    transform: translateX(0);
    opacity: 1;
}

.league-row.active-highlight {
    background-color: var(--highlight-color) !important;
}

.league-row.run-flash::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    z-index: 5;
    animation: flashThrough 1s ease-in-out forwards;
}

@keyframes flashThrough {
    0% { left: -100%; }
    100% { left: 100%; }
}

.league-row .rank { width: 60px; font-weight: bold; font-size: 1.5rem; }
.league-row .logo-mini { width: 45px; height: 45px; margin: 0 20px; object-fit: contain; }
.league-row .team-name-row { flex-grow: 1; font-size: 1.6rem; font-weight: bold; text-align: left; }
.league-row .stats { font-weight: bold; font-size: 1.4rem; letter-spacing: 1px; }


/* ==========================================================================
   NEUER KADER BEREICH (Sauber gekapselt, löst Layoutverschiebungen auf)
   ========================================================================== */
.kader-wrapper {
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
}

.kader-sektion {
  padding: 1.5rem;
  margin-top: 1rem;
}

.kader-sektion h2 {
  font-size: 1.8rem;
  color: black;
  border-bottom: 2px solid #e40613;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.kader-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.kader-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 1.5rem;
  
  /* --- HIER SIND DIE ÄNDERUNGEN --- */
  flex: 1 1 calc(21% - 1.5rem); /* Erlaubt den Karten zu wachsen und zu schrumpfen */
  max-width: calc(25% - 1.5rem); /* Verhindert, dass Zeilen mit wenigen Teams (z.B. die letzte Zeile) riesig werden */
  /* -------------------------------- */
  
  min-width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 4px solid #e40613;
  color: black;
}

.kader-card.caster-card {
  flex: 0 1 300px; 
  max-width: 100%;
  border-top: 4px solid #00ffcc; /* Cyan-Farbton für den Caster */
  margin-top: 15px; 
}

.kader-logo-wrap {
  width: 90px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.kader-team-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.kader-teamname {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
  color: #333;
}

.kader-mains, .kader-coach, .kader-subs {
  width: 100%;
  margin-bottom: 12px;
}

.kader-subs {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px dashed #ccc;
}

.kader-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #666;
  font-weight: bold;
  margin-bottom: 4px;
}

.kader-player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  margin-bottom: 4px;
}

.kader-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.spielplan-wrapper {
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
  margin-top: 2rem;
}

.spielplan-sektion {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spielplan-sektion h2 {
  font-size: 1.8rem;
  color: black;
  border-bottom: 2px solid #e40613;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.spielplan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.matchday-box {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.matchday-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  background-color: #e40613;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  text-align: center;
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
  color: #333;
}

.match-row:last-child {
  border-bottom: none;
}

.match-time {
  font-size: 0.8rem;
  color: #666;
  font-weight: bold;
  width: 45px;
}

.team-home {
  text-align: right;
  flex: 1;
  padding-right: 8px;
  font-weight: 500;
}

.match-vs {
  font-weight: bold;
  color: #ff3333;
  font-style: italic;
  font-size: 0.85rem;
  width: 25px;
  text-align: center;
}

.team-away {
  text-align: left;
  flex: 1;
  padding-left: 8px;
  font-weight: 500;
}

/* ==========================================================================
   NEUER MAP BEREICH (Einfach zu bearbeiten & Flexibel)
   ========================================================================== */
.maps-wrapper {
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
  margin-top: 2rem;
}

.maps-sektion {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.maps-sektion h2 {
  font-size: 1.8rem;
  color: black;
  border-bottom: 2px solid #e40613;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Flexibles Grid für die Map-Karten */
.maps-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

/* Einzelne Map-Karte */
.map-card {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  flex: 1 1 calc(25% - 1.5rem); /* Passt sich automatisch der Zeile an */
  max-width: 280px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 4px solid #e40613; /* Roter Akzent wie beim Spielplan */
}

/* Bild-Container für saubere Abmessungen */
.map-image-wrap {
  width: 100%;
  height: 120px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 10px;
  background-color: #eee;
}

.map-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Schneidet das Bild perfekt zu, ohne es zu verzerren */
}

/* Map-Name */
.map-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-top: 5px;
}

/* Kleinerer Zusatztext */
.map-subtext {
  font-size: 0.85rem;
  color: #666;
  margin-top: 6px;
  text-align: center;
  background-color: #f0f0f0;
  padding: 2px 8px;
  border-radius: 4px;
}

/* MAGIE: Versteckt den Zusatztext-Kasten komplett, wenn er leer ist! */
.map-subtext:empty {
  display: none;
}