:root {
    --brand: #ff565a;
    --dark: #1e293b;
    --bg: #f1f5f9;
    --white: #ffffff;
    --text: #334155;
    --text-muted: #64748b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

/* --- HEADER & NAVIGATION --- */

.header-container {
    max-width: 1000px;
    margin: 20px auto 0 auto;
    padding: 0 15px;
}

.main-nav {
    background: var(--dark);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-hero {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
    line-height: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.header-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
}

.nav-links { display: flex; gap: 5px; height: 100%; }

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    padding: 0 15px;
    display: flex;
    align-items: center;
    border-bottom: 4px solid transparent;
    transition: 0.2s;
}

.nav-links a.active {
    color: white;
    border-bottom-color: var(--brand);
}

.nav-links a:hover { color: white; }

.logout-link {
    background: var(--brand);
    color: white;
    padding: 7px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: bold;
    flex-shrink: 0;
}

/* Links global in Textfarbe (Grau) und ohne Unterstreichung */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand);
    text-decoration: underline;
}

/* --- LAYOUT & CONTAINER --- */

.main-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
}

/* --- KARTEN & BOXEN --- */

.card, .match-card, .stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 6px solid var(--brand);
    text-align: left;
}

.match-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-card.locked {
    border-left-color: #cbd5e1;
    background: #f8fafc;
}

.locked-live { border-left: 5px solid #ef4444 !important; background: #fff1f2; }

/* --- TABELLEN --- */

table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

th { background: var(--dark); color: white; padding: 15px; text-align: left; }
td { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; }
.row-highlight { background-color: #fff1f2; }

/* --- STATS --- */

.stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    border-top: 5px solid var(--dark);
    text-align: left;
}

.stat-card h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-card .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin: 10px 0;
}

/* --- BUTTONS & FORMS --- */

.btn {
    background: var(--brand) !important;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 10px;
}

input[type="number"] {
    width: 60px !important;
    height: 40px;
    text-align: center;
    font-size: 1.2em;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

/* --- TEAMS & FLAGGEN --- */

.match-teams { display: flex; align-items: center; gap: 15px; margin: 12px 0; flex-wrap: wrap; }
.team { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.flag { 
    width: 30px; 
    height: 20px; 
    object-fit: cover; 
    border: 1px solid #e2e8f0; 
    border-radius: 3px; 
    background: #f1f5f9; 
}
.team-name { font-weight: 600; color: var(--dark); }
.vs { font-weight: bold; color: #94a3b8; font-size: 0.8em; }

/* --- LOGIN / REGISTER FIX --- */

.login-wrapper, .register-wrapper, .login-card, .reg-card, .login-card form, .reg-card form {
    display: block !important;
    width: 100% !important;
}

.form-group {
    display: block !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    clear: both;
}

.login-card input, .reg-card input {
    display: block !important;
    width: 100% !important;
    margin-top: 5px;
}

.btn-login, .btn-reg {
    display: block !important;
    width: 100% !important;
    margin-top: 20px;
}

/* --- RESPONSIVE ANPASSUNGEN (MOBILE) --- */
@media (max-width: 768px) {
    .match-card { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 12px; 
        padding: 15px;
    }

    .match-teams {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 8px;
    }

    .team { 
        flex: none; 
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .match-card form {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        margin-top: 5px;
    }

    /* --- BILD HEADER ANPASSUNG --- */
    .header-hero { 
        height: auto; 
        border-radius: 12px !important; /* Rundet das Bild jetzt auch oben ab, da der Balken weg ist */
    }
    .header-hero img { height: auto; }

    /* --- APP-STYLE BOTTOM NAVIGATION --- */
    
    body {
        /* Platz am unteren Rand schaffen, damit die Leiste nichts verdeckt */
        padding-bottom: 80px; 
    }

    .main-nav {
        /* Macht den leeren oberen Container unsichtbar und nimmt ihm den Platz weg */
        background: transparent !important;
        height: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .nav-links {
        /* Fixiert das Menü am unteren Bildschirmrand */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: var(--dark);
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around;
        align-items: center;
        padding: 0 5px;
        z-index: 9999;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
        border-radius: 15px 15px 0 0;
    }

    .nav-links a {
        padding: 8px 5px !important;
        font-size: 0.7rem !important; 
        border-bottom: none !important; 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .nav-links a.active {
        /* Hebt den aktiven Link farblich hervor */
        color: var(--brand) !important;
        background: rgba(255, 86, 90, 0.1);
        border-radius: 8px;
    }

    /* --- SCHWEBENDER TIPPEN BUTTON (FAB) --- */
    .logout-link {
        position: fixed !important;
        bottom: 85px !important; 
        right: 20px !important;
        background: var(--brand) !important;
        color: white !important;
        padding: 15px 25px !important;
        border-radius: 30px !important; 
        font-size: 1.1rem !important;
        font-weight: bold !important;
        box-shadow: 0 4px 12px rgba(255, 86, 90, 0.4) !important;
        z-index: 10000 !important;
    }
}