/* =========================================
   1. VARIABLEN & KONFIGURATION
   ========================================= */
:root {
    /* --- FARBPALETTE (Logo-basiert) --- */
    
    /* Das "CUP" Gold (Satt und glänzend) */
    --color-gold-light: #FFD700;
    --color-gold-dark: #FF8C00;
    --color-primary: #FFAA00; /* Fallback Farbe */
    
    /* Das "Rodenstein" Blau (Königlich und tief) */
    --color-blue-light: #2E86C1;
    --color-blue-dark: #1B4F72;
    --color-secondary: #1F618D; /* Fallback Farbe */

    /* Neutrale Farben */
    --color-dark: #111827;       /* Fast Schwarz (Modernes Charcoal) */
    --color-light: #ffffff;
    --color-gray-bg: #f3f4f6;    /* Heller Hintergrund für Sections */
    --color-text: #1f2937;       /* Dunkles Grau für Lesetext */
    
    /* --- VERLÄUFE (Für den 3D-Look) --- */
    --gradient-gold: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold-dark) 100%);
    --gradient-blue: linear-gradient(135deg, var(--color-blue-light) 0%, var(--color-blue-dark) 100%);
    --gradient-hero: linear-gradient(to bottom, rgba(17, 24, 39, 0.9), rgba(17, 24, 39, 0.7));

    /* --- TYPOGRAFIE --- */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Kanit', sans-serif; /* WICHTIG: In header.php einbinden! */
    
    /* --- LAYOUT & EFFEKTE --- */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(255, 170, 0, 0.4); /* Goldener Schein */
    --border-radius: 12px;
    --border-radius-pill: 50px;
    --container-width: 1200px;
}


/* =========================================
   2. BASIS SETUP
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-gray-bg);
    font-size: 16px;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* kanit-regular - latin */
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 400;
  /* Hier v17 statt v15 nutzen */
  src: url('../fonts/kanit-v17-latin-regular.woff2') format('woff2');
  font-display: swap;
}

/* kanit-800 - latin */
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 800;
  /* Prüfe ob diese Datei auch v17 im Namen hat */
  src: url('../fonts/kanit-v17-latin-regular.woff2') format('woff2');
  font-display: swap;
}

/* kanit-800italic - latin */
@font-face {
  font-family: 'Kanit';
  font-style: italic;
  font-weight: 800;
  /* Auch hier v17 anpassen */
  src: url('../fonts/kanit-v17-latin-regular.woff2') format('woff2');
  font-display: swap;
}

/* Definition der Variablen */
:root {
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Kanit', sans-serif;
    --color-dark: #0f172a;
    --color-gold: #d4af37;
}

body {
    font-family: var(--font-body);
}

h1, h2, h3, .logo {
    font-family: var(--font-heading);
    font-weight: 800;
}
/* =========================================
   3. LAYOUT & CONTAINER
   ========================================= */
.container {
    width: 100%;
    padding: 0 20px;
    margin: 0 auto;
    max-width: var(--container-width);
}

/* Sektions-Titel mit Gold-Unterstrich */
.section-title {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-style: italic;
    font-size: 2.5rem;
    color: var(--color-blue-dark); /* Dunkelblau statt Schwarz */
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 6px;
    background: var(--gradient-gold); /* Goldener Verlauf */
    margin: 10px auto 0;
    border-radius: 4px;
    transform: skew(-20deg); 
}

/* =========================================
   4. HEADER & NAVIGATION
   ========================================= */
header {
    background: var(--color-dark); /* Oder var(--gradient-blue) für mehr Farbe */
    color: white;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--color-gold-dark); /* Goldener Rand unten */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo img { height: 50px; } /* Logo etwas größer */

/* Hamburger-Menu */
.menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--color-gold-light); /* Goldenes Icon */
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
}

/* Mobile Nav */
nav ul {
    display: none;
    width: 100%;
    list-style: none;
    flex-direction: column;
    margin-top: 1rem;
    background: #222;
    border-radius: var(--border-radius);
    padding: 10px 0;
    border: 1px solid #444;
}

nav ul.active { display: flex; }

nav ul li a {
    display: block;
    padding: 1rem;
    color: white;
    font-weight: 600;
    font-family: var(--font-heading);
    text-transform: uppercase;
    border-bottom: 1px solid #333;
    transition: color 0.3s;
}

nav ul li a:hover { color: var(--color-gold-light); }
nav ul li:last-child a { border-bottom: none; }

/* =========================================
   5. HERO BEREICH
   ========================================= */
.hero {
    position: relative;
    padding: 50px 0 100px; /* Viel Platz für das Bild */
    color: white;
    text-align: center;
    z-index: 2;
    margin-bottom: -80px;
    
    /* Hintergrund: Dunkler Overlay + Bild */
    background: 
        var(--gradient-hero),
        url('../img/hero-bg.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    
    /* Schnittkante unten */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    /* border-bottom: 5px solid var(--color-gold-light); */
}

.hero h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    /* Text-Schatten für bessere Lesbarkeit */
    text-shadow: 2px 2px 0px var(--color-blue-dark), 4px 4px 10px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.hero p {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* =========================================
   6. UI BUTTONS (Der "Gold-Effekt")
   ========================================= */
.btn {
    display: inline-block;
    background: var(--gradient-gold); /* Verlauf! */
    color: #000; /* Schwarzer Text auf Gold = Bester Kontrast */
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border: none;
    border-radius: var(--border-radius-pill);
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Glanzeffekt beim Hover */
.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    filter: brightness(1.1);
}

/* Nav Button etwas kleiner */
nav .btn {
    margin: 10px;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    width: auto;
    background: var(--gradient-gold);
    color: black;
    box-shadow: none;
}
nav .btn:hover { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }

/* Formular Felder */
input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-blue-light);
}

/* =========================================
   7. COUNTDOWN & FEATURES
   ========================================= */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.timer-box {
    background: rgba(0, 0, 0, 0.6); /* Dunkler Hintergrund für Kontrast */
    border: 2px solid var(--color-gold-light);
    padding: 15px;
    min-width: 85px;
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.timer-box span {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    display: block;
    font-weight: bold;
    /* Goldener Text-Verlauf (Webkit only trick, fallback color) */
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-gold-light); /* Fallback */
    line-height: 1;
}

.timer-box small {
    color: #ddd;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
}

/* =========================================
   8. SEKTIONEN (Teilnehmer & Content)
   ========================================= */
.participants-section {
    background: var(--color-gray-bg);
    padding-top: 100px;
    padding-bottom: 80px;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tab-btn {
    background: white;
    border: 2px solid #ccc;
    color: var(--color-text);
    padding: 10px 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: var(--border-radius-pill);
}

.tab-btn:hover {
    border-color: var(--color-blue-dark);
    color: var(--color-blue-dark);
}

.tab-btn.active {
    background: var(--gradient-blue); /* Blauer Verlauf für aktive Tabs */
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.4);
    transform: scale(1.05);
    padding: 12px 32px; /* Ausgleich für fehlenden Border */
}

/* Team Grid */
.team-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease-in-out;
}
.team-grid.active { display: grid; }

/* Team Cards */
.team-card {
    background: white;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    /* Linker Rand in Gold */
    border-left: 6px solid var(--color-gold-light); 
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-left-color: var(--color-blue-dark); /* Wechselt Farbe beim Hover */
}

.team-card span {
    font-weight: 700;
    color: var(--color-text);
    font-size: 1.05rem;
}

.team-icon {
    width: 45px;
    height: 45px;
    background: #f0f9ff;
    color: var(--color-blue-dark);
    font-size: 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e0f2fe;
}

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

/* =========================================
   9. MEDIA QUERIES
   ========================================= */
@media (min-width: 768px) {
    .container { padding: 0; width: 90%; }
    
    .menu-toggle { display: none; }
    
    nav ul {
        display: flex;
        width: auto;
        flex-direction: row;
        margin-top: 0;
        background: none;
        padding: 0;
        border: none;
    }
    
    nav ul li a { 
        border-bottom: none; 
        padding: 0.5rem 1rem; 
        color: white; 
    }
    nav ul li a:hover { color: var(--color-gold-light); }
    
    nav .btn { margin: 0 0 0 1.5rem; }
    
    /* Admin Grids */
    .admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .admin-grid-sidebar { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
}   

/* =========================================
   10. NEUE WELCOME SEKTION (Redaktioneller Look)
   ========================================= */

.welcome-section {
    position: relative;
    background: white;
    padding: 80px 0;
    z-index: 1; /* Über dem Hintergrund */
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

/* Der Textbereich */
.welcome-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--color-dark);
    text-transform: uppercase;
    font-style: italic;
}

/* Ein kleiner goldener Strich über der Headline */
.welcome-content h2::before {
    content: '';
    display: block;
    width: 60px;
    height: 5px;
    background: var(--gradient-gold);
    margin-bottom: 15px;
    border-radius: 2px;
}

.welcome-lead {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-blue-dark);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.welcome-content p {
    color: #4b5563;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* Rechte Spalte: Bild oder Logo-Inszenierung */
.welcome-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ein Rahmen um das Bild für Tiefe */
.welcome-image-wrapper {
    position: relative;
    z-index: 2;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 5px solid white;
    transform: rotate(2deg); /* Leichte Drehung für Dynamik */
    transition: transform 0.3s ease;
}

.welcome-image-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Dekorativer Hintergrund hinter dem Bild */
.welcome-visual::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    background: var(--gradient-gold);
    top: 20px;
    right: 20px;
    border-radius: var(--border-radius);
    z-index: 1;
    opacity: 0.3;
}

/* Desktop Ansicht */
@media (min-width: 900px) {
    .welcome-grid {
        grid-template-columns: 1.2fr 0.8fr; /* Text etwas breiter als Bild */
        gap: 60px;
    }
    
    .welcome-content h2 { font-size: 3rem; }
}


/* =========================================
   11. GOOGLE REVIEWS (DSGVO Safe)
   ========================================= */
.reviews-section {
    background: white;
    padding: 80px 0;
    text-align: center;
}

.google-badge {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    border: 1px solid #eee;
}

.g-logo { font-weight: bold; font-size: 1.5rem; margin-right: 10px; }
.g-blue { color: #4285F4; }
.g-red { color: #EA4335; }
.g-yellow { color: #FBBC05; }
.g-green { color: #34A853; }

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: left;
}

.review-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.review-card:hover { transform: translateY(-5px); }

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.review-avatar {
    width: 40px; height: 40px;
    background: var(--gradient-gold);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.review-stars { color: #FBBC05; font-size: 0.9rem; }
.review-text { font-size: 0.95rem; color: #555; line-height: 1.5; }
/* =========================================
   12. CHRONIK APP & STATISTIKEN
   ========================================= */

.cup-root {
    max-width: 100%;
    margin: 0 auto;
}

/* --- SUCHE --- */
.search-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
    border-left: 5px solid var(--color-blue-dark);
}

.search-section h2 {
    font-family: var(--font-heading);
    color: var(--color-blue-dark);
    margin-bottom: 15px;
}

#clubSearch {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    outline: none;
    transition: all 0.3s;
}

#clubSearch:focus {
    border-color: var(--color-gold-light);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.search-results {
    position: absolute;
    width: 100%;
    background: white;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    margin-top: 5px;
}

.search-results div {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    transition: background 0.2s;
}

.search-results div:hover {
    background: #f0f9ff;
    color: var(--color-blue-dark);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid #eee;
}

.stat-card h3 {
    margin: 0;
    background: var(--gradient-gold); /* Unser Gold-Verlauf */
    padding: 20px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--color-dark);
}

.stat-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: 0.2s;
}

.stat-header:hover { background: #fafafa; }

.stat-info { flex-grow: 1; margin-right: 15px; }

.stat-name {
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.stat-bar-bg {
    background: #eee;
    height: 8px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    background: var(--color-blue-light); /* Blaue Balken */
    height: 100%;
    border-radius: 4px;
}

.badge-count {
    background: var(--color-dark);
    color: var(--color-gold-light);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    font-family: var(--font-heading);
    white-space: nowrap;
}

.toggle-footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color-blue-dark);
    text-transform: uppercase;
    transition: background 0.2s;
}
.toggle-footer:hover { background: #e2e8f0; }

.hidden { display: none; }

/* --- MODAL (POPUP) --- */
#clubModal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-header {
    background: var(--gradient-blue);
    padding: 20px 30px;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
}

.close-btn { cursor: pointer; font-size: 2rem; line-height: 1; }
.close-btn:hover { color: var(--color-gold-light); }

.modal-body { padding: 30px; max-height: 70vh; overflow-y: auto; }

.m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.m-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #666;
    font-weight: bold;
}

.m-box b {
    display: block;
    font-size: 1.5rem;
    color: var(--color-blue-dark);
    margin-top: 5px;
    font-family: var(--font-heading);
}

/* Tabelle im Modal */
.m-table { width: 100%; border-collapse: collapse; }
.m-table th { text-align: left; color: #999; font-size: 0.8em; padding: 10px 5px; border-bottom: 2px solid #eee; }
.m-table td { padding: 10px 5px; border-bottom: 1px solid #f4f4f4; }
.m-table tr:hover { background: #f9f9f9; }

/* --- CHRONIK LISTEN (Deine HTML Details) --- */
.year-card {
    background: white;
    border: none;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.year-card summary {
    padding: 15px 20px;
    background: white;
    cursor: pointer;
    font-weight: 800;
    font-family: var(--font-heading);
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    color: var(--color-dark);
    transition: background 0.2s;
    border-left: 5px solid transparent;
}

.year-card[open] summary {
    background: #f8f9fa;
    border-left-color: var(--color-gold-light);
}

.main-table { width: 100%; border-collapse: collapse; }
.main-table th { background: #f1f5f9; padding: 10px 15px; text-align: left; font-size: 0.85rem; text-transform: uppercase; color: #64748b; }
.main-table td { padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 0.95rem; }

.row-win {
    background: rgba(255, 215, 0, 0.15) !important;
    font-weight: bold;
}
.row-win td:first-child { border-left: 3px solid var(--color-gold-light); }

/* =========================================
   13. MODAL DESIGN (RITTER STYLE)
   ========================================= */

/* Hintergrund abdunkeln mit Blur-Effekt */
#clubModal {
    display: none;
    position: fixed;
    z-index: 10000; /* Sehr hoch, damit es über allem liegt */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(14, 29, 52, 0.85); /* Dunkelblau transparent */
    backdrop-filter: blur(5px); /* Weichzeichner für den Hintergrund */
}

/* Der Modal-Kasten selbst */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 650px;
    border-radius: 8px; /* Leicht abgerundet */
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border: 2px solid var(--color-gold, #c5a86d); /* Goldener Rahmen */
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

/* Animation beim Öffnen */
@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- HEADER BEREICH --- */
.modal-header {
    background: var(--color-blue-dark, #0e1d34); /* Dunkelblau */
    color: var(--color-gold, #c5a86d); /* Goldene Schrift */
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-gold, #c5a86d);
}

.modal-header span#mName {
    font-family: var(--font-heading, 'Times New Roman', serif);
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Schließen Button */
.close-btn {
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-gold, #c5a86d);
}

/* --- BODY BEREICH --- */
.modal-body {
    padding: 30px;
    background-color: #f9f9f9;
    max-height: 75vh;
    overflow-y: auto; /* Scrollen bei langen Listen */
}

/* --- STATISTIK BOXEN (GRID) --- */
.m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.m-box {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    /* Goldener Strich oben an jeder Box */
    border-top: 3px solid var(--color-gold, #c5a86d);
    
    font-family: sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 0.5px;
}

.m-box b {
    display: block;
    margin-top: 5px;
    font-family: var(--font-heading, 'Times New Roman', serif);
    font-size: 1.6rem;
    color: var(--color-blue-dark, #0e1d34); /* Dunkle Zahlen */
}

/* --- HISTORIE TABELLE IM MODAL --- */
.modal-body h4 {
    margin-bottom: 10px;
    font-family: var(--font-heading, sans-serif);
    color: var(--color-blue-dark, #0e1d34);
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.m-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.m-table th {
    text-align: left;
    padding: 10px;
    background-color: #eee;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.m-table td {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.m-table tr:last-child td {
    border-bottom: none;
}

/* Hervorhebung für den Platz */
.m-table td:last-child {
    color: var(--color-blue-dark, #0e1d34);
}

/* Hover Effekt für Zeilen */
.m-table tr:hover {
    background-color: #f0f0f0;
}


/* =========================================
   DETAILSEITE VEREIN (CI KONFORM)
   ========================================= */

/* Sticky Zurück-Button */
.sticky-header {
    position: sticky;
    top: 130px; /* Anpassen je nach Header-Höhe */
    z-index: 900;
    margin-bottom: 20px;
    pointer-events: none;
    display: flex;
}

.btn-back-sticky {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    background-color: var(--cup-dark);
    color: var(--cup-gold);
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    border: 2px solid var(--cup-gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.btn-back-sticky:hover {
    background-color: var(--cup-gold);
    color: var(--cup-dark);
    transform: translateY(-2px);
}

.btn-back-sticky span { margin-right: 8px; font-size: 1.2em; line-height: 1; }

/* Header Karte des Vereins */
.club-header-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-top: 5px solid var(--cup-gold);
}

.club-title-area {
    background: var(--cup-gray);
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.club-title-area h1 {
    margin: 0;
    color: var(--cup-dark);
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Statistik Boxen (4er Grid) */
.club-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 Spalten */
    gap: 1px; /* Feine Linien Optik */
    background: #eee; /* Farbe der Linien */
}

.c-stat-box {
    background: white;
    padding: 20px 10px;
    text-align: center;
}

.c-stat-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.75em;
    color: #888;
    font-weight: bold;
    margin-bottom: 5px;
}

.c-stat-value {
    display: block;
    font-size: 1.8em;
    color: var(--cup-dark);
    font-weight: bold;
}

.c-stat-value.gold { color: #b8860b; } /* Etwas dunkleres Gold für Text */

/* Desktop Anpassung */
@media (min-width: 768px) {
    .club-stats-grid { grid-template-columns: repeat(4, 1fr); }
    .club-title-area h1 { font-size: 2.5em; }
    .sticky-header { top: 160px; } /* Mehr Abstand auf Desktop */
}
/* ==========================================================================
   MOBILE KARTEN-ANSICHT (FIX FÜR CLUB-HISTORY-TABLE)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. RESET: Wir sprechen jetzt BEIDE Tabellen an! */
    .main-table, .club-history-table,
    .main-table tbody, .club-history-table tbody,
    .main-table tr, .club-history-table tr,
    .main-table td, .club-history-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important; /* Killt Scrollen */
    }
    
    /* Kopfzeilen weg */
    .main-table thead, .club-history-table thead { display: none !important; }

    /* 2. KARTEN-DESIGN (Für beide gleich) */
    .main-table tr, .club-history-table tr {
        position: relative !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
        /* Platz unten für Details lassen */
        padding: 15px 15px 45px 15px !important; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.05) !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }

    /* ZELLEN RESET (Für beide) */
    .main-table td, .club-history-table td {
        padding: 2px 0 !important;
        border: none !important;
        text-align: left !important;
        background: none !important;
        position: static !important;
        width: 100% !important;
    }

    /* ============================================================
       FALL A: CHRONIK (.main-table)
       Spalten: 1=Jugend, 2=Platz, 3=Verein, 4=Besonderheit
       ============================================================ */
    
    /* Spalte 1 (Jugend): Grau, Oben */
    .main-table td:nth-child(1) {
        order: 1;
        font-size: 0.8rem !important; color: #888 !important; 
        font-weight: 700 !important; text-transform: uppercase !important;
    }

    /* Spalte 3 (Verein): Groß, Fett */
    .main-table td:nth-child(3) {
        order: 2;
        font-size: 1.2rem !important; font-weight: 800 !important; 
        color: var(--color-dark, #333) !important;
        padding-right: 90px !important; /* Platz für Badge */
    }

    /* Spalte 4 (Besonderheit): Unten, Gold */
    .main-table td:nth-child(4) {
        order: 3;
        font-size: 0.85rem !important; color: var(--color-gold-dark, #b8860b) !important; 
        font-style: italic !important; margin-top: 5px !important;
    }

    /* Spalte 2 (Platz): BADGE OBEN RECHTS */
    .main-table td:nth-child(2) {
        position: absolute !important; top: 0 !important; right: 0 !important;
        width: auto !important; padding: 8px 15px !important;
        background-color: var(--color-blue-dark, #0e1d34) !important; color: #fff !important;
        border-bottom-left-radius: 12px !important; border-top-right-radius: 12px !important;
        font-weight: 800 !important; text-align: center !important;
        z-index: 10 !important;
    }
    .main-table .row-win td:nth-child(2) { /* Sieger Gold */
        background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%) !important;
        color: #000 !important;
    }


    /* ============================================================
       FALL B: VEREIN (.club-history-table)
       Spalten: 1=Jahr, 2=Jugend, 3=Team, 4=Platz
       ============================================================ */

    /* Spalte 1 (Jahr): Blau, Fett */
    .club-history-table td:nth-child(1) {
        order: 1;
        font-size: 1.1rem !important; color: var(--color-blue-dark, #0e1d34) !important; 
        font-weight: 800 !important; margin-bottom: 2px !important;
    }

    /* Spalte 2 (Jugend): Grau darunter */
    .club-history-table td:nth-child(2) {
        order: 2;
        font-size: 0.85rem !important; color: #888 !important; 
        text-transform: uppercase !important; font-weight: 600 !important; 
        margin-bottom: 8px !important;
    }

    /* Spalte 3 (Team-Name): Normal */
    .club-history-table td:nth-child(3) {
        order: 3;
        font-size: 1rem !important; color: #555 !important;
        padding-right: 90px !important;
    }

    /* Spalte 4 (Platz): BADGE OBEN RECHTS (Hier ist es Spalte 4!) */
    .club-history-table td:nth-child(4) {
        position: absolute !important; top: 0 !important; right: 0 !important;
        width: auto !important; padding: 8px 15px !important;
        background-color: var(--color-blue-dark, #0e1d34) !important; color: #fff !important;
        border-bottom-left-radius: 12px !important; border-top-right-radius: 12px !important;
        font-weight: 800 !important; text-align: center !important;
        z-index: 10 !important;
    }

    /* Sieger Badge (Gold) Verein */
    .club-history-table .row-win td:nth-child(4) {
        background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%) !important;
        color: #000 !important;
    }
    
    /* Karte leicht golden färben bei Sieg */
    .row-win {
        background-color: #fff9e6 !important;
        border-color: #FFD700 !important;
    }
}

/* === LIVE BOX (Wenn Turnier läuft) === */
.live-box {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold-dark) 100%);
    color: var(--color-blue-dark);
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    text-align: center;
    animation: pulse-live 2s infinite;
    border: 2px solid white;
}

.live-box h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.live-box p {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    font-weight: bold;
}

@keyframes pulse-live {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
    50% { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 215, 0, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
}

/* =========================================
   COUNTDOWN & LIVE BOX DESIGN
   ========================================= */

/* Der Container, der alles umschließt */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px; /* Abstand zwischen den Boxen */
    margin: -30px auto 40px auto; /* Negativer Margin zieht es in den Header rein */
    position: relative;
    z-index: 10;
    max-width: 600px;
}

/* Die einzelnen Zeit-Boxen (Tage, Std, Min, Sek) */
.timer-box {
    background: rgba(255, 255, 255, 0.95); /* Fast weiß, leicht transparent */
    color: var(--color-blue-dark, #0e1d34); /* Dunkelblaue Schrift */
    padding: 15px 10px;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-bottom: 4px solid var(--color-gold-dark, #b8860b); /* Goldener Rand unten */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Die großen Zahlen */
.timer-box span {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    font-family: monospace; /* Damit die Zahlen nicht springen */
}

/* Die kleinen Labels (Tage, Std...) */
.timer-box small {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    font-weight: bold;
    margin-top: 2px;
}

/* === LIVE BOX (Wenn Turnier läuft) === */
.live-box {
    width: 100%;
    max-width: 500px; /* Nicht zu breit */
    margin: 0 auto;
    padding: 20px;
    
    /* Goldener Farbverlauf */
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
    color: #000;
    
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(255, 165, 0, 0.6); /* Leuchtender Schatten */
    text-align: center;
    border: 3px solid #fff; /* Weißer Rand */
    
    /* Pulsierende Animation */
    animation: pulse-live 2s infinite ease-in-out;
}

.live-box h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-box p {
    margin: 5px 0 0 0;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0.9;
}

/* Animation Definition */
@keyframes pulse-live {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 165, 0, 0.6); }
    50% { transform: scale(1.03); box-shadow: 0 0 35px rgba(255, 165, 0, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 165, 0, 0.6); }
}

/* Mobile Anpassung: Boxen kleiner machen */
@media (max-width: 600px) {
    .countdown-container {
        gap: 8px;
        flex-wrap: nowrap; /* In einer Zeile bleiben */
    }
    
    .timer-box {
        min-width: 60px;
        padding: 10px 5px;
    }
    
    .timer-box span {
        font-size: 1.4rem;
    }
    
    .timer-box small {
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    /* Das Menü-Element selbst */
    #main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Prüfe, ob das die tatsächliche Header-Höhe ist */
        left: 0;
        width: 100%;
        background-color: #0f172a;
        
        /* WICHTIG: Höher als alles andere auf der Seite */
        z-index: 9999 !important; 
    }

    #main-nav.active {
        display: flex !important;
        /* Verhindert, dass Klicks durch das Menü "durchfallen" */
        pointer-events: auto !important; 
    }

    /* Die einzelnen Menüpunkte klickbar machen */
    #main-nav li a {
        display: block;
        padding: 15px 20px;
        width: 100%;
        color: white;
        text-decoration: none;
        position: relative;
        z-index: 10000 !important;
    }
}


.btn-large {
    background: var(--color-gold);
    color: black;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    transition: transform 0.2s, background 0.2s;
}

.btn-large:hover {
    transform: scale(1.05);
    background: #e5c14d;
}

.btn-outline {
    border: 2px solid var(--color-blue-dark);
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--color-blue-dark);
    text-decoration: none;
    font-weight: bold;
}

.team-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: border-color 0.3s;
}

.team-card:hover {
    border-color: var(--color-gold);
}

.team-icon {
    font-size: 1.2rem;
}

.btn-outline {
    display: inline-block;
    padding: 12px 25px;
    border: 2px solid var(--color-blue-dark);
    color: var(--color-blue-dark);
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn-outline:hover {
    background: var(--color-blue-dark);
    color: #fff;
}

/* --- Countdown Haupt-Container --- */
.countdown-container {
    display: flex;
    justify-content: center; /* Zentriert die Boxen horizontal */
    align-items: center;
    gap: 15px;               /* Abstand zwischen den Boxen */
    margin: 30px auto;       /* Abstand nach oben/unten und zentriert den Container selbst */
    width: 100%;             /* Nutzt die volle Breite zur Zentrierung */
    max-width: 600px;        /* Verhindert, dass die Boxen zu weit auseinander driften */
}

/* --- Die einzelnen Zeit-Boxen --- */
.timer-unit {
    background: rgba(15, 23, 42, 0.4); /* Halbtransparenter dunkler Hintergrund */
    border: 2px solid #d4af37;        /* Goldener Rahmen */
    border-radius: 10px;
    padding: 12px 5px;
    min-width: 80px;                  /* Feste Breite für Gleichmäßigkeit */
    text-align: center;
    color: #ffffff;
}

/* --- Die großen Zahlen --- */
.timer-unit span {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: #d4af37;                   /* Goldene Zahlen */
    line-height: 1.1;
}

/* --- Beschriftung unter den Zahlen (TAGE, STD, etc.) --- */
.timer-unit label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 3px;
    color: #ffffff;
}

/* --- Responsive Korrektur für kleine Bildschirme --- */
@media (max-width: 480px) {
    .countdown-container {
        gap: 8px;
    }
    .timer-unit {
        min-width: 65px;
        padding: 8px 3px;
    }
    .timer-unit span {
        font-size: 1.5rem;
    }
}

/* --- Statistik-Karten --- */
.stat-card {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    border: 1px solid #eee;
}

.stat-header:hover {
    background-color: #f8f9fa !important;
    color: var(--color-gold);
}

.badge-count {
    font-family: 'Kanit', sans-serif;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* --- Suchfunktion --- */
.search-results div {
    border-bottom: 1px solid #eee;
    transition: all 0.2s;
}

.search-results div:last-child {
    border-bottom: none;
}

/* --- Chronik (Jahres-Karten) --- */
.year-card {
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.year-card summary::-webkit-details-marker {
    display: none; /* Entfernt Standard-Pfeil */
}

.year-card summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.year-card summary:after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--color-blue-dark);
}

.year-card[open] summary:after {
    content: "▲";
}

.year-card summary:hover {
    background: #fcfcfc !important;
}

/* --- Hilfsklassen --- */
.hidden {
    display: none !important;
}

/* --- Responsive Tabelle --- */
@media (max-width: 600px) {
    .main-table td {
        padding: 8px 5px !important;
        font-size: 0.85rem !important;
    }
}


.filter-section {
    position: relative;
    z-index: 10; /* Stellt sicher, dass das Feld "oben" liegt */
}

.custom-search-input {
    /* Verhindert Auto-Zoom auf iOS und verbessert die Touch-Bedienung */
    font-size: 16px !important; 
    appearance: none;
    -webkit-appearance: none;
}