@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700;800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 1100px 600px at 15% -10%, rgba(214, 255, 63, 0.055), transparent 60%),
        radial-gradient(ellipse 700px 500px at 100% 10%, rgba(201, 168, 104, 0.045), transparent 60%),
        radial-gradient(ellipse 800px 500px at 50% 110%, rgba(143, 224, 74, 0.05), transparent 60%);
    background-repeat: no-repeat;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; color: inherit; }

h1, h2, h3, h4 {
    text-wrap: balance;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: var(--track-tight);
    line-height: 1.08;
}

.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.font-mono { font-family: var(--font-mono); }

::selection { background: var(--accent-glow); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ===================== App shell: sidebar + content ===================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    margin-left: var(--sidebar-w);
    padding: 40px 48px 90px;
}

.content-wrap {
    max-width: 100%;
    width: min(var(--content-max), 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: var(--fs-h1);
}
.page-header .subtitle {
    color: var(--text-dim);
    font-size: 15px;
    margin-top: 6px;
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}
.section-title h2 { font-size: 22px; }
.section-title .link { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.section-title .link:hover { color: var(--accent); }

.skeleton {
    background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: var(--radius);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-dim); }
.empty-state .empty-icon { font-size: 42px; margin-bottom: 14px; opacity: 0.7; }

/* ===================== Mobile ===================== */
@media (max-width: 960px) {
    .main-content {
        margin-left: 0;
        padding: 24px 18px calc(var(--tabbar-h) + 32px);
    }
    .page-header h1 { font-size: 26px; }
}

/* ===================== Skip link (доступность) ===================== */
.skip-link {
    position: fixed;
    top: -60px; left: 16px;
    z-index: 500;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    font-size: 14px;
    transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: 14px; }

/* Фирменная «линия корта» под заголовком страницы */
.page-header h1 {
    position: relative;
    padding-bottom: 12px;
}
.page-header h1::after {
    content: '';
    position: absolute;
    left: 1px; bottom: 0;
    width: 56px; height: 3px;
    border-radius: var(--radius-full);
    background: var(--accent);
}

/* Ховер-эффекты только там, где есть настоящий ховер (не на тачах) */
@media (hover: none) {
    .card-hoverable:hover { transform: none; }
}


/* ===================== Типографские утилиты ===================== */
/* Все спортивные числа — табличные цифры: колонки не «пляшут» при анимации счётчиков */
.hero-stat .value, .rank-stat .v, .stat-card .value, .h2h-score,
.rank-num, .rank-badge, .data-table td, .progress-ring-label .num {
    font-variant-numeric: tabular-nums;
}

/* Единый «спортивный» надзаголовок: мono, капс, разрядка */
.eyebrow-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    color: var(--text-faint);
}
.eyebrow-label .svg-ic { flex-shrink: 0; }

/* Инлайновые SVG-иконки выравниваются по тексту */
.svg-ic { vertical-align: -0.18em; flex-shrink: 0; }

/* Тонкий растворяющийся по краям разделитель */
.divider {
    height: 1px;
    border: none;
    background: var(--divider);
    margin: 4px 0;
}

/* Пустые состояния: иконка в мягком круге вместо гигантского эмодзи */
.empty-state .empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-faint);
    font-size: initial;
    opacity: 1;
}
.empty-state p { font-size: 14px; }
