/* ---------------------------------------------------------
   Bakšiš Toplista
--------------------------------------------------------- */

.tips-list {
    display: grid;
    gap: 14px;
}


/* ---------------------------------------------------------
   Grundelement
--------------------------------------------------------- */

.tips-item {
    position: relative;

    display: grid;
    grid-template-columns:
        130px
        96px
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 24px;

    min-width: 0;

    padding:
        16px
        28px
        16px
        18px;

    overflow: visible;

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

    border:
        1px solid var(--line);

    border-radius: 24px;

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


/* ---------------------------------------------------------
   Hover wie Odigrani termini
--------------------------------------------------------- */

.tips-item:hover {
    transform: translateX(6px);

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


/* ---------------------------------------------------------
   Podium 1–3
--------------------------------------------------------- */

.tips-item--podium {
    min-height: 132px;
}


/* Platz 1 */

.tips-item--rank-1 {
    background:
        linear-gradient(
            90deg,
            rgba(212, 175, 55, 0.14),
            rgba(212, 175, 55, 0.035) 45%,
            rgba(255, 255, 255, 0.025)
        );

    border-color:
        rgba(255, 211, 64, 0.58);

    box-shadow:
        0 0 34px rgba(212, 175, 55, 0.08);
}

.tips-item--rank-1:hover {
    border-color:
        rgba(255, 215, 65, 0.9);

    box-shadow:
        0 0 44px rgba(212, 175, 55, 0.16);
}


/* Platz 2 */

.tips-item--rank-2 {
    background:
        linear-gradient(
            90deg,
            rgba(200, 208, 216, 0.1),
            rgba(200, 208, 216, 0.025) 45%,
            rgba(255, 255, 255, 0.02)
        );

    border-color:
        rgba(205, 215, 225, 0.45);
}

.tips-item--rank-2:hover {
    border-color:
        rgba(225, 232, 240, 0.75);
}


/* Platz 3 */

.tips-item--rank-3 {
    background:
        linear-gradient(
            90deg,
            rgba(205, 127, 50, 0.13),
            rgba(205, 127, 50, 0.03) 45%,
            rgba(255, 255, 255, 0.02)
        );

    border-color:
        rgba(205, 127, 50, 0.55);
}

.tips-item--rank-3:hover {
    border-color:
        rgba(232, 147, 70, 0.85);
}


/* ---------------------------------------------------------
   Pokal
--------------------------------------------------------- */

.tips-item__position {
    display: grid;
    place-items: center;

    width: 130px;
    min-width: 0;
}

.tips-item__trophy {
    display: block;

    width: 116px;
    height: 108px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 10px 18px rgba(0, 0, 0, 0.32)
        );

    transition:
        transform 180ms ease,
        filter 180ms ease;
}

.tips-item:hover .tips-item__trophy {
    transform:
        translateY(-2px)
        scale(1.045);
}


/* Gold etwas stärker */

.tips-item--rank-1 .tips-item__trophy {
    filter:
        drop-shadow(
            0 8px 20px rgba(255, 196, 0, 0.28)
        );
}


/* ---------------------------------------------------------
   Spielerbild
--------------------------------------------------------- */

.tips-item__player {
    position: relative;

    width: 88px;
    height: 88px;

    overflow: hidden;

    background:
        var(--bg-soft);

    border:
        2px solid var(--line);

    border-radius: 50%;

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.26);

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

.tips-item__player img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* passende Rahmenfarben */

.tips-item--rank-1 .tips-item__player {
    border-color:
        rgba(255, 211, 64, 0.78);
}

.tips-item--rank-2 .tips-item__player {
    border-color:
        rgba(210, 220, 230, 0.72);
}

.tips-item--rank-3 .tips-item__player {
    border-color:
        rgba(205, 127, 50, 0.78);
}


.tips-item:hover .tips-item__player {
    transform: scale(1.055);
}


/* ---------------------------------------------------------
   Name
--------------------------------------------------------- */

.tips-item__name {
    min-width: 0;

    color: var(--text);

    font-size:
        clamp(1.65rem, 2.2vw, 2.35rem);

    font-weight: 900;

    line-height: 1;

    letter-spacing:
        -0.035em;
}


/* ---------------------------------------------------------
   Betrag
--------------------------------------------------------- */

.tips-item__amount {
    min-width: 170px;

    text-align: right;

    white-space: nowrap;

    color: var(--text);

    font-size:
        clamp(2rem, 3vw, 3.3rem);

    font-weight: 900;

    line-height: 1;

    letter-spacing:
        -0.045em;
}


/* Gold */

.tips-item--rank-1 .tips-item__amount {
    color: #f6cf52;

    text-shadow:
        0 0 24px rgba(246, 207, 82, 0.14);
}


/* Silber */

.tips-item--rank-2 .tips-item__amount {
    color: #d4dde5;
}


/* Bronze */

.tips-item--rank-3 .tips-item__amount {
    color: #df9457;
}


/* ---------------------------------------------------------
   Platz 4+
--------------------------------------------------------- */

.tips-item--regular {
    grid-template-columns:
        70px
        58px
        minmax(0, 1fr)
        auto;

    min-height: 78px;

    padding:
        10px
        22px;
}

.tips-item--regular .tips-item__position {
    width: 70px;
}

.tips-item__number {
    color: var(--muted);

    font-size: 1.6rem;
    font-weight: 900;
}

.tips-item--regular .tips-item__player {
    width: 54px;
    height: 54px;

    border-width: 1px;
}

.tips-item--regular .tips-item__name {
    font-size: 1.3rem;
}

.tips-item--regular .tips-item__amount {
    min-width: 120px;

    font-size: 1.55rem;
}


/* ---------------------------------------------------------
   Bakšiš Toplista – Mobile
--------------------------------------------------------- */

@media (max-width: 760px) {

    #baksis .section-header {
        margin-bottom: 24px;
    }

    .tips-list {
        gap: 10px;
    }

    /* Top 3 */
    .tips-item {
        grid-template-columns:
            68px
            58px
            minmax(0, 1fr)
            auto;

        gap: 10px;

        min-height: 94px;

        padding:
            10px
            14px;

        border-radius: 20px;
    }

    .tips-item__position {
        width: 68px;
    }

    .tips-item__trophy {
        width: 68px;
        height: 74px;

        object-fit: contain;
    }

    .tips-item__player {
        width: 56px;
        height: 56px;

        border-width: 2px;
    }

    .tips-item__name {
        font-size: 1.22rem;
        line-height: 1.05;

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

    .tips-item__amount {
        min-width: 0;

        font-size: 1.45rem;
        line-height: 1;

        white-space: nowrap;
    }


    /* Platz 4+ */

    .tips-item--regular {
        grid-template-columns:
            34px
            48px
            minmax(0, 1fr)
            auto;

        min-height: 66px;

        gap: 9px;

        padding:
            8px
            12px;

        border-radius: 17px;
    }

    .tips-item--regular .tips-item__position {
        width: 34px;
    }

    .tips-item__number {
        font-size: 1.18rem;
    }

    .tips-item--regular .tips-item__player {
        width: 44px;
        height: 44px;
    }

    .tips-item--regular .tips-item__name {
        font-size: 1rem;
    }

    .tips-item--regular .tips-item__amount {
        min-width: 0;

        font-size: 1.08rem;
    }
}


/* ---------------------------------------------------------
   Sehr kleine Smartphones
--------------------------------------------------------- */

@media (max-width: 430px) {

    .tips-item {
        grid-template-columns:
            62px
            52px
            minmax(0, 1fr)
            auto;

        gap: 8px;

        min-height: 88px;

        padding:
            8px
            10px;
    }

    .tips-item__position {
        width: 62px;
    }

    .tips-item__trophy {
        width: 62px;
        height: 68px;
    }

    .tips-item__player {
        width: 50px;
        height: 50px;
    }

    .tips-item__name {
        font-size: 1.08rem;
    }

    .tips-item__amount {
        grid-column: auto;

        margin-top: 0;

        font-size: 1.28rem;
    }


    /* Platz 4+ */

    .tips-item--regular {
        grid-template-columns:
            30px
            42px
            minmax(0, 1fr)
            auto;

        gap: 7px;

        min-height: 60px;

        padding:
            7px
            9px;
    }

    .tips-item--regular .tips-item__position {
        width: 30px;
    }

    .tips-item--regular .tips-item__player {
        width: 40px;
        height: 40px;
    }

    .tips-item--regular .tips-item__name {
        font-size: 0.95rem;
    }

    .tips-item--regular .tips-item__amount {
        grid-column: auto;

        font-size: 1rem;
    }
}

/* ---------------------------------------------------------
   Ekipe / Mannschaften
--------------------------------------------------------- */

.teams-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
}

.team-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 22px;
    min-width: 0;
    padding: 22px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.team-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-bright), var(--green-deep));
}

.team-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.team-card__badge {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    color: #07110d;
    background: var(--green-bright);
    border-radius: 16px;
    font-size: 1.35rem;
    font-weight: 950;
    box-shadow: 0 12px 32px rgba(184, 239, 87, 0.16);
}

.team-card__header > div {
    display: grid;
    gap: 2px;
}

.team-card__header span:not(.team-card__badge) {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.15em;
}

.team-card__header strong {
    font-size: 1.55rem;
    line-height: 1;
}

.team-card__group,
.team-card__reserve {
    display: grid;
    gap: 11px;
}

.team-card__group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.team-card__group-title small {
    color: var(--green-bright);
    font-size: 0.68rem;
    letter-spacing: normal;
}

.team-card__players {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: team-player;
}

.team-card__players li {
    counter-increment: team-player;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;
}

.team-card__player-number::before {
    content: counter(team-player);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--green-bright);
    background: rgba(184, 239, 87, 0.08);
    border: 1px solid rgba(184, 239, 87, 0.17);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 900;
}

.team-card__players strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 1rem;
}

.team-card__reserve {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.team-card__reserve-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-card__reserve-list span,
.team-card__empty {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.team-card__reserve-list span {
    color: var(--text);
}

@media (max-width: 1100px) {
    .teams-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .teams-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .team-card,
    .team-card:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .team-card {
        padding: 18px;
        border-radius: 22px;
    }
}

/* ---------------------------------------------------------
   Ekipe / Spielfeldansicht FINAL
   Gedrehtes feld.webp, zentrierte 2-2-1-Formation
--------------------------------------------------------- */

.teams-grid--pitch {
    align-items: start;
}

/* Mannschaftskarte bleibt offen; nur der Teamkopf ist eingerahmt. */
.team-card--pitch {
    gap: 14px;
    min-width: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.team-card--pitch::before {
    display: none;
}

.team-card--pitch .team-card__header {
    min-height: 70px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.team-card--pitch .team-card__header strong {
    font-size: clamp(1.25rem, 1.7vw, 1.65rem);
}

/*
 * feld.webp ist bereits physisch richtig gedreht: Tor unten.
 * Das Bild liegt direkt als Hintergrund im Container.
 * Keine Rotation, keine Gegenrotation, kein Pseudo-Element.
 */
.team-pitch {
    position: relative;
    width: 100%;
    aspect-ratio: 581 / 800;
    min-height: 0;
    overflow: visible;

    background-image: url('/assets/images/misc/feld.webp');
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;

    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* ---------------------------------------------------------
   Spieler / Formation
--------------------------------------------------------- */

.team-player {
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    text-align: center;
}

/*
 * Alle fünf Starter liegen in EINEM Raster.
 * Gleicher Abstand oben/unten und links/rechts = Formation als Ganzes
 * mittig auf dem 581 x 800 Spielfeld.
 */
.team-formation {
    position: absolute;
    inset: 17% 9%;
    z-index: 2;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    column-gap: 14%;
    row-gap: 0;
}

.team-formation .team-player {
    position: relative;
}

/* Fünfter Starter mittig in der dritten Reihe. */
.team-player--center {
    grid-column: 1 / -1;
    justify-self: center;
}

/* Feste Rastergröße verhindert unterschiedlich interpolierte Logos. */
.team-player__photo {
    width: 72px;
    height: 72px;
    overflow: hidden;
    background: rgba(7, 18, 14, 0.9);
    border: 3px solid var(--green-bright);
    border-radius: 50%;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.42),
        0 0 0 4px rgba(7, 18, 14, 0.42);
}

.team-player__photo img,
.team-reserve-player__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-player strong {
    min-width: 72px;
    max-width: 160px;
    padding: 5px 12px;
    overflow: hidden;
    color: #fff;
    background: rgba(5, 15, 10, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.team-player small {
    display: none;
}

/* ---------------------------------------------------------
   Reserve / dynamisches Raster
--------------------------------------------------------- */

.team-card--pitch .team-card__reserve {
    display: grid;
    gap: 11px;
    margin-top: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
}

.team-card__group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.team-card__group-title small {
    display: none;
}

.team-card__reserve-list--players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.team-reserve-player {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 14px;
}

/* Ein Spieler nutzt die komplette Breite. */
.team-card__reserve-list--players .team-reserve-player:only-child {
    grid-column: 1 / -1;
}

/* Bei 3, 5, 7 ... Spielern nutzt der letzte die volle letzte Reihe. */
.team-card__reserve-list--players
    .team-reserve-player:last-child:nth-child(odd):not(:first-child) {
    grid-column: 1 / -1;
}

.team-reserve-player__photo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid rgba(184, 239, 87, 0.28);
    border-radius: 50%;
}

.team-reserve-player strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-card__empty {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 54px;
    padding: 10px 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 800;
}

/* ---------------------------------------------------------
   Teilen
--------------------------------------------------------- */

.teams-section__controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.teams-share-button {
    min-width: 176px;
    cursor: pointer;
}

.teams-share-button[disabled] {
    cursor: wait;
    opacity: 0.7;
}

.teams-share-status {
    min-height: 1em;
    max-width: 260px;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
    text-align: right;
}

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

@media (max-width: 760px) {
    .team-card--pitch {
        padding: 0;
    }

    .team-player__photo {
        width: 68px;
        height: 68px;
    }

    .team-player strong {
        max-width: 145px;
        font-size: 1.05rem;
    }

    .teams-section__controls {
        align-items: stretch;
        width: 100%;
    }

    .teams-section__controls .date-pill {
        align-self: flex-start;
    }

    .teams-share-button {
        width: 100%;
        min-width: 0;
    }

    .teams-share-status {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 430px) {
    .team-player__photo {
        width: 58px;
        height: 58px;
    }

    .team-player strong {
        min-width: 68px;
        max-width: 132px;
        padding: 4px 10px;
        font-size: 0.95rem;
    }
}
