/* ---------------------------------------------------------
   Odigrani termini / Ekipe-Status
--------------------------------------------------------- */

.archive-item__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    width: 160px;
    min-width: 160px;
}


/* ---------------------------------------------------------
   Gemeinsamer Button / Status
--------------------------------------------------------- */

.archive-teams-button {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        20px;

    align-items: center;

    gap: 12px;

    width: 100%;
    min-height: 58px;

    padding:
        9px
        15px
        9px
        17px;

    color: var(--text);

    font: inherit;
    text-align: left;

    background:
        linear-gradient(
            135deg,
            rgba(184, 239, 87, 0.11),
            rgba(26, 173, 114, 0.045)
        );

    border:
        1px solid
        rgba(184, 239, 87, 0.30);

    border-radius: 18px;

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.035);
}


/* ---------------------------------------------------------
   Klickbare Variante
--------------------------------------------------------- */

button.archive-teams-button {
    appearance: none;

    cursor: pointer;

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

button.archive-teams-button:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            rgba(184, 239, 87, 0.17),
            rgba(26, 173, 114, 0.075)
        );

    border-color:
        rgba(184, 239, 87, 0.52);

    box-shadow:
        0 10px 28px
        rgba(0, 0, 0, 0.14);
}


/* ---------------------------------------------------------
   Text
--------------------------------------------------------- */

.archive-teams-button__text {
    display: grid;

    gap: 3px;

    min-width: 0;
}

.archive-teams-button__text small {
    color: var(--muted);

    font-size: 0.55rem;
    font-weight: 900;

    line-height: 1;

    letter-spacing: 0.14em;
}

.archive-teams-button__text strong {
    overflow: hidden;

    color: var(--text);

    font-size: 0.92rem;
    font-weight: 900;

    line-height: 1.1;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---------------------------------------------------------
   Pfeil
--------------------------------------------------------- */

.archive-teams-button__arrow {
    display: grid;

    place-items: center;

    color: var(--green-bright);

    font-size: 1.4rem;
    font-weight: 500;

    line-height: 1;

    transition:
        transform 180ms ease;
}

button.archive-teams-button:hover
.archive-teams-button__arrow {
    transform: translateX(3px);
}


/* ---------------------------------------------------------
   Keine historische Aufstellung
--------------------------------------------------------- */

.archive-teams-button--empty {
    cursor: default;

    background:
        rgba(255, 255, 255, 0.025);

    border-color:
        rgba(255, 255, 255, 0.09);

    box-shadow: none;
}

.archive-teams-button--empty
.archive-teams-button__text small {
    color:
        rgba(156, 172, 165, 0.66);
}

.archive-teams-button--empty
.archive-teams-button__text strong {
    color:
        rgba(245, 247, 246, 0.46);
}

.archive-teams-button__empty-mark {
    display: grid;

    place-items: center;

    color:
        rgba(156, 172, 165, 0.52);

    font-size: 1.2rem;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Fokus
--------------------------------------------------------- */

.archive-teams-button:focus-visible,
.teams-history-modal__close:focus-visible {
    outline:
        3px solid
        rgba(184, 239, 87, 0.45);

    outline-offset: 3px;
}


/* ---------------------------------------------------------
   Historien-Lightbox
--------------------------------------------------------- */

.teams-history-modal {
    width:
        min(
            1180px,
            calc(100vw - 32px)
        );

    max-height:
        calc(100vh - 32px);

    padding: 0;

    overflow: auto;

    color: var(--text);

    background:
        #07120e;

    border:
        1px solid
        rgba(255, 255, 255, 0.14);

    border-radius: 28px;

    box-shadow:
        0 28px 90px
        rgba(0, 0, 0, 0.58);
}

.teams-history-modal::backdrop {
    background:
        rgba(0, 0, 0, 0.78);

    backdrop-filter:
        blur(7px);

    -webkit-backdrop-filter:
        blur(7px);
}

.teams-history-modal__panel {
    padding: 28px;
}


/* ---------------------------------------------------------
   Lightbox Header
--------------------------------------------------------- */

.teams-history-modal__header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 24px;
}

.teams-history-modal__header h2 {
    margin:
        4px
        0
        0;
}

.teams-history-modal__close {
    display: grid;

    place-items: center;

    flex: 0 0 auto;

    width: 46px;
    height: 46px;

    padding: 0;

    color: var(--text);

    font: inherit;
    font-size: 2rem;

    line-height: 1;

    cursor: pointer;

    background:
        rgba(255, 255, 255, 0.06);

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 50%;

    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

.teams-history-modal__close:hover {
    background:
        rgba(255, 255, 255, 0.10);

    border-color:
        rgba(184, 239, 87, 0.28);
}


/* ---------------------------------------------------------
   Team Grid
--------------------------------------------------------- */

.teams-history-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 16px;
}


/* ---------------------------------------------------------
   Team Card
--------------------------------------------------------- */

.teams-history-card {
    min-width: 0;

    padding: 20px;

    background:
        rgba(255, 255, 255, 0.045);

    border:
        1px solid
        rgba(255, 255, 255, 0.11);

    border-radius: 22px;
}


/* ---------------------------------------------------------
   Team Header
--------------------------------------------------------- */

.teams-history-card__header {
    display: flex;

    align-items: center;

    gap: 12px;

    padding-bottom: 16px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.09);
}

.teams-history-card__header > span {
    display: grid;

    place-items: center;

    flex:
        0
        0
        48px;

    width: 48px;
    height: 48px;

    color: #07120e;

    font-size: 1.25rem;
    font-weight: 950;

    background:
        var(--green-bright);

    border-radius: 14px;
}

.teams-history-card__header div {
    min-width: 0;
}

.teams-history-card__header small,
.teams-history-card__header strong {
    display: block;
}

.teams-history-card__header small,
.teams-history-card__reserves > span {
    color: var(--muted);

    font-size: 0.75rem;
    font-weight: 900;

    letter-spacing: 0.08em;
}

.teams-history-card__header strong {
    margin-top: 3px;

    font-size: 1.12rem;
}


/* ---------------------------------------------------------
   Starter
--------------------------------------------------------- */

.teams-history-card__players {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;

    padding:
        18px
        0;
}

.teams-history-player,
.teams-history-reserve {
    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 0;
}

.teams-history-player img,
.teams-history-reserve img {
    width: 46px;
    height: 46px;

    flex:
        0
        0
        46px;

    object-fit: cover;

    background:
        rgba(255, 255, 255, 0.05);

    border:
        2px solid
        rgba(184, 239, 87, 0.7);

    border-radius: 50%;
}

.teams-history-player strong,
.teams-history-reserve strong {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   Reserve
--------------------------------------------------------- */

.teams-history-card__reserves {
    padding-top: 15px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.09);
}

.teams-history-card__reserves p {
    margin:
        10px
        0
        0;

    color: var(--muted);
}

.teams-history-card__reserve-list {
    display: grid;

    gap: 10px;

    margin-top: 12px;
}


/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */

@media (max-width: 900px) {

    .teams-history-grid {
        grid-template-columns:
            1fr;
    }
}


@media (max-width: 640px) {

    .archive-item__actions {
        width: 100%;
        min-width: 0;

        justify-content: flex-end;
    }

    .archive-teams-button {
        width: 160px;
        min-width: 160px;
    }

    .teams-history-modal {
        width:
            calc(100vw - 18px);

        max-height:
            calc(100vh - 18px);

        border-radius: 20px;
    }

    .teams-history-modal__panel {
        padding: 18px;
    }

    .teams-history-modal__header {
        gap: 12px;
    }

    .teams-history-card__players {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}
/* ---------------------------------------------------------
   Mobile: kompakter Archiv-Ekipe-Button
--------------------------------------------------------- */
@media (max-width: 640px) {
    .archive-item__actions {
        width: auto;
        min-width: 0;
    }

    .archive-teams-button {
        width: auto;
        min-width: 0;
        min-height: 52px;

        grid-template-columns:
            minmax(0, 1fr)
            16px;

        gap: 10px;

        padding:
            9px
            14px;

        border-radius: 16px;
    }

    .archive-teams-button__text small {
        font-size: 0.52rem;
        letter-spacing: 0.13em;
    }

    .archive-teams-button__text strong {
        font-size: 0.88rem;
    }

    .archive-teams-button__arrow {
        font-size: 1.2rem;
    }
}
