/* styles/style.css */
:root {
    --card: rgba(202, 141, 50, 0.9);
    --accent: rgba(202, 141, 50, 0.95);
    --headnav-color: #000000;
    --text: #000000;

    --navsize: 1.200rem;
    --headnav-height: 80px;

    --teamrolestextsize: 0.85rem;
    --teamzustaendigkeittextsize: 0.7rem;

    --textsize: 1.125rem;
    --h1size: 2.5rem;
    --h2size: 1.45rem;

    --textsize-mobile: 0.95rem;
    --h1size-mobile: 2rem;
    --h2size-mobile: 1.25rem;

    --mobile-item-h: 52px;
}

/* Reset */
* {
    box-sizing: border-box;
}

.nav-toggle {
    display: none;
}

html, body {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Roboto Light", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 50px 20px 20px; /* oben = Headnav-Höhe (80px) */
}

h1 {
    font-size: var(--h1size);
}

h2 {
    font-size: var(--h2size);
}

/* Layout */
.wrapper {
    width: 900px;
    max-width: 96%;
    padding-top: var(--headnav-height); /* Platz für fixe Nav */
    margin: 0 auto;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 28px;
}

p {
    font-size: var(--textsize);
    margin-bottom: 1.5rem;
    line-height: 1.8125rem;
    letter-spacing: .01rem;
}

li {
    font-size: var(--textsize);
    margin-bottom: 1.5rem;
    line-height: 1.8125rem;
    letter-spacing: .01rem;
}

div {
    font-size: var(--textsize);
    margin-bottom: 1.5rem;
    line-height: 1.8125rem;
    letter-spacing: .01rem;
}

/* Section */
.section {
    background: var(--card);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 6px 18px rgba(60, 58, 58, 0.6);
}

/* Headlines / Linie */
.headline h1,
.headline h2 {
    text-align: center;
    color: var(--text);
    margin: 0;
}

.hr {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin: 10px 0 18px 0;
}

/* Kopf-Navigation */
.headnav {
    margin: 0 auto;
    position: fixed;
    top: 0;
    left: -23.75%;
    width: 150%;
    height: var(--headnav-height);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9vw;
    padding: 0 16px;
    background: var(--accent);
    z-index: 1000;
    box-sizing: border-box;
    font-family: "Roboto Light", system-ui;
}

/* Links */
.headnav a {
    color: var(--headnav-color);
    font-size: var(--navsize);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: 3px solid transparent; /* Platz für Hover */
    border-radius: 35px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* Logo Bild */
.headnav a img {
    position: static;
    right: 100%;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    margin: 0;
    transition: transform 550ms ease;
}

.headnav a:hover img {
    transform: scale(1.2);
    transition: transform 250ms ease;
}

.headnav a:hover:not(.center-img) {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}


.lgswitch-container {
    position: absolute;
    top: 16px;
    right: 19%;
    display: flex;
    gap: 8px;
    z-index: 10;
}

/* Buttons: nur Flagge */
.lgswitch {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    height: 40px;
    width: 40px;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    -webkit-appearance: none;
    appearance: none;
    transform: scale(1);
    transition: transform .4s ease;
}

.lgswitch:hover {
    transform: scale(1.25);
    transition: transform .4s ease;
}

.lgswitch[aria-pressed="true"] {
    opacity: 1;
    transform: scale(1.05);
    transition: transform .8s ease, opacity .8s ease;
}

.lgswitch[aria-pressed="false"] {
    opacity: 0.6;
}

/* Regeln-Container */
.rules-lang {
    color: var(--text, #000);
    padding: 24px;
}

/* Footer Link */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
}

footer a {
    display: inline-block;
    position: static; /* war: absolute */
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    background: rgba(0, 0, 0, 0.56);
    font-weight: 600;
}

@media (max-width: 1146px) {
    .headnav {
        gap: 4vw;
    }
}

/* Mobile */
@media (max-width: 880px) {
    p {
        font-size: var(--textsize-mobile);
    }

    li {
        font-size: var(--textsize-mobile);
    }

    div {
        font-size: var(--textsize-mobile);
    }

    h1 {
        font-size: var(--h1size-mobile);
    }

    h2 {
        font-size: var(--h2size-mobile);
    }

    /* Headnav fixiert */
    .headnav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: var(--headnav-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        background: var(--accent);
        z-index: 1000;
        flex-wrap: nowrap;
    }

    /* Burger links */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
        padding: 8px;
    }

    .nav-toggle span {
        width: 28px;
        height: 3px;
        background: var(--headnav-color);
        border-radius: 2px;
        transition: transform .3s ease, opacity .3s ease;
    }

    /* Logo zentriert */
    .headnav .center-img {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;
    }

    /* LG-Switch rechts */
    .lgswitch-container {
        position: static;
        display: flex !important;
        gap: 8px;
        z-index: 1001;
    }

    /* Dropdown-Hintergrund (ohne Layout-Shift) */
    .headnav::after {
        content: "";
        position: fixed;
        top: var(--headnav-height);
        left: 0;
        right: 0;
        height: 0;
        background: var(--accent);
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        z-index: 998;
        pointer-events: none;
        opacity: 0;
        transition: height .2s ease, opacity .2s ease;
    }

    .headnav.open::after {
        height: calc(4 * var(--mobile-item-h));
        opacity: 1;
    }

    /* Alle Links außer Logo als Overlay */
    .headnav > a:not(.center-img) {
        display: flex;
        align-items: center;
        justify-content: flex-start;

        position: fixed;
        left: 0;
        right: 0;
        top: var(--headnav-height);

        height: var(--mobile-item-h);
        padding: 0 16px;

        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;

        background: var(--accent);
        color: var(--headnav-color);
        text-align: left;

        border: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        border-radius: 0;

        z-index: 999;
        transition: opacity .2s ease, transform .2s ease, background .15s ease, color .15s ease;
    }

    /* geöffnet */
    .headnav.open > a:not(.center-img) {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Exakte Reihenfolge aus index.html:
       1) button.nav-toggle
       2) a#serverBtn
       3) a Team
       4) a.center-img (Logo)
       5) a Rules
       6) a Gamemodes
    */
    .headnav.open > a:nth-of-type(1) {
        top: calc(var(--headnav-height) + 0 * var(--mobile-item-h));
    }

    /* Server */
    .headnav.open > a:nth-of-type(2) {
        top: calc(var(--headnav-height) + 1 * var(--mobile-item-h));
    }

    /* Team */
    .headnav.open > a:nth-of-type(4) {
        top: calc(var(--headnav-height) + 2 * var(--mobile-item-h));
    }

    /* Rules */
    .headnav.open > a:nth-of-type(5) {
        top: calc(var(--headnav-height) + 3 * var(--mobile-item-h));
    }

    /* Gamemodes */
    .headnav.open > a:not(.center-img):hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    /* Burger → X */
    .headnav.open .nav-toggle span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .headnav.open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .headnav.open .nav-toggle span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Slide-In Animation */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}
