/* ==================== LAYOUT ==================== */
:root {
    --nav-height: 70px;
    --header-height: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing);
    padding-bottom: calc(var(--nav-height) + var(--spacing));
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
    text-align: center;
    padding: 24px 0;
    margin-bottom: var(--spacing-lg);
}

.header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header p {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

/* ==================== NAVIGATION ==================== */
.nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: white;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 8px;
}

.nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    padding: 8px 4px;
}

.nav-icon {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.nav-label {
    font-size: 0.7rem;
    line-height: 1;
}

.nav-btn:active .nav-icon {
    transform: scale(0.9);
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* ==================== TABS ==================== */
.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: var(--spacing);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== SECTIONS ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text);
}

/* ==================== TEXT ==================== */
.text-center {
    text-align: center;
}

/* ==================== EXTRA PLAYERS ==================== */
.extra-players-card {
    background: white;
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow);
}

.extra-players-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
        padding-bottom: calc(var(--nav-height) + 12px);
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .nav {
        padding: 0 4px;
    }

    .nav-btn {
        font-size: 0.7rem;
        padding: 6px 2px;
    }

    .nav-icon {
        font-size: 1.25rem;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 400px) {
    .nav-label {
        font-size: 0.6rem;
    }
}

/* ==================== SAFE AREA (iPhone X+) ==================== */
@supports (padding: max(0px)) {
    .nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }

    .container {
        padding-bottom: calc(var(--nav-height) + var(--spacing) + env(safe-area-inset-bottom));
    }
}


/* FIX: Bottom Menu deckt Inhalt */
.container {
    padding-bottom: calc(var(--nav-height) + 40px) !important;
}

#tab-settings .card:last-child {
    margin-bottom: 20px;
}