/* ============================================================
   Редизайн по мотивам конкурентов (FACEIT, Challengermode, start.gg,
   Twitch). Отдельный слой поверх style.css — чтобы откатить, достаточно
   убрать <link> на этот файл.

   Что взято у конкурентов:
   1. Шапка — спокойная текстовая навигация, яркий только активный
      пункт (FACEIT, Twitch). Было: 8 одинаково залитых «кнопок».
   2. Цифры платформы — одна тонкая лента с разделителями, без нулей
      и с «живой» точкой (Twitch, Challengermode).
   3. Карточка турнира — статус, обратный отсчёт, призовой, заполненность
      слотов и явная кнопка действия (FACEIT, start.gg, Battlefy).
   4. «Как это работает» в три шага для гостей (Challengermode).
   5. Пустые блоки — компактные, не съедают экран.
   ============================================================ */

/* ---------- 1. Шапка ---------- */
.header .nav-link {
    background: transparent;
    box-shadow: none;
    color: var(--header-pill-text);
    opacity: 0.82;
    padding: 9px 13px;
    border-radius: 10px;
    position: relative;
}
.header .nav-link:hover {
    opacity: 1;
    background: var(--header-pill-hover-bg);
    color: var(--header-pill-hover-text);
    transform: none;
}
.header .nav-link[aria-current="page"] {
    opacity: 1;
    background: var(--header-pill-active-grad);
    color: var(--header-pill-active-text);
    box-shadow: 0 6px 18px -6px var(--accent-ring);
}
.header .nav-link i { opacity: 0.85; }

/* ---------- 2. Лента цифр ---------- */
.pulse-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    backdrop-filter: blur(6px);
    overflow: hidden;
}
.pulse-stat {
    flex: 1 1 150px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 12px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: inset -1px 0 0 var(--border-soft);
}
.pulse-stat i {
    grid-row: span 2;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 0.95rem;
}
.pulse-stat b { font-size: 1.15rem; }
.pulse-stat span { font-size: 0.74rem; }
.pulse-stat.is-live b::after {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    margin-left: 7px;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent);
    animation: rd-live 1.8s ease-out infinite;
}
@keyframes rd-live {
    to { box-shadow: 0 0 0 8px transparent; }
}
@media (max-width: 560px) {
    .pulse-stat { flex-basis: 50%; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
    .pulse-stat i { display: none; }
}

/* ---------- Баннер ---------- */
.home-banner {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
}
.home-banner-caption h2 {
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

/* ---------- Заголовки секций ---------- */
.section-head { align-items: center; margin-bottom: 22px; }
.section-head .section-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.section-head .section-title::before {
    content: '';
    width: 5px;
    height: 0.9em;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.featured-section { margin-bottom: 56px; }

/* ---------- 3. Карточка турнира ---------- */
#homeTournaments {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.tournament-card.tc-v2 {
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    gap: 0;
}
.tc-v2:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tc-v2 .tournament-header {
    margin: 0;
    padding: 14px 16px;
    min-height: 0;
}
.tc-v2 .tournament-header.has-photo {
    min-height: 150px;
    margin: 0;
    background-image: linear-gradient(180deg, rgba(10, 10, 42, 0.05) 30%, rgba(10, 10, 42, 0.85) 100%), var(--bg-url);
    transition: background-size var(--transition-slow);
}
.tc-v2 .tag-game { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); }
.tc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}
.tc-status::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--info);
}
.tc-status.is-live::before {
    background: var(--danger);
    animation: rd-live 1.8s ease-out infinite;
}
.tc-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 18px;
    flex: 1;
}
.tc-v2 h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.tc-v2 .tournament-desc {
    margin: -4px 0 0;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tc-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--border-soft);
}
.tc-stats > div {
    padding: 9px 10px;
    background: var(--surface-3);
    min-width: 0;
}
.tc-stats dt {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.tc-stats dd {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.25;
}
.tc-stats .tc-prize { color: var(--gold); }
.tc-fill { display: flex; align-items: center; gap: 10px; }
.tc-fill-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-soft);
    overflow: hidden;
}
.tc-fill-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tc-fill-text { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.tc-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tc-dates { font-size: 0.78rem; color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; }
.tc-cta {
    pointer-events: none;
    display: inline-flex; gap: 8px; align-items: center;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    border-color: transparent;
    box-shadow: 0 6px 16px -6px var(--accent-ring);
}
.tc-v2:hover .tc-cta { box-shadow: 0 10px 22px -6px var(--accent-ring); }
.tc-cta i { transition: transform var(--transition-fast); }
.tc-v2:hover .tc-cta i { transform: translateX(3px); }
.tc-v2:hover { transform: translateY(-4px); }

/* ---------- 4. Как это работает ---------- */
.how-it-works[hidden] { display: none; }
.how-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    counter-reset: how;
}
.how-step {
    position: relative;
    padding: 22px 20px 20px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(240px 120px at 0% 0%, var(--accent-soft), transparent 70%),
        var(--surface-2);
    counter-increment: how;
}
.how-step::after {
    content: counter(how, decimal-leading-zero);
    position: absolute;
    top: 14px; right: 18px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
    color: var(--text);
    opacity: 0.08;
}
.how-step-icon {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    margin-bottom: 14px;
    color: var(--on-accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 20px -8px var(--accent-ring);
}
.how-step h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--text); }
.how-step p { font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-snug); margin: 0; }
.how-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
@media (max-width: 760px) {
    .how-steps { grid-template-columns: 1fr; }
}

/* ---------- 5. Компактные пустые блоки на главной ---------- */
#homeStreams .empty-state,
#homeTournaments .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 22px;
    min-height: 0;
}
#homeStreams .empty-state i,
#homeTournaments .empty-state i { margin: 0; }
#homeStreams .empty-state p,
#homeTournaments .empty-state p { margin: 0; }
