@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&display=swap');

@font-face {
    font-family: 'qafelka';
    src:
        url('../../assets/fonts/qafelka.woff2') format('woff2'),
        url('../../assets/fonts/qafelka.woff') format('woff'),
        url('../../assets/fonts/qafelka.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --purple: #9655f5;
    --purple-active: #9d55ff;
    --purple-corner: #6500ff;
    --white: #ffffff;
    --muted: rgba(255,255,255,0.72);
    --footer-bg: rgba(19, 15, 17, 0.72);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #000; }
body {
    min-height: 100vh;
    color: var(--white);
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-weight: 600;
    background: #000;
}

a { color: inherit; }

.site-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;

    /* Exact user-provided background asset. No extra gradients/overlays. */
    background-image: url('../../assets/backgrounds/vanguard-bg.png');
    background-color: #000;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.reference-header,
.about-layout,
.rosters-layout,
.socials-layout,
.player-profile-layout,
.bottom-nav {
    position: relative;
    z-index: 2;
}

/* ============================= */
/* ВЕРХНИЙ БЛОК: LABEL + VaNGUARD */
/* ============================= */

.reference-header {
    position: relative;
    width: 100%;
    height: 135px;
    text-align: center;
    z-index: 10;
}

/* Маленькая надпись над логотипом: About / Rosters / Socials / Player */
.tiny-page-label {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;

    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;

    color: #ffffff;
    white-space: nowrap;
    pointer-events: none;
}

/* Текстовый логотип VaNGUARD */
.vanguard-logo {
    position: absolute;
    top: 31px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;

    display: inline-block;
    text-decoration: none;
    line-height: 1;
}

/* Сам текст логотипа */
.logo-text {
    display: block;

    font-family: 'qafelka', Georgia, 'Times New Roman', serif;
    font-size: 78px;
    line-height: 0.82;
    font-weight: 400;
    letter-spacing: -0.055em;

    color: #A166FF;
    text-shadow: 0 0 14px rgba(161, 102, 255, 0.22);
}

.about-layout {
    min-height: calc(100vh - 178px);
    padding-bottom: 74px;
}

.about-copy {
    width: min(1010px, 70vw);
    margin: 176px auto 0;
    transform: translateX(-8px);
}

.about-copy p {
    margin-bottom: 36px;
    font-size: clamp(20px, 1.56vw, 30px);
    line-height: 1.17;
    font-weight: 700;
    letter-spacing: -0.037em;
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.08);
}

.rosters-layout {
    min-height: calc(100vh - 178px);
    padding-bottom: 74px;
}

.game-picker {
    width: min(1050px, 82vw);
    margin: 252px auto 0;

    /* Игры показываются как категории: слева/справа, а не каждая команда отдельно. */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    /* Если игр станет много — они аккуратно уйдут на новую строку. */
    flex-wrap: wrap;
    gap: 70px 95px;
}

.game-logo-link {
    display: block;
    line-height: 0;
    text-decoration: none;
    transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.game-logo-link:hover {
    transform: scale(1.035);
    filter: drop-shadow(0 0 18px rgba(150,85,245,0.32));
}

.game-logo {
    display: block;
    width: min(405px, 48vw);
    max-height: 140px;
    object-fit: contain;
}

.game-logo-fallback {
    display: grid;
    place-items: center;
    width: min(405px, 48vw);
    min-height: 95px;
    color: white;
    font-size: clamp(30px, 4vw, 62px);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 18px rgba(150,85,245,0.4);
}


/* ============================= */
/* ВЫБОР ДИВИЗИОНОВ / КОМАНД */
/* ============================= */

.division-picker {
    width: min(760px, 76vw);
    margin: 250px auto 0;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.division-link {
    min-height: 112px;
    padding: 24px 28px;
    border-radius: 28px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;

    color: #fff;
    text-decoration: none;
    background-color: rgba(8, 0, 0, 0.78);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 16px 38px rgba(0,0,0,0.34);

    overflow: hidden;
    transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease;
}

.division-link:hover {
    transform: translateY(-3px);
    filter: brightness(1.16);
    background-color: rgba(22, 0, 20, 0.84);
}

.division-title {
    font-size: clamp(30px, 2.4vw, 46px);
    line-height: .92;
    font-weight: 800;
    letter-spacing: -0.08em;
}

.division-subtitle {
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: rgba(255,255,255,0.82);
}

.team-stage.cards {
    width: min(1350px, 72vw);
    margin: 226px auto 0;
}

.player-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    gap: 56px 72px;
}

.player-banner-card {
    position: relative;
    display: block;
    height: 154px;
    overflow: hidden;
    border-radius: 40px;
    color: white;
    text-decoration: none;

    /*
       Картинка карточки ставится прямо через JS в inline style:
       background-image: linear-gradient(...), url(...).
       Так она точно отображается и не ломается из-за CSS-переменных.
    */
    background-color: #080000;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    box-shadow: 0 16px 38px rgba(0,0,0,0.34);
    transition: transform 140ms ease, filter 140ms ease;
}

.player-banner-card:hover {
    transform: translateY(-3px);
    filter: brightness(1.14);
}

.player-card-content {
    position: absolute;
    z-index: 2;
    left: 27px;
    top: 50%;
    transform: translateY(-50%);
}

.player-banner-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: clamp(25px, 1.75vw, 34px);
    line-height: 0.94;
    font-weight: 800;
    letter-spacing: -0.08em;
}

/* Отдельный span для ника, чтобы флаг не ломал расстояние букв */
.player-name-text {
    display: inline-block;
}

/* Картинки флагов рядом с ником игрока */
.player-flag-img,
.profile-flag-img,
.player-list-flag {
    display: inline-block;
    object-fit: cover;
    flex: 0 0 auto;
    border-radius: 1px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.85);
}

/* Флаг на TF2-карточках */
.player-flag-img {
    width: 29px;
    height: 19px;
    margin-left: 0;
    transform: translateY(1px);
}

/* Флаг в профиле игрока */
.profile-flag-img {
    width: 31px;
    height: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Старый текстовый/emoji fallback, если картинки нет */
.player-flag-text {
    display: none;
}

.player-card-meta {
    margin-top: 8px;
    color: #fff;
    font-size: 8.2px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.045em;
}
.player-card-meta span { display: block; }

.team-stage.list {
    width: min(360px, 75vw);
    margin: 243px auto 0;
}
.player-list { display: grid; gap: 3px; }
.player-list-link {
    display: grid;
    grid-template-columns: 31px 1fr;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: clamp(21px, 1.65vw, 30px);
    line-height: 1.075;
    font-weight: 700;
    letter-spacing: -0.055em;
    transition: transform 140ms ease, color 140ms ease;
}
.player-list-link:hover { color: var(--purple-active); transform: translateX(4px); }
/* Флаг в SC2-списке */
.player-list-flag {
    width: 24px;
    height: 16px;
    align-self: center;
}

.socials-layout {
    min-height: calc(100vh - 178px);
    padding-bottom: 74px;
}
.social-list {
    width: min(420px, 74vw);
    margin: 214px auto 0;
    display: grid;
    gap: 10px;
}
.social-card {
    display: block;
    padding: 8px 0;
    color: white;
    text-decoration: none;
    text-align: center;
    transition: transform 140ms ease, color 140ms ease;
}
.social-card:hover { color: var(--purple-active); transform: translateY(-2px); }
.social-card h2 { font-size: 30px; line-height: 1.05; font-weight: 700; letter-spacing: -0.055em; }
.social-card p { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }

.player-profile-layout { min-height: calc(100vh - 178px); padding-bottom: 74px; }
.profile-card {
    width: min(900px, 72vw);
    margin: 145px auto 0;
    display: grid;
    grid-template-columns: 235px 1fr;
    gap: 34px;
    padding: 24px;
    border-radius: 38px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(9px);
    border: 1px solid rgba(255,255,255,0.07);
}
.profile-avatar, .profile-avatar-placeholder {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 30px;
    background: linear-gradient(135deg, rgba(150,85,245,0.38), rgba(4,1,8,0.9));
}
.profile-avatar-placeholder { display: grid; place-items: center; font-size: 58px; font-weight: 800; }
.profile-info h1 { display:flex; gap: 8px; align-items:center; font-size: clamp(42px,4.8vw,76px); line-height: .94; font-weight:800; letter-spacing:-.08em; }
.profile-line { margin-top: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.profile-bio { margin-top: 22px; color: #fff; font-size: 16px; line-height: 1.45; }
.profile-section-title { margin-top: 24px; margin-bottom: 8px; color: var(--purple-active); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.link-list { display:flex; flex-wrap:wrap; gap:8px; }
.profile-link { padding: 8px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.11); background:rgba(255,255,255,.04); color:white; text-decoration:none; font-size:12px; font-weight:800; }
.achievement-list { padding-left:18px; font-size:14px; line-height:1.4; }
.back-link, .loading, .error-box, .muted { color: var(--muted); font-weight: 700; }
.loading, .error-box { text-align: center; margin-top: 50px; }
.back-link { display:inline-flex; margin-top:20px; text-decoration:none; }
.back-link:hover { color: var(--purple-active); }

.bottom-nav {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 54px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 19px;
    background: var(--footer-bg);
    backdrop-filter: blur(10px);
}
.corner-blocks::before,
.corner-blocks::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 54px;
    background: var(--purple-corner);
    z-index: -1;
}
.corner-blocks::before {
    left: 0;
    width: 108px;
    clip-path: polygon(0 0, 82px 0, 100% 100%, 0 100%);
}
.corner-blocks::after {
    left: 203px;
    width: 181px;
    clip-path: polygon(0 0, 178px 0, 100% 100%, 24px 100%);
}
.bottom-nav nav {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14.5px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.045em;
}
.bottom-nav nav a { color: white; text-decoration: none; }
.bottom-nav nav a.active { color: var(--purple-active); }
.bottom-nav nav span { color: rgba(255,255,255,0.92); }
.owned {
    justify-self: end;
    grid-column: 3;
    color: white;
    font-size: 9.5px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.035em;
}
.rainbow {
    background: linear-gradient(90deg,#ff004c,#ff8c00,#ffee00,#00d26a,#00a2ff,#b14cff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (max-width: 1150px) {
    .about-copy, .team-stage.cards { width: min(92vw, 100%); transform: none; }
    .player-card-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 28px; }
}
@media (max-width: 720px) {
    .site-shell { min-height: 100svh; overflow-y: auto; }
    .reference-header { height: 105px; }
    .tiny-page-label { top: 14px; font-size: 9px; }
    .vanguard-logo { top: 28px; }
    .logo-text { font-size: min(52px, 17vw); }
    .about-copy { width: 92vw; margin-top: 80px; }
    .about-copy p { font-size: 16px; line-height: 1.33; letter-spacing: -0.02em; margin-bottom: 22px; }
    .game-picker {
        width: 92vw;
        margin-top: 125px;
        gap: 42px;
        justify-content: center;
    }
    .game-logo { width: min(310px, 76vw); }
    .division-picker {
        width: 92vw;
        margin-top: 95px;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .division-link {
        min-height: 96px;
        border-radius: 24px;
        padding: 20px 24px;
    }
    .team-stage.cards, .team-stage.list, .social-list, .profile-card { width: 92vw; margin-top: 85px; }
    .player-card-grid { grid-template-columns: 1fr; gap: 18px; }
    .player-banner-card { height: 132px; border-radius: 30px; }
    .profile-card { grid-template-columns: 1fr; border-radius: 30px; }
    .profile-avatar, .profile-avatar-placeholder { max-width: 250px; }
    .bottom-nav { height: 60px; grid-template-columns: 1fr; }
    .corner-blocks, .owned { display:none; }
    .bottom-nav nav { grid-column: 1; font-size: 14px; }
}
