/* ==========================================
   MODERN DARK THEME FOR SEVILLA CHESS EXPORT
   Schachclub Füssen - Version 1.1
   ========================================== */

/* Globale Basis & Typografie - erzwingt den Dark Mode */
html, body {
    background-color: #111827 !important; /* Slate-900 */
    color: #f3f4f6 !important; /* Gray-100 */
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    padding: 2rem 1rem;
    margin: 0;
}

/* Container für das gesamte Layout */
body > center, body > div {
    max-width: 1100px;
    margin: 0 auto !important;
    text-align: left !important;
    background-color: #1f2937; /* Gray-800 */
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ====== VEREINSLOGO OBEN EINBAUEN ====== */
/* Nutzt den ersten Kind-Container, damit das Logo sauber INSIDERHALB der Box landet */
body > center:first-of-type::before, 
body > div:first-of-type::before {
    content: "";
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem auto;
    background-image: url('logo.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    /* TRICK: Macht das schwarze Logo komplett weiß */
    filter: invert(1) brightness(2) drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* ====== FARBEN ERZWINGEN (DAS GOLD) ====== */
/* Überschreibt Sevilla-Texte mit dem warmen Gold */
h1, h2, h3, h4, font[size="5"], font[size="4"], .title {
    color: #fbbf24 !important; /* Warmes Gold / Amber-400 */
    font-weight: 700 !important;
}

/* Links und Menüführung oben pimpen */
a, font color, p a {
    color: #60a5fa !important; /* Modernes Blau */
    text-decoration: none !important;
    font-weight: 500;
}

a:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Listenpunkte oben links (Menüführung) unauffälliger machen */
li {
    color: #9ca3af !important;
}

/* ====== TABELLEN-STYLING ====== */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

/* Tabellenköpfe (Pl., Name, Sp., S, R, N, Pkte...) */
th, tr[style*="background-color"] td, tr:first-child td {
    background-color: #374151 !important; /* Gray-700 */
    color: #fbbf24 !important; /* Spaltenüberschriften in Gold */
    font-weight: 600 !important;
    padding: 0.75rem 1rem !important;
    border-bottom: 2px solid #4b5563 !important;
}

/* Normale Datenzellen (Spielerzeilen) */
td {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #374151 !important;
    background-color: #1f2937 !important; /* Verhindert das Sevilla-Weiß */
    color: #e5e7eb !important; /* Erzwingt helle Schrift */
}

/* Textfarbe in den Zellen für Links (Spielernamen) weiß machen */
td a {
    color: #ffffff !important;
}

/* Zebra-Effekt für die Tabellenzeilen */
tr:nth-child(even) td {
    background-color: #1a2232 !important; /* Etwas dunkleres Anthrazit für jede zweite Zeile */
}

/* Hover-Effekt für Zeilen */
tr:hover td {
    background-color: #2d3748 !important;
}

/* =========================================================
   MOBILE ONLY (Nur für Bildschirme bis 768px Breite)
   ========================================================= */
@media screen and (max-width: 768px) {
  
  /* 1. Äußerer Abstand auf dem Smartphone reduzieren */
  html, body {
    padding: 0.5rem !important;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* 2. Container nutzen die volle Breite & einheitliche Abstände */
  body > center, body > div {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
  }

  /* 3. Tabellen bleiben in der Box wischbar, ohne den Container aufzublähen */
  table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  /* 4. Verringert das riesige Logo auf dem Smartphone etwas */
  body > center:first-of-type::before, 
  body > div:first-of-type::before {
    width: 120px !important;
    height: 120px !important;
    margin-bottom: 1rem !important;
  }

  /* Bessere Touch-Ziele im Menü */
  ul li a {
    display: inline-block;
    padding: 6px 10px;
    margin: 2px 0;
  }
}
