/* ═══════════════════════════════════════════════════════════════════
   Statistik-Zentrale — statistics.php
   ═══════════════════════════════════════════════════════════════════ */

.stx-page { max-width: 1100px; margin: 0 auto; }

.page-title {
    font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.page-title i { color: var(--accent); }

.season-info {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 1rem; min-height: 1.1rem;
}
.season-name { font-weight: 600; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; }

/* ── Hero Cards ─────────────────────────────────────────────────── */
.stx-hero {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem; margin-bottom: 1.25rem;
}
.stx-hero-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl); padding: 0.9rem 1rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    border-top: 3px solid var(--primary);
}
.stx-hero-card.gold   { border-top-color: var(--accent); }
.stx-hero-card.blue   { border-top-color: var(--info); }
.stx-hero-card.green  { border-top-color: var(--success); }
.stx-hero-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
}
.stx-hero-value { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.stx-hero-sub   { font-size: 0.72rem; color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────────── */
.stx-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl); padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.stx-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.stx-card-title {
    font-size: 1.05rem; font-weight: 700; margin: 0;
    display: flex; align-items: center; gap: 0.5rem;
}
.stx-card-title i { color: var(--accent); }
.stx-hint { font-size: 0.75rem; color: var(--text-muted); }

/* ── Haupt-Tabelle ──────────────────────────────────────────────── */
.stx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.stx-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
    white-space: nowrap;
}
.stx-table thead th {
    background: var(--gray-100); font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light);
    padding: 0.55rem 0.55rem; text-align: center;
    border-bottom: 2px solid var(--gray-200);
    position: sticky; top: 0;
}
.stx-table thead th.sortable { cursor: pointer; user-select: none; }
.stx-table thead th.sortable:hover { color: var(--primary); }
.stx-table thead th.sorted { color: var(--primary); }
.stx-table thead th.sorted::after {
    content: ' ▾'; font-size: 0.6rem;
}
.stx-table thead th.sorted.asc::after { content: ' ▴'; }
.stx-table thead th.th-left, .stx-table td.td-left { text-align: left; }

.stx-table tbody td {
    padding: 0.5rem 0.55rem; text-align: center;
    border-bottom: 1px solid var(--gray-100);
}
.stx-table tbody tr:hover { background: var(--gray-100); cursor: pointer; }
.stx-best-player-table tbody tr:hover { cursor: default; }

.stx-table .td-pos { font-weight: 700; color: var(--text-muted); width: 2rem; }
.stx-table .td-name {
    text-align: left; font-weight: 600;
    position: sticky; left: 0; background: var(--white);
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.stx-table tbody tr:hover .td-name { background: var(--gray-100); }
.stx-table .td-avg { font-weight: 800; color: var(--primary); }
.stx-table .td-strong { font-weight: 700; }
.stx-table .td-dim { color: var(--text-muted); }

.stx-row-withdrawn { opacity: 0.55; }
.stx-row-withdrawn .td-name { text-decoration: line-through; }

.stx-mini-avatar {
    display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 800;
    align-items: center; justify-content: center; margin-right: 0.45rem;
    vertical-align: middle; flex-shrink: 0;
}

/* ── Bestleistungen ─────────────────────────────────────────────── */
.stx-subtabs { display: flex; gap: 0.35rem; }
.stx-subtab {
    padding: 0.4rem 0.85rem; border: 1px solid var(--gray-200);
    background: var(--white); border-radius: var(--radius);
    font-size: 0.78rem; font-weight: 600; color: var(--text-light);
    cursor: pointer; transition: all 0.15s;
}
.stx-subtab:hover { border-color: var(--primary); color: var(--primary); }
.stx-subtab.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

.stx-best-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}
.stx-best-col {
    border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    overflow: hidden;
}
.stx-best-col-head {
    background: var(--gray-900); color: #fff; text-align: center;
    font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 0.55rem 0.5rem;
}
.stx-best-col-sub {
    background: var(--primary); color: #fff; display: flex;
    justify-content: space-between; padding: 0.4rem 0.75rem;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.stx-best-list { max-height: 340px; overflow-y: auto; }
.stx-best-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.45rem 0.75rem; font-size: 0.83rem;
    border-bottom: 1px solid var(--gray-100);
}
.stx-best-row:last-child { border-bottom: none; }
.stx-best-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.stx-best-row .val  { font-weight: 800; color: var(--primary); margin-left: 0.5rem; }
.stx-best-row .meta { font-size: 0.7rem; color: var(--text-muted); margin-left: 0.4rem; white-space: nowrap; }
.stx-best-empty { padding: 1rem 0.75rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

.stx-chip {
    display: inline-block; padding: 0.1rem 0.45rem; margin: 0.1rem 0.15rem 0.1rem 0;
    background: var(--gray-100); border-radius: 10px; font-size: 0.72rem; font-weight: 700;
}
.stx-chip.hf { background: #fef2f2; color: var(--primary); }
.stx-chip.sg { background: #eff6ff; color: var(--info); }

/* ── Spieler-Popup ──────────────────────────────────────────────── */
.stx-modal-overlay {
    position: fixed; inset: 0; background: rgba(10, 10, 15, 0.65);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: 1rem; backdrop-filter: blur(2px);
}
.stx-modal {
    background: var(--white); border-radius: var(--radius-xl);
    width: 100%; max-width: 640px; max-height: 90vh;
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.stx-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200);
}
.stx-modal-player { display: flex; align-items: center; gap: 0.75rem; }
.stx-modal-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--primary);
    color: #fff; font-weight: 800; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stx-modal-name { font-size: 1.1rem; font-weight: 800; }
.stx-modal-sub  { font-size: 0.75rem; color: var(--text-muted); }
.stx-modal-close {
    background: none; border: none; font-size: 1.6rem; line-height: 1;
    color: var(--text-muted); cursor: pointer; padding: 0.25rem;
}
.stx-modal-close:hover { color: var(--primary); }
.stx-modal-body { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; }

.stx-detail-hero {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.6rem; margin-bottom: 1rem;
}
.stx-detail-stat {
    background: var(--gray-100); border-radius: var(--radius-lg);
    padding: 0.6rem 0.7rem; text-align: center;
}
.stx-detail-stat .v { font-size: 1.15rem; font-weight: 800; }
.stx-detail-stat .v.red { color: var(--primary); }
.stx-detail-stat .l {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-top: 0.1rem;
}

.stx-detail-section { margin-bottom: 1.1rem; }
.stx-detail-title {
    font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-light); margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.stx-detail-title i { color: var(--accent); font-size: 0.8rem; }

.stx-chart-wrap { position: relative; height: 200px; }

.stx-form { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.stx-form-badge {
    width: 26px; height: 26px; border-radius: 50%; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 800;
}
.stx-form-badge.W { background: var(--success); }
.stx-form-badge.L { background: var(--danger); }
.stx-form-badge.D { background: var(--warning); }

.stx-match-list { font-size: 0.82rem; }
.stx-match-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.4rem 0; border-bottom: 1px solid var(--gray-100);
}
.stx-match-row:last-child { border-bottom: none; }
.stx-match-row .day { color: var(--text-muted); font-size: 0.72rem; width: 3.2rem; flex-shrink: 0; }
.stx-match-row .opp { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.stx-match-row .score { font-weight: 800; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stx-hero { grid-template-columns: repeat(2, 1fr); }
    .stx-hero-value { font-size: 1.2rem; }
    .stx-card { padding: 0.9rem; }
    .stx-table { font-size: 0.78rem; }
    .stx-table .td-name { max-width: 130px; }
    .stx-modal { max-height: 94vh; }
    .hide-mobile { display: none; }
}
