:root {
    --bg: #061423;
    --panel: #0d1f33;
    --panel-soft: #132841;
    --line: rgba(255, 255, 255, 0.1);
    --text: #f4f8ff;
    --muted: #a7b8cf;
    --accent: #ffb347;
    --accent-2: #5bc0be;
    --glow: rgba(255, 198, 99, 0.44);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 16%, rgba(255, 179, 71, 0.16), transparent 30%),
        radial-gradient(circle at 88% 88%, rgba(91, 192, 190, 0.14), transparent 28%),
        linear-gradient(180deg, #07182d 0%, #040d19 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

.teams-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 150px 34px 80px;
}

.teams-hero {
    margin-bottom: 30px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    font-weight: 800;
}

.teams-hero h1 {
    margin: 0;
    font-size: clamp(36px, 4.4vw, 64px);
    line-height: 1.06;
}

.hero-text {
    margin: 16px 0 0;
    max-width: 920px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.teams-layout {
    min-height: 520px;
}

.teams-list-panel,
.team-details-panel {
    background: rgba(13, 31, 51, 0.88);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 26px 62px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.teams-list-panel {
    padding: 24px;
}

.team-details-panel {
    padding: 26px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.panel-header p,
.panel-header span {
    margin: 0;
}

.panel-header p {
    font-size: 22px;
    font-weight: 800;
}

.panel-header span {
    color: var(--muted);
    font-size: 14px;
}

    .teams-controls {
        display: grid;
        grid-template-columns: 1fr 220px;
        gap: 10px;
        margin-bottom: 16px;
    }

    .teams-controls input,
    .teams-controls select {
        height: 44px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        background: rgba(4, 13, 23, 0.78);
        color: var(--text);
        padding: 0 12px;
        font: inherit;
    }

    .teams-controls input::placeholder {
        color: #89a4c7;
    }

    .teams-controls input:focus-visible,
    .teams-controls select:focus-visible {
        outline: 2px solid rgba(255, 198, 99, 0.55);
        outline-offset: 1px;
    }

.teams-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.team-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    background:
           linear-gradient(180deg, rgba(6, 20, 35, 0.22) 0%, rgba(6, 20, 35, 0.85) 100%),
           var(--team-item-banner, none) center center / cover no-repeat,
        #0b1a2e;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
}

.team-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.team-item:hover,
.team-item:focus-visible {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 192, 95, 0.86);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26), 0 0 0 2px rgba(255, 198, 99, 0.24), 0 0 34px var(--glow);
    filter: saturate(1.16) brightness(1.14);
}

.hero-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 198, 99, 0.5);
    background: rgba(9, 25, 41, 0.72);
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.hero-back-link:hover,
.hero-back-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 198, 99, 0.18), 0 0 20px rgba(255, 198, 99, 0.3);
    text-decoration: none;
}

.team-item div {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 5px;
}

.team-item strong {
    font-size: 17px;
    line-height: 1.2;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.team-item span {
    font-size: 13px;
    color: #d4e4ff;
    opacity: 0.9;
}

.team-card {
    animation: fadeIn 0.3s ease;
}

.team-head {
    margin-bottom: 22px;
}

.team-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: rgba(6, 20, 35, 0.64);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.team-identity img {
    width: 104px;
    height: 104px;
    object-fit: contain;
    border-radius: 24px;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.team-label {
    margin: 0 0 6px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 12px;
    font-weight: 700;
}

.team-identity h2 {
    margin: 0;
    font-size: clamp(30px, 3.5vw, 46px);
}

.team-meta {
    margin: 10px 0 0;
    color: var(--accent-2);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.team-summary {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.content-block {
    background: rgba(7, 22, 38, 0.78);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
}

.content-block h3 {
    margin: 0 0 14px;
    font-size: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.stat-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-box strong {
    font-size: 28px;
}

.players-list {
    display: grid;
    gap: 10px;
}

.player-row {
    display: grid;
    grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--muted);
    background: rgba(11, 26, 46, 0.94);
}

.player-button {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    background: rgba(11, 26, 46, 0.94);
    color: var(--muted);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.player-button:hover,
.player-button:focus-visible {
    border-color: rgba(91, 192, 190, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.player-row span:first-child {
    color: var(--text);
    font-weight: 700;
}

.player-row span {
    font-size: 14px;
}

.trophies-banner {
    background:
        linear-gradient(120deg, rgba(255, 179, 71, 0.17), rgba(91, 192, 190, 0.12)),
        rgba(7, 22, 38, 0.72);
}

.empty-copy {
    margin: 0;
    color: var(--muted);
}

.back-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@media (max-width: 1280px) {
    .teams-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .teams-page {
        padding: 130px 20px 66px;
    }

    .teams-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .player-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-row span:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .teams-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-details-panel,
    .teams-list-panel {
        border-radius: 18px;
    }

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

    .team-identity img {
        width: 80px;
        height: 80px;
    }

    .stats-grid,
    .player-row {
        grid-template-columns: 1fr;
    }
}

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