/* Club teams module */

/* Team module shell, hero, cards and dialogs */
.team-module,
.squad-view {
    display: grid;
    gap: 1rem;
}

.team-leadership-card {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-background);
}

.team-leadership-card__header,
.team-leadership-fields {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.team-leadership-card__header h3,
.team-leadership-card__header p {
    margin: 0.25rem 0 0;
}

.team-leadership-card__fallback {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    white-space: nowrap;
}

.team-leadership-fields {
    margin-top: 1rem;
}

.team-leadership-fields label {
    display: grid;
    flex: 1;
    gap: 0.35rem;
}

.team-leadership-warning {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.lineup-leadership-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid white;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 0.65rem;
    font-weight: 900;
}

.lineup-leadership-badge.is-vice {
    background: #d1d5db;
}

@media (max-width: 720px) {
    .team-leadership-card__header,
    .team-leadership-fields {
        align-items: stretch;
        flex-direction: column;
    }
}

.team-tab-content {
    min-width: 0;
}

.teams-hero {
    --teams-hero-accent: #9ed64f;
    --teams-hero-accent-soft: rgba(158, 214, 79, 0.18);
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(160, 210, 80, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at 76% 34%, rgba(139, 190, 72, 0.16), transparent 34%),
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.07), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        color-mix(in srgb, var(--card-bg) 86%, #071008);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
    padding: clamp(1.35rem, 3vw, 2.15rem) clamp(1.15rem, 3vw, 2.25rem) 0;
}

.teams-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../../assets/Bg_Mannschaft.psd.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.86;
    mask-image: linear-gradient(90deg, transparent 0%, black 18%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 18%, black 88%, transparent 100%);
    pointer-events: none;
}

.teams-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 12, 10, 0.88), rgba(7, 12, 10, 0.34) 48%, rgba(7, 12, 10, 0.68) 100%),
        linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 100%);
    pointer-events: none;
}

.teams-hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(22rem, 30rem);
    gap: clamp(1.35rem, 4vw, 2.4rem);
    align-items: start;
}

.teams-hero__copy {
    min-width: 0;
}

.teams-hero__eyebrow,
.teams-hero__control-label {
    color: var(--teams-hero-accent);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.teams-hero__title {
    margin: 0.85rem 0 0.7rem;
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(2.35rem, 5vw, 4.4rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.teams-hero__description {
    max-width: 35rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(1rem, 1.4vw, 1.12rem);
    line-height: 1.55;
}

.team-context-panel {
    display: grid;
    gap: 0.55rem;
    min-width: min(100%, 24rem);
}

.teams-hero__controls {
    justify-self: end;
    width: min(100%, 30rem);
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(5, 10, 8, 0.46);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
}

.team-context-controls {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: 0;
}

.team-context-select {
    min-width: 0;
    flex: 1 1 14rem;
    height: 2.75rem;
    min-height: 2.75rem;
    border-color: rgba(158, 214, 79, 0.2);
    background-color: rgba(0, 0, 0, 0.24);
}

.team-create-btn {
    flex: 0 0 auto;
    min-height: 2.75rem;
    white-space: nowrap;
}

.teams-hero__create-btn {
    border-color: rgba(158, 214, 79, 0.28);
    background: rgba(158, 214, 79, 0.12);
    color: rgba(241, 255, 223, 0.96);
}

.teams-hero-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    gap: clamp(1rem, 3vw, 2.25rem);
    margin: clamp(2rem, 5vw, 3.8rem) 0 0;
    padding: 1.15rem 0 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.teams-hero-tabs .tab-btn {
    position: relative;
    flex: 0 0 auto;
    min-height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: none;
}

.teams-hero-tabs .tab-btn::after {
    content: none;
}

.teams-hero-tabs .tab-btn:hover,
.teams-hero-tabs .tab-btn:focus-visible {
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
}

.teams-hero-tabs .tab-btn.active {
    color: #c9f36b;
    background: transparent;
    box-shadow: none;
}

.teams-hero-tabs .tab-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.95rem;
    height: 3px;
    border-radius: 999px;
    background: var(--teams-hero-accent);
    box-shadow: 0 0 14px rgba(158, 214, 79, 0.55);
}

body.light-mode .teams-hero {
    border-color: rgba(126, 178, 66, 0.24);
    background: #eff6ec;
    box-shadow: 0 18px 42px rgba(66, 101, 51, 0.14);
}

body.light-mode .teams-hero::before {
    background-image: url("../../assets/Bg_Mannschaft_lm.psd.png");
    opacity: 0.94;
}

body.light-mode .teams-hero::after {
    background:
        linear-gradient(90deg, rgba(249, 252, 247, 0.96), rgba(249, 252, 247, 0.5) 48%, rgba(240, 247, 237, 0.78)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(215, 231, 207, 0.3));
}

body.light-mode .teams-hero__title {
    color: #1f2a1b;
}

body.light-mode .teams-hero__description {
    color: #5d6b57;
}

body.light-mode .teams-hero__controls {
    border-color: rgba(57, 91, 43, 0.12);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 30px rgba(66, 101, 51, 0.12);
}

body.light-mode .team-context-select {
    border-color: rgba(88, 132, 67, 0.22);
    background-color: rgba(245, 249, 243, 0.86);
    color: #1f2a1b;
}

body.light-mode .teams-hero__create-btn {
    border-color: rgba(88, 132, 67, 0.26);
    background: rgba(126, 178, 66, 0.14);
    color: #385c27;
}

body.light-mode .teams-hero-tabs>.tab-btn {
    color: rgba(31, 42, 27, 0.6);
}

body.light-mode .teams-hero-tabs>.tab-btn:hover,
body.light-mode .teams-hero-tabs>.tab-btn:focus-visible {
    color: rgba(31, 42, 27, 0.86);
}

body.light-mode .teams-hero-tabs>.tab-btn.active {
    color: #4e7b34;
}

body.light-mode .teams-hero-tabs>.tab-btn::after {
    content: none;
    background: var(--teams-hero-accent);
}

body.light-mode .teams-hero-tabs>.tab-btn.active::after {
    content: "";
}

.team-overview {
    display: grid;
    gap: 1rem;
}

.team-empty-team-state .empty-state {
    min-height: 260px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        rgba(255, 255, 255, 0.025);
}

body.light-mode .team-empty-team-state .empty-state {
    border-color: rgba(31, 41, 55, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(247, 250, 252, 0.74)),
        #ffffff;
}

.team-assigned-squad {
    display: grid;
    gap: 1rem;
}

.team-coach-view {
    display: grid;
    gap: 1rem;
}

.team-head-coach-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid rgba(var(--primary-color-rgb), 0.78);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.11), rgba(255, 255, 255, 0.025)),
        rgba(255, 255, 255, 0.035);
}

.team-head-coach-card h2 {
    margin: 0.25rem 0 0;
}

.team-head-coach-card p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.team-head-coach-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.team-head-coach-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.team-head-coach-detail {
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.team-head-coach-detail span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-head-coach-detail strong {
    color: var(--text-color);
    line-height: 1.35;
}

.team-head-coach-detail small {
    color: var(--text-muted);
    line-height: 1.45;
}

.team-head-coach-meta span {
    padding: 0.6rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-weight: 700;
}

.team-coach-rule-note {
    display: grid;
    gap: 0.25rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(240, 171, 0, 0.28);
    border-radius: 8px;
    background: rgba(240, 171, 0, 0.09);
}

.team-coach-rule-note strong {
    color: #ffd36a;
}

.team-coach-rule-note span {
    color: var(--text-muted);
    line-height: 1.45;
}

.team-head-coach-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.team-coach-empty-state {
    display: grid;
    gap: 1rem;
}

.team-coach-market-modal {
    max-width: 760px;
}

.team-coach-market-list {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0;
    max-height: min(46vh, 420px);
    overflow: auto;
    padding-right: 0.25rem;
}

.team-coach-market-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.team-coach-market-card div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.team-coach-market-card strong {
    color: var(--text-color);
}

.team-coach-market-card span,
.team-coach-market-card small {
    color: var(--text-muted);
    line-height: 1.4;
}

.coach-profile-hidden {
    grid-template-columns: 1fr;
}

.grid.layout-grid-two-equal.coach-profile-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.coach-profile-hidden .coach-profile-card {
    display: none;
}

.team-assigned-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.8rem;
}

.team-assigned-player-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.team-assigned-player-card div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.team-assigned-player-card strong {
    color: var(--text-color);
    overflow-wrap: anywhere;
}

.team-assigned-player-card span,
.team-assigned-player-card small {
    color: var(--text-muted);
}

.team-assignment-board-view {
    display: grid;
    gap: 1rem;
}

.team-assignment-board {
    display: grid;
    grid-template-columns: repeat(var(--team-board-columns, 2), minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.team-assignment-column {
    display: grid;
    gap: 0.8rem;
    min-width: 260px;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.team-assignment-column.is-drop-target {
    border-color: rgba(var(--primary-color-rgb), 0.7);
    background: rgba(var(--primary-color-rgb), 0.08);
}

.team-assignment-column__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.team-assignment-column__header strong {
    color: var(--text-color);
    overflow-wrap: anywhere;
}

.team-assignment-column__header span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.team-assignment-group {
    display: grid;
    gap: 0.45rem;
}

.team-assignment-group__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.team-assignment-dropzone {
    display: grid;
    gap: 0.45rem;
    min-height: 3.2rem;
}

.team-assignment-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.team-assignment-player {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.6rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    cursor: grab;
}

.team-assignment-player:active {
    cursor: grabbing;
}

.team-assignment-player.is-dragging {
    opacity: 0.55;
}

.team-assignment-player div {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.team-assignment-player strong {
    color: var(--text-color);
    overflow-wrap: anywhere;
}

.team-assignment-player span,
.team-assignment-player small {
    color: var(--text-muted);
}

.team-assignment-player .team-assign-role {
    grid-column: 1 / -1;
    justify-self: start;
}

.team-assign-modal {
    max-width: 700px;
}

.team-assign-server-note {
    margin-top: -0.35rem;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.team-assign-player-list {
    display: grid;
    gap: 0.55rem;
    max-height: min(46vh, 420px);
    overflow: auto;
    margin: 1rem 0;
    padding-right: 0.25rem;
}

.team-assign-warning {
    display: grid;
    gap: 0.25rem;
    margin: 0.95rem 0 0;
    padding: 0.8rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(240, 171, 0, 0.34);
    background: rgba(240, 171, 0, 0.1);
    color: var(--text-color);
}

.team-assign-warning[hidden] {
    display: none;
}

.team-assign-warning strong {
    color: #ffd36a;
}

.team-assign-warning span,
.team-assign-warning small {
    color: var(--text-muted);
}

.team-assign-warning.tone-danger {
    border-color: rgba(220, 83, 83, 0.42);
    background: rgba(220, 83, 83, 0.12);
}

.team-assign-warning.tone-danger strong {
    color: #ff9d9d;
}

.team-assign-warning.tone-info {
    border-color: rgba(72, 150, 220, 0.34);
    background: rgba(72, 150, 220, 0.1);
}

.team-assign-warning.tone-info strong {
    color: #9fcfff;
}

.team-assign-player-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
}

.team-assign-player-row>span:first-of-type {
    flex: 1 1 auto;
}

.team-assign-role {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.2rem;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.team-assign-role.tone-success {
    color: #9fe3a2;
    background: rgba(76, 175, 80, 0.13);
    border-color: rgba(76, 175, 80, 0.3);
}

.team-assign-role.tone-warning {
    color: #ffd36a;
    background: rgba(240, 171, 0, 0.13);
    border-color: rgba(240, 171, 0, 0.3);
}

.team-assign-role.tone-muted {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.035);
}

.team-assign-player-row input {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.team-assign-player-row span {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.team-assign-player-row strong {
    color: var(--text-color);
}

.team-assign-player-row small {
    color: var(--text-muted);
}

body.light-mode .team-assigned-player-card,
body.light-mode .team-assignment-column,
body.light-mode .team-assignment-player,
body.light-mode .team-assign-player-row {
    border-color: rgba(31, 41, 55, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

body.light-mode .team-assignment-empty {
    border-color: rgba(31, 41, 55, 0.14);
}

body.light-mode .team-head-coach-card {
    border-color: rgba(31, 41, 55, 0.08);
    border-left-color: rgba(var(--primary-color-rgb), 0.78);
    background:
        linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08), rgba(255, 255, 255, 0.92)),
        #ffffff;
}

body.light-mode .team-head-coach-meta span {
    border-color: rgba(31, 41, 55, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

body.light-mode .team-head-coach-detail {
    border-color: rgba(31, 41, 55, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

body.light-mode .team-coach-market-card {
    border-color: rgba(31, 41, 55, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

body.light-mode .team-coach-rule-note strong {
    color: #8a5a00;
}

body.light-mode .team-status-pill.tone-success {
    color: #1f6f32;
}

body.light-mode .team-status-pill.tone-warning {
    color: #8a5a00;
}

body.light-mode .team-status-pill.tone-danger {
    color: #a92f2f;
}

body.light-mode .team-status-pill.tone-info {
    color: #255f94;
}

body.light-mode .team-assign-role.tone-success {
    color: #1f6f32;
}

body.light-mode .team-assign-role.tone-warning {
    color: #8a5a00;
}

.team-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
    gap: 1rem;
    min-width: 0;
}

.team-card {
    --team-card-accent: #9ed64f;
    --team-card-glow: rgba(150, 210, 70, 0.16);
    --team-card-bg: url("../../assets/Mannschaft_BG.png");
    display: grid;
    align-content: start;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: clamp(1.25rem, 2.4vw, 1.75rem);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--team-card-accent);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        #111613;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    min-width: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.team-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--team-card-bg);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: auto 92%;
    opacity: 0.24;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.team-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 12, 12, 0.94) 0%, rgba(10, 12, 12, 0.76) 48%, rgba(10, 12, 12, 0.3) 100%),
        radial-gradient(circle at 82% 38%, var(--team-card-glow), transparent 38%);
    pointer-events: none;
}

.team-card>* {
    position: relative;
    z-index: 1;
}

.team-card--main {
    --team-card-accent: #9ed64f;
    --team-card-glow: rgba(150, 210, 70, 0.18);
    --team-card-bg: url("../../assets/Mannschaft_BG.png");
    border-color: rgba(150, 210, 70, 0.42);
    border-left-color: var(--team-card-accent);
}

.team-card--pending {
    --team-card-accent: #6eb4ff;
    --team-card-glow: rgba(90, 160, 230, 0.16);
    --team-card-bg: url("../../assets/Mannschaft_BG.png");
    border-color: rgba(90, 160, 230, 0.42);
    border-left-color: var(--team-card-accent);
}

.team-card:hover,
.team-card.active {
    border-color: rgba(255, 255, 255, 0.22);
    border-left-color: var(--team-card-accent);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.36), 0 0 26px color-mix(in srgb, var(--team-card-accent) 16%, transparent);
}

.team-card:hover::before,
.team-card.active::before {
    opacity: 0.32;
}

.team-card__bg {
    display: none;
}

.team-card__header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.team-card__crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border: 1px solid color-mix(in srgb, var(--team-card-accent) 34%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--team-card-accent) 12%, rgba(255, 255, 255, 0.035));
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    font-weight: 900;
    box-shadow: 0 0 22px color-mix(in srgb, var(--team-card-accent) 14%, transparent);
    overflow: hidden;
}

.team-card__crest.has-logo {
    padding: 0.24rem;
    background: rgba(255, 255, 255, 0.08);
}

.team-card__crest img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-card__identity {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.team-card__type {
    color: var(--team-card-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.team-card__badge {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 1.65rem;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.055);
    color: var(--team-card-accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-card__badge--success {
    color: #9fe3a2;
}

.team-card__badge--info {
    color: #9fcfff;
}

.team-card__main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.team-card__title {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.team-card__details {
    display: grid;
    gap: 0.62rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.94rem;
}

.team-card__details>span {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.team-card__detail-icon,
.team-card__stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.065);
    color: color-mix(in srgb, var(--team-card-accent) 82%, white);
    font-size: 0.62rem;
    font-weight: 900;
    overflow: hidden;
}

.team-card__detail-icon img,
.team-card__stat-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: auto;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(6px);
}

.team-card__stat {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.team-card__stat:first-child {
    padding-left: 0;
}

.team-card__stat:last-child {
    padding-right: 0;
    border-right: 0;
}

.team-card__stat>span:last-child {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.team-card__stat-value {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.team-card__stat-label {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    line-height: 1.2;
}

.team-create-modal {
    max-width: 620px;
    width: min(92vw, 620px);
    max-height: 88vh;
    overflow: auto;
    padding: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(42, 42, 42, 0.98), rgba(22, 24, 25, 0.98)),
        var(--card-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
}

.team-create-modal .modal-close {
    float: right;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    cursor: pointer;
}

.team-create-modal .modal-title {
    margin: 0.35rem 0 0.55rem;
}

.team-create-modal .modal-copy {
    max-width: 48rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.team-create-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.team-create-fact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.team-create-fact-grid>div {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.team-create-fact-grid span,
.team-create-rules {
    color: var(--text-muted);
}

.team-create-fact-grid strong {
    color: var(--text-color);
}

.team-create-rules {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 1.15rem;
    padding-left: 1.1rem;
    line-height: 1.5;
}

body.light-mode .team-card {
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--team-card-accent);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        #111613;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

body.light-mode .team-card:hover,
body.light-mode .team-card.active {
    border-color: rgba(255, 255, 255, 0.24);
    border-left-color: var(--team-card-accent);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.28), 0 0 26px color-mix(in srgb, var(--team-card-accent) 14%, transparent);
}

body.light-mode .team-create-fact-grid>div {
    border-color: rgba(31, 41, 55, 0.1);
    background: rgba(248, 250, 252, 0.9);
}

body.light-mode .team-create-modal {
    border-color: rgba(31, 41, 55, 0.1);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.98)),
        #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

body.light-mode .team-create-modal .modal-close {
    border-color: rgba(31, 41, 55, 0.12);
    background: rgba(15, 23, 42, 0.04);
}

@media (max-width: 900px) {
    .teams-hero__content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .teams-hero__controls {
        justify-self: stretch;
        width: 100%;
    }

    .teams-hero {
        padding-top: 1.35rem;
    }

    .teams-hero::before {
        background-position: center center;
        background-size: cover;
        opacity: 0.34;
    }

    .team-card__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 1rem;
    }

    .team-card__stat:nth-child(2) {
        padding-right: 0;
        border-right: 0;
    }

    .team-card__stat:nth-child(3) {
        padding-left: 0;
    }

    .team-context-panel {
        width: 100%;
    }

    .team-context-controls {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .team-context-select {
        flex: 1 1 13rem;
        width: auto;
    }

    .team-create-btn {
        flex: 0 1 auto;
    }

    .team-card {
        gap: 1.05rem;
    }

    .team-card__stats {
        margin-top: 0.25rem;
    }
}

@media (max-width: 640px) {
    .team-overview-grid,
    .team-create-fact-grid {
        grid-template-columns: 1fr;
    }

    .teams-hero {
        border-radius: 14px;
        padding: 1rem 1rem 0;
    }

    .teams-hero::before {
        background-position: center center;
        background-size: cover;
        opacity: 0.24;
    }

    .teams-hero::after {
        background: linear-gradient(90deg, rgba(7, 12, 10, 0.9), rgba(7, 12, 10, 0.72));
    }

    body.light-mode .teams-hero::before {
        opacity: 0.62;
    }

    body.light-mode .teams-hero::after {
        background: linear-gradient(90deg, rgba(249, 252, 247, 0.96), rgba(240, 247, 237, 0.8));
    }

    .teams-hero__title {
        font-size: clamp(2rem, 13vw, 3rem);
        line-height: 1;
        overflow-wrap: anywhere;
    }

    .teams-hero__description {
        font-size: 0.96rem;
    }

    .teams-hero__controls {
        padding: 0.85rem;
    }

    .team-context-controls {
        gap: 0.6rem;
    }

    .team-context-select {
        flex-basis: 12rem;
        height: 2.6rem;
        min-height: 2.6rem;
        font-size: 0.9rem;
    }

    .team-create-btn {
        min-height: 2.6rem;
        padding-inline: 0.85rem;
        font-size: 0.9rem;
    }

    .teams-hero-tabs {
        gap: 1rem;
        margin-top: 1.5rem;
        padding-bottom: 0.85rem;
    }

    .teams-hero-tabs .tab-btn {
        font-size: 0.74rem;
    }

    .team-card {
        min-height: 0;
        padding: 1.25rem;
        border-radius: 14px;
    }

    .team-card::before {
        background-position: center right -4rem;
        background-size: auto 72%;
        opacity: 0.18;
    }

    .team-card::after {
        background:
            linear-gradient(90deg, rgba(10, 12, 12, 0.96) 0%, rgba(10, 12, 12, 0.82) 100%),
            radial-gradient(circle at 82% 38%, var(--team-card-glow), transparent 42%);
    }

    .team-card__title {
        font-size: clamp(1.75rem, 11vw, 2.45rem);
    }

    .team-card__header {
        gap: 0.8rem;
    }

    .team-card__crest {
        width: 2.65rem;
        height: 2.65rem;
        border-radius: 12px;
    }

    .team-card__type {
        font-size: 0.72rem;
    }

    .team-card__badge {
        max-width: 100%;
        font-size: 0.68rem;
        white-space: normal;
    }

    .team-card__details {
        font-size: 0.88rem;
    }

    .team-card__stats {
        grid-template-columns: 1fr;
        padding: 0.15rem 1rem;
    }

    .team-card__stat,
    .team-card__stat:first-child,
    .team-card__stat:nth-child(3),
    .team-card__stat:last-child {
        padding: 0.85rem 0;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .team-card__stat:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 420px) {
    .teams-hero {
        margin-inline: -0.15rem;
        padding: 0.9rem 0.85rem 0;
    }

    .teams-hero__title {
        font-size: clamp(1.8rem, 14vw, 2.45rem);
    }

    .teams-hero__controls {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .team-context-select,
    .team-create-btn {
        width: 100%;
        min-height: 2.5rem;
        font-size: 0.88rem;
    }

    .team-context-select {
        height: 2.5rem;
        flex-basis: 100%;
    }

    .team-create-btn {
        justify-content: center;
    }

    .teams-hero-tabs {
        margin-top: 1.15rem;
        gap: 0.9rem;
        padding-top: 0.9rem;
    }

    .teams-hero-tabs .tab-btn {
        font-size: 0.7rem;
    }

    .teams-hero-tabs .tab-btn.active::after {
        bottom: -0.88rem;
    }

    .team-card {
        margin-inline: -0.15rem;
        padding: 1rem;
        gap: 0.95rem;
    }

    .team-card__title {
        font-size: clamp(1.6rem, 12vw, 2.1rem);
    }

    .team-card__detail-icon,
    .team-card__stat-icon {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 7px;
    }

    .team-card__stats {
        padding-inline: 0.85rem;
    }

    .team-card__stat {
        gap: 0.6rem;
    }

    .team-card__stat-value {
        font-size: 0.98rem;
    }
}
