/* Public Teams page. Uses the colour/spacing variables from index.css. */

.teams-page {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 56px var(--pad) 96px;
}

.page-head {
    margin-bottom: 28px;
}

.eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 60px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.01em;
}

.page-lead {
    margin-top: 10px;
    color: var(--text-dim);
}

/* filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 170px;
    flex: 1 1 170px;
}

.filter-search {
    flex: 2 1 240px;
}

.filter span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filter input,
.filter select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.filter select {
    color-scheme: dark;
}

.filter input::placeholder {
    color: var(--text-muted);
}

.filter input:focus,
.filter select:focus {
    outline: none;
    border-color: rgba(174, 232, 117, 0.5);
}

.filter select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 22px 2px 14px;
}

.result-count {
    font-size: 13px;
    color: var(--text-dim);
}

.expand-actions {
    display: flex;
    gap: 8px;
}

/* team cards: a header row that expands to show the roster */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.team-card[open] {
    border-color: var(--border-strong);
}

.team-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    cursor: pointer;
    list-style: none;
    transition: background var(--fast) var(--ease);
}

.team-summary::-webkit-details-marker {
    display: none;
}

.team-summary:hover {
    background: rgba(255, 255, 255, 0.025);
}

.team-summary:focus-visible {
    outline-offset: -3px;
}

.team-card[open] > .team-summary {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-bottom: 1px solid var(--border);
}

/* Chevron on the right. */
.team-summary::after {
    content: '';
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    margin: 0 4px 3px 4px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(45deg);
    transition: transform var(--fast) var(--ease);
}

.team-card[open] > .team-summary::after {
    margin-bottom: -3px;
    transform: rotate(225deg);
}

/* Logos keep their own shape (no circle crop). */
.team-logo {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.is-placeholder {
    opacity: 0.35;
    filter: grayscale(1);
}

.team-title {
    min-width: 0;
    flex: 1;
}

.team-name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.team-tag {
    margin-left: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.team-counts {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.chip-region::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--region, var(--text-muted));
}

/* rosters: portrait cards. Roster and Staff sit side by side (wrapping on narrow screens)
   so a whole team fits on one laptop screen. */
.team-body {
    --card-w: 140px;
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    padding: 14px 20px 6px;
}

.roster-block {
    padding: 4px 0 8px;
}

.roster-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.roster-title small {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text-muted);
}

.member-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.member-card {
    display: flex;
    flex-direction: column;
    width: var(--card-w);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.member-photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: top center;
    background: var(--surface-3);
}

.member-photo.is-placeholder {
    object-fit: contain;
    padding: 22%;
}

.member-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px 10px;
}

.member-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.member-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.flag {
    flex-shrink: 0;
    height: 12px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flag-code {
    flex-shrink: 0;
    padding: 0 5px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
}

.role-badge {
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--role, var(--primary));
    background: color-mix(in srgb, var(--role, var(--primary)) 14%, transparent);
}

.role-player {
    --role: var(--primary);
}

.role-coach {
    --role: #4DA3FF;
}

.role-analyst {
    --role: #a99cff;
}

.role-manager {
    --role: #f5b94a;
}

/* Room for all five icons (X, Instagram, YouTube, TikTok, Twitch) on one line at 140px cards. */
.member-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social {
    display: inline-flex;
    color: var(--text-dim);
    transition: color var(--fast) var(--ease);
}

.social svg {
    width: 16px;
    height: 16px;
}

.social:hover {
    color: var(--primary);
}

.empty-note {
    padding: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.state-box {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
}

@media (max-width: 640px) {
    .teams-page {
        padding-top: 36px;
    }

    .team-summary {
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 12px;
    }

    /* On a phone the count drops onto its own line below the logo/name/arrow row. */
    .team-counts {
        order: 5;
        flex-basis: 100%;
    }

    .team-body {
        padding: 12px 16px 4px;
    }

    /* On a phone: stacked sections, two portraits per row. */
    .roster-block {
        flex-basis: 100%;
    }

    .member-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .member-card {
        width: auto;
    }
}
