/* ==========================================
   TEAMS PAGE STYLES
   Extends base.css and styles.css
   ========================================== */

/* Page Header */
.team-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2xl);
    gap: var(--space-xl);
}

.team-header .header-left {
    flex: 1;
}

.team-header .page-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.team-header .page-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin: 0;
}

.team-header .header-right {
    flex-shrink: 0;
}

.team-header .header-right .btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
}

/* Search Bar */
.team-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.team-search-form {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.team-search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.team-search-input {
    width: 100%;
    padding: 0.7rem var(--space-md) 0.7rem 2.6rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.team-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.team-search-clear {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.team-search-clear:hover {
    background: var(--color-gray-100);
    color: var(--text-primary);
}

.team-search-clear.is-hidden {
    display: none;
}

.team-count-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Background search results region (teams overview + team tournaments) */
.team-results-region {
    position: relative;
    min-height: 120px;
    transition: opacity 0.15s ease;
}

.team-results-region.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.team-results-region.is-fresh .teams-grid,
.team-results-region.is-fresh .tt-grid,
.team-results-region.is-fresh .empty-state {
    animation: resultsFadeIn 0.25s ease;
}

@keyframes resultsFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .team-results-region.is-fresh .teams-grid,
    .team-results-region.is-fresh .tt-grid,
    .team-results-region.is-fresh .empty-state {
        animation: none;
    }
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.team-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border-radius: var(--radius-xl);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(0, 0, 0, .06), 0 12px 22px -8px rgba(0, 0, 0, .18);
    color: inherit;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease;
    animation: team-card-in var(--transition-base) ease-out backwards;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 8px 0 rgba(0, 0, 0, .08), 0 22px 34px -10px rgba(0, 0, 0, .24);
}

.team-card.is-own-team {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, .35), inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(180, 69, 11, .25), 0 12px 22px -8px rgba(249, 115, 22, .3);
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.06), var(--bg-tertiary) 60%);
}

@keyframes team-card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.teams-grid .team-card:nth-child(n+1) {
    animation-delay: 0ms;
}

.teams-grid .team-card:nth-child(n+2) {
    animation-delay: 30ms;
}

.teams-grid .team-card:nth-child(n+3) {
    animation-delay: 60ms;
}

.teams-grid .team-card:nth-child(n+4) {
    animation-delay: 90ms;
}

.teams-grid .team-card:nth-child(n+5) {
    animation-delay: 120ms;
}

.teams-grid .team-card:nth-child(n+6) {
    animation-delay: 150ms;
}

.team-card-top {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.team-card-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.team-card-heading {
    min-width: 0;
}

.team-card-name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.team-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 2px 6px var(--bevel-primary-glow);
    border-radius: var(--radius-full);
    padding: 3px 10px;
}

.team-card-captain {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.team-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-gray-100);
}

.team-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.team-card-stat.is-full {
    color: var(--color-warning);
}

/* Responsive — Teams overview (browse page) */
@media (max-width: 768px) {
    .team-header {
        flex-direction: column;
    }

    .team-header .page-title {
        font-size: var(--text-3xl);
    }

    .team-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .team-search-form {
        max-width: none;
    }

    .team-count-label {
        align-self: flex-end;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   TEAM DASHBOARD
   ========================================== */

.team-dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

/* Hero avatar override — team logos are square/rounded-square, not circular portraits */
.team-hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
}

/* Row holding the (optional) rating pill + action buttons under the hero info */
.team-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

/* Action buttons inside the hero — horizontal, unlike the stacked variant
   still used by team-dash-action-group on the tournament dashboard header. */
.team-hero-action-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Two-column quick-facts grid (Rating / Leden) inside the Statistieken card.
   Reuses the .pmeta-item/.pmeta-val/.pmeta-key text styles from profile.css. */
.team-quick-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.team-quick-facts .pmeta-item {
    padding: var(--space-md) var(--space-xs);
}

.team-quick-facts .pmeta-val {
    font-size: var(--text-2xl);
}

.team-dash-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(0, 0, 0, .06), 0 12px 22px -8px rgba(0, 0, 0, .18);
    animation: team-card-in var(--transition-base) ease-out;
}

.team-dash-logo {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 rgba(0, 0, 0, .1), 0 4px 10px rgba(0, 0, 0, .15);
}

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

.team-dash-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.team-dash-name {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0;
    overflow-wrap: anywhere;
}

.team-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-green-edge), 0 2px 6px var(--bevel-green-glow);
    border-radius: var(--radius-full);
    padding: 3px 10px;
}

.team-role-badge-captain {
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 2px 6px var(--bevel-primary-glow);
}

.team-dash-description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    margin: 0 0 var(--space-md);
}

.team-dash-captain-line {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.team-dash-captain-pic {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.team-dash-dot {
    color: var(--text-tertiary);
}

.team-dash-action {
    flex-shrink: 0;
}

.team-dash-action .btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
}

/* Tabs — base look now comes from the shared .settings-tabs/.tab-button
   component in styles.css (same one settings/profile/account use); only the
   team-specific bits (disabled state, notification badge) live here. */
.team-tab-disabled,
.team-tab:disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.team-tab-disabled:hover,
.team-tab:disabled:hover {
    background: none;
    color: var(--text-tertiary);
}

.team-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 2px 4px var(--bevel-primary-glow);
    color: var(--color-white);
    font-size: 10px;
    font-weight: var(--font-bold);
}

/* Stats */
.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.team-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    text-align: center;
    padding: var(--space-lg) var(--space-sm);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 4px 0 rgba(0, 0, 0, .05), 0 8px 16px -8px rgba(0, 0, 0, .15);
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease;
    animation: team-card-in var(--transition-base) ease-out backwards;
}

.team-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 6px 0 rgba(0, 0, 0, .07), 0 14px 22px -8px rgba(0, 0, 0, .2);
}

.team-stats-grid .team-stat-card:nth-child(1) {
    animation-delay: 0ms;
}

.team-stats-grid .team-stat-card:nth-child(2) {
    animation-delay: 40ms;
}

.team-stats-grid .team-stat-card:nth-child(3) {
    animation-delay: 80ms;
}

.team-stats-grid .team-stat-card:nth-child(4) {
    animation-delay: 120ms;
}

.team-stats-grid .team-stat-card:nth-child(5) {
    animation-delay: 160ms;
}

.team-stats-grid .team-stat-card:nth-child(6) {
    animation-delay: 200ms;
}

.team-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 3px 6px var(--bevel-primary-glow);
    color: #fff;
}

.team-stat-icon-success {
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-green-edge), 0 3px 6px var(--bevel-green-glow);
    color: #fff;
}

.team-stat-icon-muted {
    background: linear-gradient(160deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-gray-edge), 0 3px 6px var(--bevel-gray-glow);
    color: #fff;
}

.team-stat-number {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.team-stat-number-sub {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--text-tertiary);
}

.team-stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.team-stats-locked {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px dashed var(--color-gray-300);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
}

.team-stats-locked svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* Member preview list */
.team-member-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.team-member-preview-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.team-member-preview-pic {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.team-member-preview-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.team-member-preview-crown {
    color: var(--color-primary);
}

.team-member-preview-more {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color var(--transition-fast);
}

.team-member-preview-more:hover {
    color: var(--color-primary);
}

/* Leden tab — full member list */
.team-members-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.team-member-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    animation: team-card-in var(--transition-base) ease-out backwards;
}

.team-members-list .team-member-row:nth-child(n+1) {
    animation-delay: 0ms;
}

.team-members-list .team-member-row:nth-child(n+2) {
    animation-delay: 20ms;
}

.team-members-list .team-member-row:nth-child(n+3) {
    animation-delay: 40ms;
}

.team-members-list .team-member-row:nth-child(n+4) {
    animation-delay: 60ms;
}

.team-members-list .team-member-row:nth-child(n+5) {
    animation-delay: 80ms;
}

.team-member-row-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: calc(var(--space-xs) * -1);
    padding: var(--space-xs);
    transition: background var(--transition-fast);
}

.team-member-row-link:hover {
    background: var(--bg-secondary);
}

.team-member-row-link:hover .team-member-row-name {
    color: var(--color-primary);
}

.team-member-row-pic {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.team-member-row-info {
    flex: 1;
    min-width: 0;
}

.team-member-row-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-member-row-you {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--text-tertiary);
}

.team-member-row-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 1px;
}

.team-member-row-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.team-member-row-remove:hover {
    background: var(--color-error-light);
    color: var(--color-error);
}

/* ── Role assignment (Leden tab) ─────────────────────────────────────────── */

.team-tab-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.team-tab-header-actions .btn.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* The per-row role select only appears once "Rollen toewijzen" is toggled on;
   the badge (which shows the same info read-only) hides for that row while
   it's editable, so there's only ever one source of truth on screen. */
.member-role-select {
    display: none;
    width: auto;
    max-width: 170px;
    flex-shrink: 0;
    font-size: var(--text-sm);
    padding: 6px 10px;
    cursor: pointer;
}

#ledenMembersList.assign-mode .team-member-row-assignable .member-role-select {
    display: block;
}

#ledenMembersList.assign-mode .team-member-row-assignable .team-role-badge {
    display: none;
}

#ledenMembersList.assign-mode .team-member-row-assignable.is-dirty {
    border-color: var(--color-primary);
    background: var(--bg-secondary);
}

@media (max-width: 640px) {
    .team-member-row {
        flex-wrap: wrap;
    }

    .team-member-row-link {
        min-width: 60%;
    }
}

@media (max-width: 768px) {
    .team-dash-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .team-dash-action {
        width: 100%;
    }

    .team-dash-action .btn,
    .team-dash-action form {
        width: 100%;
    }

    .team-dash-action form .btn {
        width: 100%;
        justify-content: center;
    }

    .team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-tabs {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
}

/* ==========================================
   TEAM FORM PAGES (create, settings, etc.)
   ========================================== */

.team-form-page {
    max-width: 640px;
    margin: 0 auto;
}

.team-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    transition: color var(--transition-fast);
}

.team-back-link:hover {
    color: var(--color-primary);
}

/* Wider variant of .team-form-page, opt-in — used by settings/roles which
   need more room than the narrower create-team/create-tournament forms
   that also use .team-form-page. */
.team-form-page-wide {
    max-width: 820px;
}

/* Roles page needs more room than settings — it's a grid of cards with
   permission badges, not a single-column form. */
.team-form-page-full {
    max-width: 1200px;
}

.role-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-lg);
    align-items: start;
}

.role-cards-grid .empty-state {
    grid-column: 1 / -1;
}

@media (max-width: 480px) {
    .role-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Management page header (settings, roles) — a calmer, card-style relative
   of the profile/team-dashboard hero, appropriate for a utility screen. */
.team-manage-header {
    background: var(--bg-primary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.team-manage-header .team-back-link {
    margin-bottom: var(--space-md);
}

.team-manage-header-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.team-manage-header-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(249, 115, 22, .12);
    color: var(--color-primary);
}

.team-manage-header-icon svg {
    width: 26px;
    height: 26px;
}

.team-manage-header-icon-purple {
    background: rgba(139, 92, 246, .12);
    color: #8b5cf6;
}

.team-manage-header-text {
    flex: 1;
    min-width: 0;
}

.team-manage-header-text h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.25;
}

.team-manage-header-text p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.team-manage-header-action {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .team-manage-header-row {
        flex-wrap: wrap;
    }

    .team-manage-header-action {
        width: 100%;
    }

    .team-manage-header-action .btn {
        width: 100%;
        justify-content: center;
    }
}

.team-form-page .team-header {
    margin-bottom: var(--space-xl);
}

.team-form-card {
    background: var(--bg-primary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: team-card-in var(--transition-base) ease-out;
}

.team-form-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-gray-100);
    background: var(--bg-secondary);
}

.team-form-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-primary);
}

.team-form-card-icon-locked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.team-form-card-header-text h2 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 1px;
}

.team-form-card-header-text p {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 0;
}

.team-form-card-body {
    padding: var(--space-xl);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* Logo picker */
.team-logo-field {
    margin-bottom: var(--space-xl);
}

.team-logo-picker {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.team-logo-preview {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 2px solid var(--color-gray-200);
    flex-shrink: 0;
    transition: border-color var(--transition-fast);
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Requirements list (locked state) */
.team-locked-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.team-requirements-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.team-requirement-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--color-error-light);
    color: var(--color-error);
    font-size: var(--text-sm);
}

.team-requirement-row.is-met {
    background: rgba(34, 197, 94, 0.08);
    color: var(--color-success);
}

.team-requirement-row svg {
    flex-shrink: 0;
}

.team-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-gray-100);
}

@media (max-width: 640px) {
    .team-form-card-body {
        padding: var(--space-lg);
    }

    .team-logo-picker {
        flex-direction: column;
        align-items: flex-start;
    }

    .team-form-actions {
        flex-direction: column-reverse;
    }

    .team-form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   TEAM REQUESTS TAB (Verzoeken)
   ========================================== */

.team-requests-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.team-requests-heading {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
}

.team-requests-heading-history {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-gray-200);
}

.empty-state-compact {
    padding: var(--space-xl) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px dashed var(--color-gray-300);
    border-radius: var(--radius-lg);
}

.empty-state-compact svg {
    margin-bottom: var(--space-sm);
}

.empty-state-compact p {
    font-size: var(--text-sm);
}

/* Pending request rows */
.team-request-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.team-request-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    animation: team-card-in var(--transition-base) ease-out backwards;
}

.team-request-list .team-request-row:nth-child(n+1) {
    animation-delay: 0ms;
}

.team-request-list .team-request-row:nth-child(n+2) {
    animation-delay: 20ms;
}

.team-request-list .team-request-row:nth-child(n+3) {
    animation-delay: 40ms;
}

.team-request-list .team-request-row:nth-child(n+4) {
    animation-delay: 60ms;
}

.team-request-list .team-request-row:nth-child(n+5) {
    animation-delay: 80ms;
}

.team-request-message {
    margin: var(--space-xs) 0 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.team-request-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.btn-icon-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s ease;
}

.btn-icon-accept {
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-green-edge), 0 2px 6px var(--bevel-green-glow);
}

.btn-icon-accept:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 0 var(--bevel-green-edge), 0 4px 10px var(--bevel-green-glow);
}

.btn-icon-reject {
    background: linear-gradient(160deg, #fca5a5 0%, #ef4444 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-red-edge), 0 2px 6px var(--bevel-red-glow);
}

.btn-icon-reject:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 0 var(--bevel-red-edge), 0 4px 10px var(--bevel-red-glow);
}

/* History rows */
.team-request-history-empty {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin: 0;
}

.team-request-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.team-request-history-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.team-request-history-row:hover {
    background: var(--bg-secondary);
}

.team-request-history-pic {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
}

.team-request-history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-request-history-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.team-request-history-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.team-request-status {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    white-space: nowrap;
}

.team-request-status-accepted {
    color: var(--color-success);
    background: rgba(34, 197, 94, 0.1);
}

.team-request-status-rejected {
    color: var(--color-error);
    background: var(--color-error-light);
}

@media (max-width: 640px) {
    .team-request-row {
        flex-wrap: wrap;
    }

    .team-request-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==========================================
   SHARED SETTINGS-STYLE COMPONENTS
   (toggle-switch, setting-item, section-header)
   Used by the team settings page and any
   future per-team configuration screens.
   ========================================== */

/* Numeric input */
.number-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.number-input {
    width: 72px;
    padding: 6px var(--space-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.number-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .1);
}

.number-input:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Select input */
.select-input {
    padding: 6px var(--space-md);
    font-size: var(--text-sm);
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 160px;
}

.select-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .1);
}

/* Danger zone */
.danger-zone-text {
    flex: 1;
}

.danger-zone-text .setting-title {
    color: var(--color-error);
}

@media (max-width: 640px) {
    .setting-item {
        padding: var(--space-md) var(--space-lg);
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .setting-info {
        flex-basis: 100%;
    }

    .setting-control {
        align-self: flex-end;
    }

    .section-header {
        padding: var(--space-md) var(--space-lg);
    }
}

/* Settings save bar */
.team-settings-save-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-primary);
    border: 1px solid var(--color-primary-light, rgba(249, 115, 22, .3));
    border-radius: var(--radius-xl);
    position: sticky;
    bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
    animation: team-card-in 0.2s ease-out;
}

.team-settings-save-label {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Toast notification */
.team-toast {
    position: fixed;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.team-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.team-toast-success {
    background: var(--color-success);
    color: white;
}

.team-toast-error {
    background: var(--color-error);
    color: white;
}

/* ==========================================
   ROLES & PERMISSIONS PAGE
   ========================================== */

/* Role cards list */
#roleCardsList {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.role-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-width: 0;
    animation: team-card-in 0.25s ease-out backwards;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 4px 0 rgba(0, 0, 0, .05), 0 10px 18px -8px rgba(0, 0, 0, .16);
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease;
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 6px 0 rgba(0, 0, 0, .07), 0 16px 26px -10px rgba(0, 0, 0, .2);
}

.role-card.is-exiting {
    animation: role-card-out 0.3s ease-out forwards;
}

@keyframes role-card-out {
    to {
        opacity: 0;
        transform: translateX(12px);
        max-height: 0;
        margin: 0;
        padding: 0;
    }
}

.role-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-gray-100);
    background: var(--bg-secondary);
    gap: var(--space-md);
}

.role-card-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.role-card-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(0, 0, 0, .3);
    flex-shrink: 0;
}

/* Colour picker (create/edit role modal) */
.role-color-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

.role-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.role-color-swatch:hover {
    transform: scale(1.1);
}

.role-color-swatch.is-selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px var(--text-primary);
}

.role-color-custom {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px dashed var(--color-gray-300);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-color-custom input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.role-card-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.role-card-member-count {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
}

.role-card-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.role-card-perms {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.role-perm-none {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-style: italic;
}

.role-perm-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
}

.role-perm-group-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: var(--space-xs);
    white-space: nowrap;
}

.role-perm-badge {
    font-size: 11px;
    font-weight: var(--font-medium);
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: rgba(249, 115, 22, .1);
    color: var(--color-primary-dark, #c2410c);
}

/* Role modal overlay */
.role-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: modal-backdrop-in 0.2s ease;
}

@keyframes modal-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (min-width: 640px) {
    .role-modal-overlay {
        align-items: center;
        padding: var(--space-xl);
    }
}

.role-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    animation: modal-slide-up 0.25s cubic-bezier(.32, .72, 0, 1);
    overflow: hidden;
}

@media (min-width: 640px) {
    .role-modal {
        border-radius: var(--radius-xl);
        animation: modal-scale-in 0.2s cubic-bezier(.32, .72, 0, 1);
    }
}

@media (min-width: 900px) {
    .role-modal {
        max-width: 860px;
        max-height: 86dvh;
    }
}

@keyframes modal-slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes modal-scale-in {
    from {
        opacity: 0;
        transform: scale(.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.role-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-gray-100);
    flex-shrink: 0;
}

.role-modal-header h2 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
}

.role-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.role-modal-close:hover {
    background: var(--color-gray-100);
    color: var(--text-primary);
}

.role-modal-body {
    overflow-y: auto;
    padding: var(--space-lg) var(--space-xl);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.role-modal-perms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

.role-perm-toggle-all {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: opacity var(--transition-fast);
}

.role-perm-toggle-all:hover {
    opacity: 0.75;
}

.role-modal-perm-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

@media (min-width: 900px) {
    .role-modal-perm-groups {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
        align-items: start;
    }
}

.role-modal-perm-group {
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.role-modal-perm-group-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--color-gray-100);
}

.role-modal-perm-group-icon.section-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
}

.role-modal-perm-group-icon.section-icon svg {
    width: 12px;
    height: 12px;
}

.role-modal-perm-row {
    background: var(--bg-primary);
    padding: var(--space-sm) var(--space-lg) !important;
}

.role-modal-perm-row .setting-title {
    font-size: var(--text-sm);
}

.role-modal-perm-row .setting-description {
    font-size: 11px;
}

.role-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-gray-100);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

@media (max-width: 480px) {
    .role-modal-footer {
        flex-direction: column-reverse;
    }

    .role-modal-footer .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================
   FRIENDSHIPS TAB
   ========================================== */

/* Action group — stacks join + friendship buttons vertically */
.team-dash-action-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-end;
}

.team-friend-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    padding: 6px var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-200);
}

.team-friend-status-active {
    color: var(--color-success);
    background: rgba(34, 197, 94, .08);
    border-color: rgba(34, 197, 94, .25);
}

/* Accepted friendships grid */
.friend-teams-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.friend-team-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border-radius: var(--radius-lg);
    animation: team-card-in var(--transition-base) ease-out backwards;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 3px 0 rgba(0, 0, 0, .05), 0 6px 12px -6px rgba(0, 0, 0, .14);
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease;
}

.friend-team-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(0, 0, 0, .07), 0 12px 20px -8px rgba(0, 0, 0, .18);
}

.friend-team-card.is-exiting {
    animation: role-card-out 0.3s ease-out forwards;
}

.friend-team-card-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
    color: inherit;
}

.friend-team-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.friend-team-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.friend-team-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.friend-team-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 1px;
}

@media (max-width: 640px) {
    .team-dash-action-group {
        align-items: stretch;
        width: 100%;
    }

    .team-dash-action-group .btn,
    .team-dash-action-group form .btn,
    .team-dash-action-group button.btn {
        width: 100%;
        justify-content: center;
    }

    .team-friend-status {
        justify-content: center;
    }
}

/* ==========================================
   CHANNELS / CHAT PAGE
   ========================================== */

/* Full-viewport two-column layout */
.channels-layout {
    display: flex;
    height: calc(100dvh - 60px);
    /* subtract nav height */
    overflow: hidden;
}

/* Sidebar */
.channels-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.channels-sidebar-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
}

.channels-team-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    min-width: 0;
}

.channels-team-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.channels-team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channels-list-section {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) 0;
}

.channels-list-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-lg);
    font-size: 11px;
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-xs);
}

.channels-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.channels-add-btn:hover {
    background: var(--color-gray-200);
    color: var(--text-primary);
}

.channel-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin: 1px var(--space-xs);
    width: calc(100% - var(--space-sm));
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
    position: relative;
}

.channel-nav-item:hover,
.channel-nav-item.active {
    background: var(--color-gray-200);
    color: var(--text-primary);
}

.channel-nav-item.active {
    font-weight: var(--font-semibold);
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-primary-dark, #c2410c);
}

.channel-hash {
    color: var(--text-tertiary);
    font-size: var(--text-base);
    flex-shrink: 0;
}

.channel-nav-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-delete-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.channel-nav-item:hover .channel-delete-btn {
    display: flex;
}

.channel-delete-btn:hover {
    background: var(--color-error-light);
    color: var(--color-error);
}

.channels-empty-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: var(--space-sm) var(--space-lg);
    margin: 0;
}

/* Main message area */
.channels-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Welcome / empty state */
.channels-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-2xl);
}

.channels-welcome svg {
    opacity: 0.3;
}

.channels-welcome h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
}

.channels-welcome p {
    margin: 0;
    font-size: var(--text-sm);
}

/* Active chat */
.channels-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.channels-chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.channels-chat-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
}

/* Messages scroll area */
.channels-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
}

.channels-messages-loading {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    margin: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Individual message */
.chat-message {
    display: flex;
    gap: var(--space-md);
    padding: 3px 0;
    border-radius: var(--radius-md);
    animation: team-card-in 0.15s ease-out;
}

.chat-message:hover {
    background: var(--bg-secondary);
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    margin-left: calc(-1 * var(--space-sm));
    margin-right: calc(-1 * var(--space-sm));
}

.chat-message.is-pinned {
    background: rgba(249, 115, 22, 0.05);
    border-left: 2px solid var(--color-primary);
    padding-left: var(--space-sm);
}

.chat-message.is-deleted {
    opacity: 0.4;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 1px;
}

.chat-bubble {
    flex: 1;
    min-width: 0;
}

.chat-meta {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: 1px;
}

.chat-username {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.chat-username.is-self {
    color: var(--color-primary-dark, #c2410c);
}

.chat-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.chat-pin-badge {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: var(--font-medium);
}

.chat-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-text.is-deleted-text {
    color: var(--text-tertiary);
    font-style: italic;
}

.chat-actions {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.chat-message:hover .chat-actions {
    display: flex;
}

.chat-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.chat-action-btn:hover {
    background: var(--color-gray-200);
    color: var(--text-primary);
}

.chat-action-btn.pin-active {
    color: var(--color-primary);
}

/* Input area */
.channels-input-area {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-gray-200);
    flex-shrink: 0;
}

.channels-slow-mode-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--color-primary-dark, #c2410c);
    background: rgba(249, 115, 22, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-sm);
}

.channels-input-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    transition: border-color var(--transition-fast);
}

.channels-input-row:focus-within {
    border-color: var(--color-primary);
}

.channels-textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    padding: 2px 0;
}

.channels-textarea:focus {
    outline: none;
}

.channels-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.channels-send-btn:hover {
    background: var(--color-primary-dark, #c2410c);
}

.channels-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Day separator */
.chat-day-separator {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.chat-day-separator::before,
.chat-day-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gray-200);
}

/* Mobile: stack layout */
@media (max-width: 640px) {
    .channels-layout {
        flex-direction: column;
        height: calc(100dvh - 60px);
    }

    .channels-sidebar {
        width: 100%;
        height: auto;
        max-height: 45%;
        border-right: none;
        border-bottom: 1px solid var(--color-gray-200);
    }

    .channels-chat-header,
    .channels-input-area {
        padding: var(--space-md);
    }

    .channels-messages {
        padding: var(--space-md);
    }
}

/* ==========================================
   TEAM TOURNAMENTS
   ========================================== */

/* Browse grid — mirrors .teams-grid */
.tt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.tt-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border-radius: var(--radius-xl);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(0, 0, 0, .06), 0 12px 22px -8px rgba(0, 0, 0, .18);
    color: inherit;
    text-decoration: none;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease;
    animation: team-card-in var(--transition-base) ease-out backwards;
}

.tt-card:hover {
    transform: translateY(-5px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 8px 0 rgba(0, 0, 0, .08), 0 22px 34px -10px rgba(0, 0, 0, .24);
}

.tt-card-active {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, .35), inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(180, 69, 11, .25), 0 12px 22px -8px rgba(249, 115, 22, .3);
    background: linear-gradient(180deg, rgba(249, 115, 22, .06), var(--bg-tertiary) 60%);
}

.tt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.tt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}

.tt-status-open {
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-green-edge), 0 2px 6px var(--bevel-green-glow);
}

.tt-status-active {
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 2px 6px var(--bevel-primary-glow);
}

.tt-status-closed {
    background: linear-gradient(160deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-gray-edge), 0 2px 6px var(--bevel-gray-glow);
}

.tt-my-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-primary-edge), 0 2px 6px var(--bevel-primary-glow);
    border-radius: var(--radius-full);
    padding: 3px 10px;
}

.tt-host-badge {
    font-size: 10px;
    font-weight: var(--font-bold);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 0 var(--bevel-green-edge), 0 1px 4px var(--bevel-green-glow);
    border-radius: var(--radius-full);
    padding: 1px 8px;
    margin-left: 2px;
}

.tt-card-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
    overflow-wrap: anywhere;
}

.tt-card-host {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

.tt-card-host-logo {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.tt-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-gray-100);
}

.tt-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.tt-card-stat.is-full {
    color: var(--color-warning, #f59e0b);
}

/* Invite banner on detail page */
.tt-invite-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding: var(--space-md) var(--space-xl);
    background: rgba(249, 115, 22, .07);
    border: 1px solid rgba(249, 115, 22, .25);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    animation: team-card-in var(--transition-base) ease-out;
}

.tt-invite-banner-text {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.tt-invite-banner-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Participant preview chips on overview tab */
.tt-participant-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.tt-participant-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.tt-participant-chip:hover {
    background: var(--color-gray-200);
}

.tt-participant-logo {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.tt-invite-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

@media (max-width: 640px) {
    .tt-grid {
        grid-template-columns: 1fr;
    }

    .tt-invite-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================
   INVITE ACCEPT/DECLINE PAGE
   ========================================== */

.invite-card {
    max-width: 440px;
    margin: var(--space-2xl) auto;
    padding: var(--space-2xl);
    text-align: center;
}

.invite-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-primary-edge), 0 6px 14px var(--bevel-primary-glow);
    color: #fff;
    overflow: hidden;
}

.invite-card-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite-card-icon-orange {
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-primary-edge), 0 6px 14px var(--bevel-primary-glow);
    color: #fff;
}

.invite-card-icon-blue {
    background: linear-gradient(160deg, #93c5fd 0%, #3b82f6 55%, #1d4ed8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 #1e3a8a, 0 6px 14px rgba(59, 130, 246, .4);
    color: #fff;
}

.invite-card-icon-amber {
    background: linear-gradient(160deg, #fcd34d 0%, #f59e0b 55%, #b45309 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-amber-edge), 0 6px 14px var(--bevel-amber-glow);
    color: #fff;
}

.invite-card-icon-muted {
    background: linear-gradient(160deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-gray-edge), 0 6px 14px var(--bevel-gray-glow);
    color: #fff;
}

.invite-card-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-sm);
}

.invite-card-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
    margin: 0 0 var(--space-xl);
}

.invite-card-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ==========================================
   INVITE PLAYERS (Leden + Verzoeken tabs, modal)
   ========================================== */

.team-tab-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.team-tab-header-row .team-requests-heading {
    margin: 0;
}

.team-requests-subheading {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--space-xl) 0 var(--space-md);
}

.team-requests-subheading:first-child {
    margin-top: 0;
}

.team-invite-pending-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-primary);
    background: rgba(249, 115, 22, .1);
    padding: 4px var(--space-sm);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* Invite link box — used inline on the Verzoeken tab AND inside the modal */
.team-invite-link-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.team-invite-link-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    color: var(--color-primary);
}

.team-invite-link-value {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    word-break: break-all;
}

.team-invite-link-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.team-invite-link-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.team-invite-link-revoke:hover {
    color: var(--color-error, #dc2626);
    border-color: var(--color-error, #dc2626);
}

.team-invite-link-empty {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
    min-width: 200px;
}

@media (max-width: 480px) {
    .team-invite-link-box {
        flex-direction: column;
        align-items: stretch;
    }

    .team-invite-link-actions {
        justify-content: stretch;
    }

    .team-invite-link-actions .btn {
        flex: 1;
    }
}

/* Modal — step 1: choose method */
.invite-modal-step {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.invite-option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    text-align: left;
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 3px 0 rgba(0, 0, 0, .05), 0 6px 12px -6px rgba(0, 0, 0, .14);
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease;
}

.invite-option-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(0, 0, 0, .05), 0 5px 0 rgba(0, 0, 0, .07), 0 12px 20px -8px rgba(0, 0, 0, .18);
}

.invite-option-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--bevel-primary-edge), 0 4px 10px var(--bevel-primary-glow);
    color: #fff;
}

.invite-option-icon-blue {
    background: linear-gradient(160deg, #93c5fd 0%, #3b82f6 55%, #1d4ed8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 0 #1e3a8a, 0 4px 10px rgba(59, 130, 246, .4);
    color: #fff;
}

.invite-option-icon-orange {
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--bevel-primary-edge), 0 4px 10px var(--bevel-primary-glow);
    color: #fff;
}

.invite-option-text {
    flex: 1;
    min-width: 0;
}

.invite-option-text h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 2px;
}

.invite-option-text p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.invite-option-chevron {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* Modal — steps 2a/2b: back button shared by both */
.invite-modal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: var(--space-md);
    align-self: flex-start;
}

.invite-modal-back:hover {
    color: var(--color-primary);
}

/* Modal — step 2a: player search */
.invite-search-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.invite-search-wrap input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-family: inherit;
}

.invite-search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 320px;
    overflow-y: auto;
}

.invite-search-status {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: var(--space-lg) 0;
}

.invite-search-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.invite-search-result:hover {
    background: var(--bg-secondary);
}

.invite-search-result-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.invite-search-result-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.invite-search-result-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.invite-search-result-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.invite-send-btn-sent {
    color: var(--color-success, #16a34a) !important;
    border-color: var(--color-success, #16a34a) !important;
    cursor: default;
}