﻿/* Datei: css/mobile-ligatabelle.css */

/* --- MOBILE OPTIMIERUNG: NUR HOCHFORMAT (PORTRAIT) --- */
@media (max-width: 768px) and (orientation: portrait) {
    
    /* ALLGEMEIN: Verhindern, dass Tabellen über den Rand hinausgehen */
    .table-container table, 
    .stats-table {
        min-width: 100% !important;
        width: 100% !important;
        table-layout: auto !important;
    }

    /* --- 1. SPIELPAARUNGEN (Spielergebnisse & Verlegte Spiele) --- */
    
    /* Ausblenden: Heim-Logo (3), Trennstrich (4), Gast-Logo (5) und Legs (8) */
    .stats-table th:nth-child(3), .stats-table td:nth-child(3),
    .stats-table th:nth-child(4), .stats-table td:nth-child(4),
    .stats-table th:nth-child(5), .stats-table td:nth-child(5),
    .stats-table th:nth-child(8), .stats-table td:nth-child(8) {
        display: none !important;
    }

    /* Sicherstellen, dass Datum (1), Heim (2), Gast (6) und Sets (7) sichtbar bleiben */
    .stats-table th:nth-child(1), .stats-table td:nth-child(1),
    .stats-table th:nth-child(2), .stats-table td:nth-child(2),
    .stats-table th:nth-child(6), .stats-table td:nth-child(6),
    .stats-table th:nth-child(7), .stats-table td:nth-child(7) {
        display: table-cell !important;
        white-space: normal !important; /* Erlaubt Zeilenumbrüche bei langen Teamnamen */
    }

    /* Abstände anpassen, damit Heim und Gast direkt nebeneinander gut wirken */
    .stats-table th, .stats-table td {
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }


    /* --- 2. AKTUELLE TABELLE (Liga-Tabelle) --- */
    
    /* Ausblenden: Siege (4), Unentschieden (5), Niederlagen (6) und Legs (9) */
    .tabelle-container table th:nth-child(4), .tabelle-container table td:nth-child(4),
    .tabelle-container table th:nth-child(5), .tabelle-container table td:nth-child(5),
    .tabelle-container table th:nth-child(6), .tabelle-container table td:nth-child(6),
    .tabelle-container table th:nth-child(9), .tabelle-container table td:nth-child(9) {
        display: none !important;
    }

    /* Grundschriftgröße und Polsterung für die Ligatabelle verkleinern */
    .tabelle-container table th, 
    .tabelle-container table td {
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }

    /* Den Teamnamen (Spalte 2) erlauben umzubrechen, damit Platz gespart wird */
    .tabelle-container table th:nth-child(2), 
    .tabelle-container table td:nth-child(2) {
        white-space: normal !important;
        min-width: 0 !important;
        width: auto !important;
    }

    /* Typografie und Überschriften etwas kompakter */
    .liga-header-card h1 {
        font-size: 1.3rem !important;
    }
    .section-title {
        font-size: 1.2rem !important;
        margin-bottom: 15px !important;
    }
    .select-modern {
        font-size: 0.85rem !important;
        padding: 8px 10px !important;
    }
}


/* --- MOBILE OPTIMIERUNG: QUERFORMAT (LANDSCAPE) --- */
@media (max-width: 900px) and (orientation: landscape) {
    /* Überschreibt die "hide-mobile" Klasse (die im PHP-Skript fix hinterlegt ist), 
       damit im Querformat wirklich ALLE Spalten angezeigt werden. */
    .hide-mobile {
        display: table-cell !important;
    }
    
    /* Schrift minimal verkleinern, damit die volle Tabelle auch auf kleinen Displays quer gut passt */
    .stats-table th, .stats-table td,
    .tabelle-container table th, .tabelle-container table td {
        font-size: 0.8rem !important;
        padding: 6px 4px !important;
    }
}