/* ═══════════════════════════════════════════════════════════════
   homepage.css — Ghost Reapers · Gaming Theme
   Fonts: Russo One (headings) + Chakra Petch (body override)
   ═══════════════════════════════════════════════════════════════ */

/* ── Russo One для акцентных элементов главной ────────────────── */
.clan-hero__name,
.hp-section-header__title,
.feature-tile__title,
.subsection-badge,
.cta-recruit__title,
.stats-bar__value,
.tournament-title {
    font-family: 'Russo One', sans-serif;
}

/* ── Section base ─────────────────────────────────────────────── */
.hp-section {
    padding: 64px 0;
}
.hp-section + .hp-section {
    border-top: 1px solid var(--panel-border-color);
}

/* ── Section header ───────────────────────────────────────────── */
.hp-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 48px;
}
.hp-section-header__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--main), transparent);
}
.hp-section-header__title {
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--white);
}
.hp-section-header__sub {
    color: var(--main);
    font-size: 0.75em;
    letter-spacing: 0.08em;
}

/* ── Clan hero ────────────────────────────────────────────────── */
.clan-hero {
    text-align: center;
    padding: 48px 16px 40px;
}
.clan-hero__badge {
    display: inline-block;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--main);
    border: 1px solid var(--main);
    padding: 4px 14px;
    border-radius: 2px;
    margin-bottom: 20px;
    opacity: 0.85;
}
.clan-hero__name {
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin: 0 0 20px;
    text-transform: uppercase;
}
.clan-hero__word {
    display: inline-block;
    color: var(--white);
    text-shadow: 0 0 40px rgba(55, 161, 211, 0.25);
}
.clan-hero__word--accent {
    color: var(--main);
}
.clan-hero__tagline {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--white-gray);
    margin: 0;
}

/* ── Stats bar ────────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-radius: 8px;
    padding: 28px 32px;
    margin: 0 0 48px;
    flex-wrap: wrap;
}
.stats-bar--bordered {
    margin-top: 48px;
    border-top: 2px solid var(--main);
    border-radius: 0 0 8px 8px;
}
.stats-bar__item {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 8px 16px;
}
.stats-bar__sep {
    width: 1px;
    height: 48px;
    background: var(--panel-border-color);
    flex-shrink: 0;
}
.stats-bar__value {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 400;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: 0.02em;
}
.stats-bar__value--gold {
    color: var(--gold);
    text-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}
.stats-bar__label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--white-gray);
    margin-top: 4px;
}

/* ── Mission block ────────────────────────────────────────────── */
.mission-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}
@media (max-width: 700px) {
    .mission-block { grid-template-columns: 1fr; }
    .mission-block__img-wrap { order: -1; }
}
.terminal-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--main);
    text-transform: uppercase;
    margin-bottom: 16px;
    font-family: 'Chakra Petch', monospace;
}
.mission-block__text {
    padding: 32px;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-left: 3px solid var(--main);
    border-radius: 0 8px 8px 0;
    line-height: 1.75;
    color: var(--white-gray);
}
.mission-block__text strong {
    color: var(--white);
}
.mission-block__text p {
    margin: 0 0 12px;
}
.mission-block__text p:last-child {
    margin: 0;
}
.mission-block__img-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--panel-border-color);
    position: relative;
}
.mission-block__img-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(55, 161, 211, 0.08) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}
.mission-block__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Feature grid ─────────────────────────────────────────────── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 900px) {
    .feature-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 500px) {
    .feature-grid { grid-template-columns: 1fr; }
}
.feature-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-radius: 4px;
    cursor: default;
    transition: border-color 200ms, transform 200ms;
    position: relative;
    overflow: hidden;
}
.feature-tile::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--main), transparent);
    opacity: 0;
    transition: opacity 200ms;
}
.feature-tile:hover {
    border-color: rgba(55, 161, 211, 0.4);
    transform: translateY(-2px);
}
.feature-tile:hover::before {
    opacity: 1;
}
.feature-tile__icon {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    border: 1px solid rgba(55, 161, 211, 0.35);
    background: rgba(55, 161, 211, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--main);
    margin-bottom: 16px;
    flex-shrink: 0;
}
.feature-tile__title {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
    margin: 0 0 8px;
}
.feature-tile__desc {
    font-size: 13px;
    color: var(--white-gray);
    line-height: 1.55;
    margin: 0;
}

/* ── Subsection badge ─────────────────────────────────────────── */
.subsection {
    margin-bottom: 32px;
}
.subsection-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--white-gray);
    border: 1px solid var(--panel-border-color);
    border-left: 3px solid var(--main);
    padding: 6px 14px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 20px;
    background: var(--color-panel);
}
.subsection-badge--live {
    border-left-color: var(--green);
    color: var(--green);
}
.subsection-badge--past {
    border-left-color: var(--white-gray);
}

/* ── Live dot ─────────────────────────────────────────────────── */
.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ── Tournament cards ─────────────────────────────────────────── */
.cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}
.card {
    padding: 20px 24px;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 200ms;
}
.card:hover {
    border-color: rgba(55, 161, 211, 0.3);
}
.current_tournaments_container .card {
    border-left: 3px solid var(--green);
    box-shadow: 0 0 24px rgba(52, 211, 153, 0.08);
}
.tournament-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
@media (max-width: 600px) {
    .tournament-header { flex-direction: column; align-items: flex-start; }
}
.tournament-title {
    text-transform: uppercase;
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
}
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tournament-meta {
    gap: 8px;
    color: var(--white-gray);
    font-size: 13px;
    margin-bottom: 8px;
}
.tournament-meta div {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--white);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--panel-border-color);
    border-radius: 4px;
    font-family: 'Chakra Petch', sans-serif;
}
.meta-label {
    color: var(--white-gray);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.tournament-desc {
    margin: 0 0 12px;
    color: var(--white-gray);
    font-size: 14px;
    line-height: 1.6;
}
.tournament-req {
    font-size: 13px;
    color: var(--white);
    font-weight: 600;
    margin: 14px 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--panel-border-color);
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Chakra Petch', sans-serif;
}
.tournament-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}
.tournament-prize-fund {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

/* ── Members grid ─────────────────────────────────────────────── */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 24px;
}
.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-radius: 4px;
    transition: border-color 180ms, background 180ms;
    cursor: default;
}
.member-card:hover {
    border-color: rgba(55, 161, 211, 0.3);
    background: rgba(55, 161, 211, 0.04);
}
.member-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--high-light-main);
    border: 2px solid var(--panel-border-color);
}
.member-card__info {
    min-width: 0;
}
.member-card__nick {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.member-card__name {
    font-size: 12px;
    color: var(--white-gray);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-card__role {
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 2px;
    border: 1px solid currentColor;
    flex-shrink: 0;
    width: fit-content;
}
.member-card__role.admin,
.member-card__role.superadmin { color: var(--green); }
.member-card__role.moderator  { color: var(--purple); }
.member-card__role.clan_member { color: var(--main); }
.member-card__role.clan_friend { color: var(--orange); }

/* ── CTA recruit ──────────────────────────────────────────────── */
.cta-recruit {
    margin-top: 32px;
    padding: 40px 32px;
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-top: 2px solid var(--main);
    border-radius: 0 0 8px 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-recruit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(55, 161, 211, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.cta-recruit__tag {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--main);
    margin-bottom: 12px;
}
.cta-recruit__title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 400;
    color: var(--white);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cta-recruit__text {
    color: var(--white-gray);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.6;
}
.cta-recruit__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── FAQ ──────────────────────────────────────────────────────── */
.faq {
    display: grid;
    gap: 8px;
    margin: 0 auto;
}
.faq-item {
    background: var(--color-panel);
    backdrop-filter: var(--blur);
    border: 1px solid var(--panel-border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 200ms;
}
.faq-item[open] {
    border-left: 3px solid var(--main);
}
.faq-item:hover {
    border-color: rgba(55, 161, 211, 0.3);
}
.faq-q {
    cursor: pointer;
    padding: 18px 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--white);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: var(--main);
    flex-shrink: 0;
    transition: transform 200ms;
}
.faq-item[open] .faq-q::after {
    transform: rotate(45deg);
}
.faq-a {
    padding: 0 20px 18px;
    color: var(--white-gray);
    font-size: 14px;
    line-height: 1.7;
}
.faq-a ol,
.faq-a ul {
    padding-left: 20px;
    margin: 8px 0;
}
.faq-a li {
    margin-bottom: 6px;
}
.faq-a a {
    color: var(--main);
    text-decoration: none;
}
.faq-a a:hover {
    text-decoration: underline;
}
.faq-note {
    text-align: center;
    color: var(--white-gray);
    font-size: 13px;
    margin-top: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.faq-note a {
    color: var(--main);
    text-decoration: none;
}
.faq-note a:hover {
    text-decoration: underline;
}

/* ── Responsive adjustments ───────────────────────────────────── */
@media (max-width: 480px) {
    .stats-bar {
        flex-direction: column;
        gap: 8px;
    }
    .stats-bar__sep {
        width: 40px;
        height: 1px;
    }
    .hp-section { padding: 40px 0; }
    .clan-hero { padding: 32px 16px 24px; }
}

/* ── Members auth overlay ─────────────────────────────────────── */
.members-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 24px;
}

/* Заглушки не участвуют в scroll — просто дают высоту */
.members-grid--ghost {
    margin-top: 0;
    pointer-events: none;
    user-select: none;
    max-height: 340px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.member-card--ghost {
    opacity: 0.35;
}

.member-card__ghost-line {
    border-radius: 4px;
    background: var(--panel-border-color, #2a2d3e);
}
.member-card__ghost-line--name {
    width: 90px;
    height: 12px;
    margin-bottom: 6px;
}
.member-card__ghost-line--sub {
    width: 60px;
    height: 10px;
    opacity: 0.5;
}

.members-auth-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 12, 20, 0.6) 35%,
        rgba(10, 12, 20, 0.92) 70%,
        rgba(10, 12, 20, 0.98) 100%
    );
    z-index: 2;
    padding: 2rem;
    text-align: center;
}

.members-auth-overlay__icon {
    width: 52px;
    height: 52px;
    color: var(--main, #6c63ff);
    opacity: 0.9;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--main, #6c63ff) 40%, transparent));
}

.members-auth-overlay__text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
    max-width: 300px;
    line-height: 1.5;
}


/* ══════════════════════════════════════════════════ LEADERBOARD ═══ */

/* Переключатель период */
.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.leaderboard-tab {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--panel-border-color);
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.leaderboard-tab:hover {
    border-color: var(--main, #6c63ff);
    color: var(--text-primary, #e2e8f0);
}

.leaderboard-tab--active {
    background: var(--main, #6c63ff);
    border-color: var(--main, #6c63ff);
    color: #fff;
}

/* Сетка: строка 1 — 3 карточки (span 2), строка 2 — 2 карточки (span 3) */
.leaderboard-categories {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.leaderboard-categories .leaderboard-card:nth-child(-n+3) { grid-column: span 2; }
.leaderboard-categories .leaderboard-card:nth-child(n+4)  { grid-column: span 3; }

@media (max-width: 900px) {
    .leaderboard-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    .leaderboard-categories .leaderboard-card:nth-child(-n+3),
    .leaderboard-categories .leaderboard-card:nth-child(n+4) {
        grid-column: span 1;
    }
}

@media (max-width: 520px) {
    .leaderboard-categories {
        grid-template-columns: 1fr;
    }
}

/* Тултип для карточки очков */
.leaderboard-card__title[data-tooltip] {
    position: relative;
    cursor: help;
}
.leaderboard-card__title[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg, #1a1f2e);
    border: 1px solid var(--panel-border-color);
    color: var(--text-secondary, #94a3b8);
    font-size: 0.72rem;
    font-family: 'Chakra Petch', sans-serif;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
}
.leaderboard-card__title[data-tooltip]:hover::after { opacity: 1; }

/* Карточка категории */
.leaderboard-card {
    background: var(--panel-bg, #1a1f2e);
    border: 1px solid var(--panel-border-color);
    border-radius: 12px;
    padding: 20px 16px;
}

.leaderboard-card--featured {
    border-color: var(--main, #6c63ff);
    box-shadow: 0 0 16px color-mix(in srgb, var(--main, #6c63ff) 20%, transparent);
}

.leaderboard-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Russo One', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.leaderboard-card--featured .leaderboard-card__title {
    color: var(--main, #6c63ff);
}

/* Список топ-3 */
.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Медали */
.leaderboard-list__rank {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* Аватар */
.leaderboard-list__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--panel-border-color);
}

.leaderboard-list__item:nth-child(1) .leaderboard-list__avatar {
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.leaderboard-list__item:nth-child(2) .leaderboard-list__avatar {
    border-color: #C0C0C0;
}

.leaderboard-list__item:nth-child(3) .leaderboard-list__avatar {
    border-color: #CD7F32;
}

/* Ник */
.leaderboard-list__nick {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary, #e2e8f0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-list__item:nth-child(1) .leaderboard-list__nick {
    color: #FFD700;
    font-weight: 600;
}

/* Значение */
.leaderboard-list__value {
    font-family: 'Russo One', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
    flex-shrink: 0;
}

.leaderboard-list__item:nth-child(1) .leaderboard-list__value {
    color: #FFD700;
}
