/* DATEI: startseitemobil.css
   Layout-Styles fuer die responsive Startseite
   Verwendung: <link rel="stylesheet" href="styles/startseitemobil.css">
*/

/* Schrift global setzen, da standard.css nur td/p etc. abdeckt */
body {
    font-family: 'Inter', Verdana, Arial, sans-serif;
}

/* ---- Kopfzeile ---- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 10px;
    background-color: #E0E0E0;
    color: #006666;
    padding: 3px 6px;
}

/* ---- Dreispältiger Hauptbereich (Original-Tabellenstruktur) ---- */
.main-table {
    width: 100%;
}

/* Vertikale Spieltermine-Einträge: rechtsbündig, 10 px Abstand */
.main-table table.bild {
    margin-left: auto;
    margin-bottom: 10px;
}

.main-table table.bild:last-of-type {
    margin-bottom: 0;
}

/* ---- Willkommenszeile ---- */
.welcome {
    text-align: center;
    padding: 6px 0 2px;
}

/* ---- Hinweisbox (Wichtig-Banner) ---- */
.highlight-box {
    text-align: center;
    padding: 6px;
    font-weight: bold;
    color: #900;
}

/* ---- Infobereich (Serie, Termine etc.) ---- */
.info-section {
    width: 100%;
    overflow-x: auto;
    text-align: center;
}

/* PHP-Ausgaben enthalten Tabellen – diese zentrieren */
.info-section table {
    margin: 0 auto;
}

/* td.tur (Vorschau/Clubturnier) an td.creo (Alle Spieltermine) angleichen */
td.tur {
    font-size: 16px;
    background-color: #E0E0E0;
    color: #006666;
}

/* ---- Fußzeilentexte ---- */
.footer-text {
    text-align: center;
    font-size: 9px;
    padding: 2px 6px;
}

.footer-text.bold-red {
    font-weight: bold;
    color: red;
}

.page-copyright {
    text-align: center;
    font-size: 9px;
    padding: 4px 6px;
    background-color: #E0E0E0;
    color: #006666;
    margin-top: 6px;
}

.page-copyright a {
    color: #006666;
    text-decoration: none;
}

/* ---- Seitenreihenfolge: nur auf Mobil per flex-order umkehren ---- */
@media (max-width: 600px) {

    .page-body {
        display: flex;
        flex-direction: column;
    }

    /* Reihenfolge umkehren: Spieltermine vor Clarence */
    .info-section { order: 1; }
    .main-table   { order: 2; }

    /* ---- Spieltermine-Bereich ---- */

    /* Vorschau morgen + Nächstes Clubturnier ausblenden */
    td.tur { display: none !important; }

    /* Außentabelle scrollt horizontal, Innentabellen behalten natürliche Breite */
    .info-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .info-section table {
        width: auto;
        min-width: unset;
        margin: 0 auto;
    }

    /* Spieltermin-Kacheln: jede Anmeldungsgruppe als kompakte Kachel */
    table.bild {
        display: inline-block;
        vertical-align: top;
        border: 1px solid #00CC99;
        border-radius: 6px;
        background: #F2FFF7;
        padding: 4px;
        margin: 4px;
        /* table.bild wird durch die Regel unten (".info-section td.creo > table") zum Flex-Container;
           "gap" sorgt dort für Abstand zwischen den Zellen (Anmelden/Abmelden/Anzeigen-Icons + Zeit) */
        gap: 8px;
    }

    /* Anmelden/Abmelden/Anzeigen-Icons in einer Kachel: mehr Tippfläche pro Icon */
    table.bild td {
        padding: 6px;
    }

    table.bild img {
        width: 28px;
        height: 28px;
    }

    /* Kacheln umbrechen statt nebeneinander scrollen */
    .info-section td.creo {
        display: block;
        width: 100%;
    }

    .info-section td.creo > table {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .info-section td.creo > table > tbody,
    .info-section td.creo > table > tbody > tr {
        display: contents;
    }

    .info-section td.creo > table > tbody > tr > td {
        display: inline-block;
        text-align: center;
    }

    /* ---- Haupttabelle (Clarence + Willkommen) ---- */

    /* Seitenleisten (SerienVer, Spieltext) auf Mobil ausblenden */
    .main-table td:first-child,
    .main-table td:last-child {
        display: none;
    }

    /* Spieltext-Zeile (Nächstes Usertreffen): einzige td in tr2 – einblenden */
    .main-table tr:nth-child(2) td {
        display: block !important;
        width: 100% !important;
        text-align: center;
    }

    /* Clarence-Spalte zentriert und vollbreite */
    .main-table td:nth-child(2) {
        display: block;
        width: 100% !important;
        text-align: center;
    }

    .main-table img {
        max-width: 60%;
        height: auto;
        display: block;
        margin: 6px auto;
    }

    td.creo { font-size: 12px; }

    .footer-text {
        font-size: 11px;
        padding: 4px 8px;
    }
}
