/* ==========================================================
   HERO HEADER BEREICH
   ========================================================== */
.hero-header-wrap { width: 100%; max-width: 1200px; margin: 30px auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; position: relative; }
.hero-header-img-box { width: 100%; height: 480px; position: relative; margin-bottom: 50px; }
.hero-header-card { position: absolute; bottom: -40px; left: 30px; right: 30px; background: rgba(32, 26, 64, 0.96); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 22px 28px; color: #ffffff; box-shadow: 0 12px 32px rgba(0,0,0,0.5); z-index: 99; box-sizing: border-box; }

.hero-header-img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 16px; display: block; }
.hero-header-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr; align-items: center; gap: 15px; }
.hero-identity { display: flex; align-items: center; gap: 14px; border-right: 1px solid rgba(255, 255, 255, 0.12); padding-right: 15px; }
.hero-identity-logo { width: 48px; height: 48px; object-fit: contain; }
.hero-identity-title { font-size: 19px; font-weight: 800; color: #ffffff; line-height: 1.2; margin: 0; }
.hero-stat { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid rgba(255, 255, 255, 0.08); padding-right: 10px; }
.hero-stat:last-child { border-right: none; }
.hero-stat-lbl { font-size: 12px; color: #b3b3b3; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-stat-val { font-size: 16px; font-weight: 700; color: #ffffff; }

/* ==========================================================
   SEKTIONS-TITEL
   ========================================================== */
.section-title { font-size: 22px; font-weight: 800; color: #ffffff; margin-bottom: 16px; }
.group-title { font-size: 18px; font-weight: 700; color: #9d81f2; margin: 24px 0 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 6px; }

/* ==========================================================
   TABELLE & MATCHES BEREICH
   ========================================================== */
.table-matches-container { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; width: 100%; max-width: 1200px; margin: 0 auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }

.mini-table-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 16px; box-sizing: border-box; }
.mini-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; color: #ffffff; }
.mini-table th { font-size: 11px; text-transform: uppercase; color: #a0a0b0; padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.mini-table td { padding: 10px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table .highlight-my-team { background: rgba(157, 129, 242, 0.2); font-weight: 700; }
.mini-table-team { display: flex; align-items: center; gap: 8px; }
.mini-table-logo { width: 22px; height: 22px; object-fit: contain; }

.matches-widget-list { display: flex; flex-direction: column; gap: 12px; }
.match-box-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 12px 16px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; position: relative; }
.match-box-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 8px; width: fit-content; }
.tag-last { background: rgba(255, 255, 255, 0.1); color: #b3b3b3; }
.tag-upcoming { background: rgba(157, 129, 242, 0.25); color: #9d81f2; }
.tag-next { background: rgba(255, 255, 255, 0.06); color: #808095; }

.match-box-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.match-team { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #ffffff; }
.match-team.away { justify-content: flex-end; }
.match-team-logo { width: 26px; height: 26px; object-fit: contain; }
.match-center { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.match-score { font-size: 18px; font-weight: 800; color: #ffffff; line-height: 1; }
.match-time { font-size: 13px; font-weight: 700; color: #ffffff; line-height: 1; }
.match-date { font-size: 10px; color: #a0a0b0; margin-top: 3px; }

/* ==========================================================
   HIGHLIGHTS (REKORDE) & STATS
   ========================================================== */
.highlights-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; max-width: 1200px; margin: 0 auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }
.highlight-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; position: relative; height: 72px; box-sizing: border-box; min-width: 0; overflow: visible; }
.highlight-img-wrap { width: 62px; height: 78px; position: relative; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; overflow: visible; }
.highlight-player-img { width: auto; height: 100%; max-width: 68px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.highlight-info { display: flex; flex-direction: column; justify-content: center; flex: 1; margin-left: 10px; margin-right: 8px; min-width: 0; overflow: hidden; }
.highlight-label { font-size: 10px; font-weight: 700; color: #a0a0b0; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.highlight-name { font-size: 14px; font-weight: 800; color: #ffffff; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.highlight-badge { background: rgba(157, 129, 242, 0.25); border: 1px solid rgba(157, 129, 242, 0.4); border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.highlight-badge-icon { font-size: 13px; display: flex; align-items: center; justify-content: center; }
.highlight-badge-val { font-size: 14px; font-weight: 800; color: #ffffff; line-height: 1; }

.stats-container { width: 100%; max-width: 1200px; margin: 0 auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-box-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; box-sizing: border-box; }
.stat-box-value { font-size: 28px; font-weight: 800; color: #ffffff; margin-bottom: 4px; line-height: 1; }
.stat-box-label { font-size: 13px; color: #a0a0b0; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ==========================================================
   TRIKOTS & AUFSTELLUNG (PITCH)
   ========================================================== */
.kits-lineup-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 1200px; margin: 0 auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }
.kits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.kit-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; height: 380px; box-sizing: border-box; }
.kit-img-wrap { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.kit-img { width: 100%; height: 100%; max-height: 300px; object-fit: contain; }
.kit-info { border-top: 1px dashed rgba(255, 255, 255, 0.15); padding-top: 12px; margin-top: 10px; }
.kit-type { font-size: 18px; font-weight: 700; color: #ffffff; margin: 0; }
.kit-sub { font-size: 12px; color: #a0a0b0; margin-top: 2px; }

/* DAS SPIELFELD */
.pitch-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; height: 380px; position: relative; overflow: hidden; box-sizing: border-box; }
.pitch-svg { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.pitch-players { position: relative; width: 100%; height: 100%; z-index: 2; }

/* DIE SPIELER (Größer & besser lesbar) */
.pitch-player-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; width: 110px; text-align: center; }
.pitch-player-img { width: 75px; height: 75px; object-fit: contain; background: transparent; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.pitch-player-divider { width: 40px; height: 1px; background: rgba(255, 255, 255, 0.25); margin: 3px 0 2px 0; }
.pitch-player-name { font-size: 12px; font-weight: 700; color: #ffffff; text-shadow: 0 2px 4px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* POSITIONEN (Tormann und Abwehr weiter nach unten gezogen) */
.pos-seq-1 { top: 80%; left: 50%; } /* Tormann tief in den Strafraum */
.pos-seq-2 { top: 62%; left: 18%; } /* Linksverteidiger weiter runter */
.pos-seq-3 { top: 45%; left: 50%; } /* Innenverteidiger weiter runter */
.pos-seq-4 { top: 62%; left: 82%; } /* Rechtsverteidiger weiter runter */
.pos-seq-5 { top: 22%; left: 33%; } /* Stürmer links */
.pos-seq-6 { top: 22%; left: 67%; } /* Stürmer rechts */

/* ==========================================================
   KADER / PANINI KARTEN
   ========================================================== */
.squad-container { width: 100%; max-width: 1200px; margin: 0 auto 40px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }

.squad-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 16px; 
    width: 100%; 
    padding: 10px 0;
    box-sizing: border-box; 
}

/* PANINI KARTE (als Container für stufenlose cqi Skalierung) */
.panini-card { 
    position: relative; 
    width: 100%; 
    max-width: 220px; 
    aspect-ratio: 400 / 580; 
    background-image: url('storage/Player-Card-Socca-3.png'); 
    background-size: 100% 100%; 
    background-repeat: no-repeat; 
    font-family: 'Jost', sans-serif; 
    box-sizing: border-box; 
    overflow: visible; 
    margin: 15px auto 0 auto; 
    transition: transform 0.3s ease; 
    container-type: inline-size; 
}
.panini-card:hover { transform: translateY(-6px); }

.card-player-img { position: absolute; bottom: 45%; left: 5%; width: 90%; height: 60%; object-fit: contain; object-position: bottom center; z-index: 2; pointer-events: none; }
.card-name-box { position: absolute; top: 55%; left: 10%; width: 80%; text-align: center; z-index: 3; padding: 3cqi 4cqi; box-sizing: border-box; }
.card-fname { font-size: 5.5cqi; font-weight: 600; color: #d0c4f2; text-transform: uppercase; letter-spacing: 0.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-lname { font-size: 8.5cqi; font-weight: 900; color: #ffffff; text-transform: uppercase; letter-spacing: 0.8px; display: block; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.card-stats-row { position: absolute; bottom: 10%; left: -1%; width: 88%; display: flex; justify-content: space-between; z-index: 3; }
.stat-val { width: 25%; text-align: left; padding-left: 12%; font-size: 8.5cqi; font-weight: 900; color: #ffffff; text-shadow: 0 2px 3px rgba(0,0,0,0.6); }

.card-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('storage/Player-Card-Overlay.png'); background-size: 100% 100%; z-index: 4; pointer-events: none; }

.left-info-container { position: absolute; top: 12%; left: 6%; width: 22%; display: flex; flex-direction: column; align-items: center; gap: 4cqi; z-index: 5; }
.card-number { font-size: 10cqi; font-weight: 900; color: #ffffff; text-shadow: 0 2px 4px rgba(0,0,0,0.6); line-height: 1; }
.card-flag { width: 14cqi; height: 9cqi; object-fit: cover; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.card-age-box { text-align: center; line-height: 1.1; }
.card-age-val { display: block; font-size: 7cqi; font-weight: 900; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.card-age-lbl { display: block; font-size: 4.5cqi; font-weight: 700; color: #d0c4f2; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }


/* ==========================================================
   TEAM SAISON REITER & TITEL
   ========================================================== */
.team-history-container { width: 100%; max-width: 1200px; margin: 40px auto 60px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }
.team-history-title { font-size: 22px; font-weight: 800; color: #ffffff; margin-bottom: 16px; }

.team-tabs-bar { display: flex; gap: 8px; overflow-x: auto; padding: 6px; background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; margin-bottom: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.team-tabs-bar::-webkit-scrollbar { display: none; }

.team-tab-btn { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; background: transparent; border: 1px solid transparent; color: #a0a0b0; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s ease-in-out; white-space: nowrap; flex-shrink: 0; }
.team-tab-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
.team-tab-btn.active { background: #9d81f2; color: #ffffff; border-color: #9d81f2; box-shadow: 0 4px 12px rgba(157, 129, 242, 0.3); }

.team-tab-content { display: none; }
.team-tab-content.active { display: block; }

.team-league-header { display: flex; align-items: center; gap: 12px; background: rgba(32, 26, 64, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; }
.team-league-logo { width: 28px; height: 28px; object-fit: contain; }
.team-league-title { font-size: 16px; font-weight: 800; color: #ffffff; margin: 0; }

.team-matches-table-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 16px; overflow-x: auto; }
.team-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #ffffff; text-align: left; }
.team-table th { font-size: 11px; text-transform: uppercase; color: #a0a0b0; padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.team-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.team-table tr:last-child td { border-bottom: none; }

.t-team-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.t-team-logo { width: 22px; height: 22px; object-fit: contain; }

.match-score-badge { display: inline-block; background: rgba(157, 129, 242, 0.25); border: 1px solid rgba(157, 129, 242, 0.4); border-radius: 6px; padding: 4px 10px; font-size: 13px; font-weight: 800; color: #ffffff; text-decoration: none; transition: all 0.2s ease-in-out; }
.match-score-badge:hover { background: #9d81f2; color: #ffffff; box-shadow: 0 4px 12px rgba(157, 129, 242, 0.4); transform: translateY(-1px); }

.performer-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #ffffff; }
.performer-cnt { background: rgba(255,255,255,0.12); padding: 2px 6px; border-radius: 4px; font-size: 11px; }

a.app-link { color: inherit; text-decoration: none; transition: color 0.15s ease-in-out; }
a.app-link:hover { color: #9d81f2; text-decoration: underline; }

.titles-container { width: 100%; max-width: 1200px; margin: 0 auto 50px auto; font-family: 'Jost', sans-serif; box-sizing: border-box; }
.titles-grid { display: flex; flex-direction: column; gap: 12px; }
.title-card { background: rgba(32, 26, 64, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 16px 24px; display: flex; align-items: center; gap: 20px; box-sizing: border-box; }
.title-cup-img { width: 50px; height: 60px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); }
.title-info { display: flex; flex-direction: column; justify-content: center; }
.title-league { font-size: 18px; font-weight: 800; color: #ffffff; line-height: 1.2; }
.title-season { font-size: 13px; font-weight: 600; color: #9d81f2; margin-top: 4px; }


/* ==========================================================
   EINMALIGE AUFPOP-ANIMATIONEN (TRIGGER ERST BEIM ERREICHEN)
   ========================================================== */
.pop-card, .pop-row, .pop-hl-card {
    opacity: 0;
    will-change: transform, opacity;
}

.pop-card.is-visible {
    animation: popUpStay 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popUpStay {
    0% { opacity: 0; transform: translateY(35px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.pop-row.is-visible {
    animation: popRowStay 0.4s ease-out forwards;
}

@keyframes popRowStay {
    0% { opacity: 0; transform: translateY(-12px); }
    100% { opacity: 1; transform: translateY(0); }
}

.pop-hl-card.is-visible {
    animation: popUpStay 0.5s ease-out forwards;
}

.pop-hl-card .highlight-player-img {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pop-hl-card.is-visible .highlight-player-img {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.1s;
}

.pop-hl-card .highlight-info, .pop-hl-card .highlight-badge {
    opacity: 0;
    transform: translateX(15px);
    transition: all 0.4s ease-out;
}

.pop-hl-card.is-visible .highlight-info, .pop-hl-card.is-visible .highlight-badge {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.3s;
}


/* ==========================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================== */
@media (max-width: 1100px) { 
    .highlights-container { grid-template-columns: repeat(2, 1fr); } 
}

@media (max-width: 900px) {
    .kit-card { height: 300px; padding: 8px; }
    .kit-img { max-height: 230px; }
    .team-table, .team-table th, .team-table td, .t-team-cell, .performer-badge { white-space: nowrap !important; }
    .section-title, .group-title, .team-history-title { padding-left: 15px; padding-right: 15px; }
    .hero-header-wrap { margin-bottom: 30px; }
    .hero-header-img-box { height: auto; margin-bottom: 20px; }
    .hero-header-img { height: 260px; }
    .hero-header-card { position: relative !important; bottom: auto !important; left: 0 !important; right: 0 !important; margin: -40px 15px 0 15px; padding: 16px; background: rgba(32, 26, 64, 0.96); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; color: #ffffff; box-shadow: 0 12px 32px rgba(0,0,0,0.5); z-index: 99; box-sizing: border-box; }
    .hero-header-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .table-matches-container { grid-template-columns: 1fr; padding-left: 15px; padding-right: 15px; }
    .stats-container, .highlights-container, .kits-lineup-container, .squad-container, .titles-container, .team-history-container { padding-left: 15px; padding-right: 15px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .kits-lineup-container { grid-template-columns: 1fr; }
    
    /* PANINI CAROUSEL AB TABLET (Killt das Grid) */
    .squad-grid { 
        display: flex; 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        scroll-snap-type: x mandatory; 
        gap: 16px; 
        padding: 10px 0 15px 0; 
        scrollbar-width: none; 
        -webkit-overflow-scrolling: touch;
    }
    .squad-grid::-webkit-scrollbar { display: none; }
    .squad-grid .panini-card { 
        flex: 0 0 200px; 
        scroll-snap-align: start; 
    }
}

@media (max-width: 600px) {
    .highlights-container { grid-template-columns: 1fr; gap: 20px; }
    .highlight-card { height: 80px; padding: 10px 14px; }
    .highlight-img-wrap { width: 68px; height: 100%; align-items: flex-end; }
    .highlight-player-img { max-height: 90px; height: auto; object-fit: contain; }
    
    /* PANINI CAROUSEL FÜR HANDYS (Exakt 2 Karten + Anschnitt) */
    .squad-grid { 
        gap: 12px; 
        padding: 10px 15px 16px 15px; 
        margin: 0 -15px; 
    }
    .squad-grid .panini-card { 
        flex: 0 0 42vw;  /* Genau 2.3 Karten auf dem Display */
        max-width: 170px; /* Begrenzung, damit sie nicht mutieren */
        margin: 10px 0 0 0; 
    }
}