.ta-panel { margin: 1.5rem 0; padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid #dce5ef; border-radius: 18px; background: #fff; color: #22334b; box-shadow: 0 8px 28px #18365308; }
.ta-heading h2 { font-size: 1.4rem; font-weight: 750; margin: .3rem 0 .5rem; }
.ta-heading p, .ta-status, .ta-note { color: #52647a; line-height: 1.6; }
.ta-eyebrow { font-size: .73rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: #316d98; }
.ta-controls { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.25rem 0; align-items: end; }
.ta-controls label { flex: 1 1 150px; font-size: .8rem; font-weight: 650; }
.ta-controls label:first-child { flex-grow: 1.4; }
.ta-controls .form-select, .ta-controls .form-control { margin-top: .35rem; font-size: .88rem; }
.ta-leaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin: 1rem 0 1.35rem; }
.ta-leaders:empty { display: none; }
.ta-leader {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
    padding: clamp(.75rem, 2vw, 1.1rem);
    text-align: left;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: linear-gradient(145deg, #f2f7fd, #fff 70%);
    box-shadow: 0 3px 12px #1635530d;
    color: #243e59;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.ta-leader:hover { border-color: #87acd1; box-shadow: 0 5px 16px #1635531a; }
.ta-leader.is-active { border-color: #317bb1; background: linear-gradient(145deg, #e6f2ff, #fff 85%); box-shadow: inset 0 0 0 1px #317bb1; }
.ta-leader-top, .ta-leader-figure { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.ta-leader-top { justify-content: space-between; color: #2c628f; }
.ta-leader-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: #deebf9; }
.ta-leader-label { font-size: .82rem; font-weight: 700; overflow-wrap: anywhere; }
.ta-leader-figure { align-items: baseline; color: #405970; font-size: .73rem; }
.ta-leader-figure strong { color: #123451; font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ta-leader .ta-leader-team { margin-top: auto; padding-top: .5rem; border-top: 1px solid #dde7f1; font-size: .78rem; font-weight: 600; overflow-wrap: anywhere; }
.ta-leader:focus-visible, .ta-table-wrap:focus-visible { outline: 3px solid #2378b8; outline-offset: 3px; }
.ta-table-wrap { overflow-x: auto; border: 1px solid #e0e7ef; border-radius: 12px; }
.ta-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; font-variant-numeric: tabular-nums; }
.ta-table caption { caption-side: top; padding: .8rem 1rem; color: #52647a; font-size: .8rem; }
.ta-table th, .ta-table td { padding: .75rem .85rem; border-bottom: 1px solid #edf1f5; text-align: right; vertical-align: middle; white-space: nowrap; }
.ta-table thead th { background: #f1f5f9; color: #425872; font-size: .77rem; }
.ta-table th:nth-child(2), .ta-table tbody th { text-align: left; }
.ta-table tbody th { font-weight: 550; }
.ta-table tbody tr:last-child > * { border-bottom: 0; }
.ta-table tbody tr:hover > * { background-color: #f4f9fc; }
.ta-team { display: inline-flex; align-items: center; gap: .45rem; white-space: normal; }
.ta-badge { width: 23px; height: 23px; object-fit: contain; flex: 0 0 23px; }
.ta-value { color: #12669b; font-weight: 750; }
.ta-table progress { width: 100%; min-width: 75px; max-width: 160px; height: 9px; border: 0; border-radius: 10px; overflow: hidden; background: #e6eef5; accent-color: #2d8ab8; }
.ta-table progress::-webkit-progress-bar { background: #e6eef5; }
.ta-table progress::-webkit-progress-value { background: linear-gradient(90deg, #66bcb6, #297daf); border-radius: 10px; }
.ta-table progress::-moz-progress-bar { background: #297daf; }
.ta-table th button { font: inherit; font-weight: 700; border: 0; background: transparent; color: inherit; padding: .25rem; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.ta-players { min-width: 1030px; }
.ta-players th:nth-child(2) { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 185px; max-width: 260px; white-space: normal; box-shadow: 4px 0 7px #243c5610; }
.ta-players thead th:nth-child(2) { background: #f1f5f9; }
.ta-players small { display: flex; flex-direction: column; gap: .25rem; color: #52647a; font-weight: 400; font-size: .74rem; margin-top: .25rem; }
.ta-note { font-size: .76rem; margin: 1rem 0 0; }
.ta-status, .ta-empty { font-size: .85rem; }
.ta-empty { padding: 1rem; }
@media (max-width: 575.98px) { .ta-leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ta-panel { border-radius: 12px; } .ta-table th, .ta-table td { padding: .6rem; } .ta-players th:nth-child(2) { min-width: 140px; max-width: 180px; } .ta-controls label { flex-basis: 130px; } }

.ta-card-count { display: inline-block; padding: .15rem .5rem; border-radius: 6px; font-weight: 750; }
.ta-card-yellow { background: #fff1b9; color: #704d00; }
.ta-card-red, .ta-card-dismissals { background: #fbe1e2; color: #a12936; }

/* Match Statistics uses the same palette on the public and signed-in pages. */
.ta-panel[data-tournament-analytics="teams"] {
    --ta-navy: #142d45;
    --ta-teal: #11635d;
    background: #edf3f8;
    border-color: #d0ddea;
    box-shadow: 0 12px 30px #19385412;
}

[data-tournament-analytics="teams"] .ta-heading {
    padding: clamp(1.15rem, 4vw, 2rem);
    border-radius: 14px;
    background: linear-gradient(110deg, var(--ta-navy) 24%, #164e59 75%, var(--ta-teal));
    box-shadow: inset 0 1px 0 #ffffff26;
    color: #fff;
}

[data-tournament-analytics="teams"] .ta-heading h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -.02em;
}

[data-tournament-analytics="teams"] .ta-heading p {
    max-width: 58ch;
    margin-bottom: 0;
    color: #e0edf3;
}

[data-tournament-analytics="teams"] .ta-eyebrow { color: #a9eddb; }

.ta-leader[data-ta-pick="possession"] { --tile-accent: #0e6b60; --tile-bg: #e4f5ee; --tile-icon: #c9eade; }
.ta-leader[data-ta-pick="shots"] { --tile-accent: #215e9c; --tile-bg: #e5f0fd; --tile-icon: #cddff7; }
.ta-leader[data-ta-pick="target"] { --tile-accent: #63459b; --tile-bg: #f1eafa; --tile-icon: #e3d6f5; }
.ta-leader[data-ta-pick="corners"] { --tile-accent: #89501b; --tile-bg: #fbefd9; --tile-icon: #f3dfb7; }
.ta-leader[data-ta-pick="passing"] { --tile-accent: #16647f; --tile-bg: #e3f3f8; --tile-icon: #c9e8f1; }
.ta-leader[data-ta-pick="saves"] { --tile-accent: #963d60; --tile-bg: #faeaf0; --tile-icon: #f2d4e0; }

[data-tournament-analytics="teams"] .ta-leader {
    border-top: 3px solid var(--tile-accent);
    background: linear-gradient(155deg, var(--tile-bg), #fff 120%);
    box-shadow: 0 4px 12px #19385412;
}

[data-tournament-analytics="teams"] .ta-leader:hover,
[data-tournament-analytics="teams"] .ta-leader.is-active {
    border-color: var(--tile-accent);
}

[data-tournament-analytics="teams"] .ta-leader.is-active {
    background: var(--tile-bg);
    box-shadow: inset 0 0 0 1px var(--tile-accent), 0 5px 14px #1938541a;
}

[data-tournament-analytics="teams"] .ta-leader-top,
[data-tournament-analytics="teams"] .ta-leader-figure strong { color: var(--tile-accent); }
[data-tournament-analytics="teams"] .ta-leader-icon { background: var(--tile-icon); }

[data-tournament-analytics="teams"] .ta-controls {
    padding: clamp(.8rem, 2vw, 1.15rem);
    border: 1px solid #cedde8;
    border-radius: 14px;
    background: #dfeaf3;
    color: var(--ta-navy);
}

[data-tournament-analytics="teams"] .ta-table-wrap { background: #fff; border-color: #cedde8; }
[data-tournament-analytics="teams"] .ta-table caption { background: #e6eff6; color: #304c65; }
[data-tournament-analytics="teams"] .ta-table thead th { background: var(--ta-navy); color: #fff; border-bottom-color: #294961; }
[data-tournament-analytics="teams"] .ta-table tbody tr:nth-child(even) { background: #f0f5fa; }
[data-tournament-analytics="teams"] .ta-table tbody tr:hover > * { background: #e4f1f6; }
[data-tournament-analytics="teams"] .ta-table progress { accent-color: var(--ta-teal); }
[data-tournament-analytics="teams"] .ta-table progress::-webkit-progress-value { background: linear-gradient(90deg, #258a7e, #24719c); }
[data-tournament-analytics="teams"] .ta-table progress::-moz-progress-bar { background: var(--ta-teal); }
