:root {
    --bg: #0c0c0c;
    --surface: #141414;
    --surface-2: #1a1a1a;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(212, 175, 55, 0.35);
    --gold: #d4af37;
    --gold-dim: #9a7b2a;
    --gold-light: #f0e0a8;
    --text: #f2f2f2;
    --text-muted: #8a8a8a;
    --accent-red: #c43c3c;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --radius: 12px;
    --nav-h: 4rem;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dim) var(--surface-2);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

body {
    font-family: 'Space Grotesk', 'Montserrat', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
    font-size: 15px;
    overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 4px; }
*::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; border: 2px solid var(--surface-2); }
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }
*::-webkit-scrollbar-corner { background: var(--surface-2); }

/* ── Shape field (animejs-style background) ── */
.shape-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape-field svg {
    width: 100%;
    height: 100%;
}

.shape-field .geo {
    fill: none;
    stroke: rgba(212, 175, 55, 0.12);
    stroke-width: 1;
}

.shape-field .geo-fill {
    fill: rgba(212, 175, 55, 0.04);
    stroke: rgba(212, 175, 55, 0.15);
    stroke-width: 1;
}

.shape-field .geo-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

/* ── Scroll progress ── */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 200;
    pointer-events: none;
}

/* ── Curtain ── */
.page-curtain {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.page-curtain.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.curtain-shapes {
    display: flex;
    gap: 8px;
}

.curtain-shape {
    width: 12px;
    height: 12px;
    border: 1px solid var(--gold);
    background: transparent;
}

.curtain-shape:nth-child(2) { border-radius: 50%; }
.curtain-shape:nth-child(3) { transform: rotate(45deg); }

.curtain-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Nav ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: var(--nav-h);
    border-bottom: 1px solid var(--border);
    background: rgba(12, 12, 12, 0.85);
    backdrop-filter: blur(8px);
}

.logo {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.logo span { color: var(--gold); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s, background 0.25s;
}

@media (hover: hover) {
    .nav-links a:hover { color: var(--text); }
}

.nav-links a.active {
    color: var(--gold-light);
    border-color: var(--border-strong);
    background: rgba(212, 175, 55, 0.08);
}

/* ── Layout ── */
main {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem 5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ── Hero ── */
.hero-header {
    width: 100%;
    text-align: center;
    padding: 4rem 1.5rem 3.5rem;
    margin-bottom: 1rem;
}

.hero-deco {
    width: min(280px, 70%);
    height: 40px;
    margin: 0 auto 2rem;
    display: block;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.hero-line {
    display: block;
}

.hero-line--primary { color: var(--text); }
.hero-line--secondary {
    font-size: 0.55em;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.35em;
    letter-spacing: 0.02em;
}

p.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 2rem;
    font-weight: 400;
    line-height: 1.7;
}

.hero-divider {
    width: 48px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 2rem;
    transform-origin: center;
}

.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.6rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 8px;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.btn-gold {
    background: var(--gold);
    color: #0c0c0c;
    border: 1px solid var(--gold);
}

@media (hover: hover) {
    .btn-gold:hover { background: var(--gold-light); }
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .btn-outline:hover {
        border-color: var(--border-strong);
        color: var(--gold-light);
    }
}

.btn-sm { padding: 0.45rem 1.2rem; font-size: 0.72rem; }

/* ── Sections ── */
.section-block {
    width: 100%;
    margin-top: 5rem;
    padding-top: 1rem;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.section-line {
    flex: 1;
    height: 2px;
    min-width: 0;
    display: block;
    transform-origin: left center;
}

.section-line--right { transform-origin: right center; }

.section-title {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.section-title span { color: var(--gold); }

.reveal-section {
    opacity: 1;
    transform: none;
}

.reveal-section.is-hidden {
    opacity: 0;
    transform: translateY(32px);
}

.reveal-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Stats ── */
.stats-loading-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.loading-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    opacity: 0;
    transform: scale(0.92);
}

.stat-card[data-stat="users"] { --stat-accent: var(--gold-light); }
.stat-card[data-stat="chats"] { --stat-accent: #6fcf97; }
.stat-card[data-stat="games"] { --stat-accent: var(--gold); }

.stat-card.animated {
    opacity: 1;
    transform: scale(1);
}

.circular-progress {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 1.25rem;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.circular-progress circle.bg { stroke: rgba(255, 255, 255, 0.06); }

.circular-progress circle.progress {
    stroke: var(--stat-accent, var(--gold));
    stroke-dasharray: 628;
    stroke-dashoffset: 628;
}

.stat-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* Touch center highlight */
@media (hover: none), (pointer: coarse) {
    body.is-touch .stat-card.animated.center-active {
        border-color: var(--border-strong);
        transform: scale(1.02);
    }

    body.is-touch .stat-card.animated.center-active .circular-progress circle.progress {
        stroke-width: 5;
    }

    body.is-touch .stat-card.animated.center-active .stat-value {
        color: var(--stat-accent, var(--gold));
    }
}

@media (hover: hover) {
    .stat-card.animated:hover {
        border-color: var(--border-strong);
        transform: translateY(-4px);
    }
}

/* Skeletons */
.skeleton-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    position: relative;
}

.skeleton-ring::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--surface);
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    background: var(--surface-2);
}

.skeleton-text.wide { width: 100px; }
.skeleton-text.narrow { width: 70px; margin-top: 0.4rem; }

/* ── Podium ── */
.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    min-height: 280px;
}

.podium-stage:empty { display: none; min-height: 0; margin-bottom: 0; }

.podium-column {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
}

.podium-column.visible {
    opacity: 1;
    transform: translateY(0);
}

.podium-crown {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    background: var(--surface-2);
    border: 2px solid var(--border);
}

.podium-1 .podium-avatar {
    width: 76px;
    height: 76px;
    border-color: #ffd700;
}

.podium-2 .podium-avatar { border-color: #b0b0b0; }
.podium-3 .podium-avatar { border-color: #cd7f32; }

.podium-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.podium-1 .podium-name { color: var(--gold-light); }

.podium-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.podium-meta span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.podium-meta strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.podium-meta em {
    font-style: normal;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}

.podium-pedestal {
    width: 100%;
    border-radius: 8px 8px 2px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    transform-origin: bottom center;
}

.podium-1 .podium-pedestal {
    height: 110px;
    background: linear-gradient(180deg, #ffd700, #8b6914);
    color: #1a1200;
}

.podium-2 .podium-pedestal {
    height: 80px;
    background: linear-gradient(180deg, #d0d0d0, #707070);
    color: #1a1a1a;
}

.podium-3 .podium-pedestal {
    height: 60px;
    background: linear-gradient(180deg, #e8a86b, #8b4513);
    color: #1a0f05;
}

.podium-skeleton {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    min-height: 240px;
}

.podium-skeleton:empty { display: none; }

.podium-sk-col {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.podium-sk-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.podium-sk-col:nth-child(2) .podium-sk-avatar { width: 76px; height: 76px; }

.podium-sk-pedestal {
    width: 100%;
    border-radius: 8px 8px 2px 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.podium-sk-col:nth-child(1) .podium-sk-pedestal { height: 80px; }
.podium-sk-col:nth-child(2) .podium-sk-pedestal { height: 110px; }
.podium-sk-col:nth-child(3) .podium-sk-pedestal { height: 60px; }

/* ── Players list ── */
.players-rest-title {
    display: none;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
    text-align: left;
    width: 100%;
    opacity: 0;
    transform: translateY(8px);
}

.players-rest-title.is-shown { display: block; }
.players-rest-title.visible { opacity: 1; transform: translateY(0); }

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    opacity: 0;
    transform: translateX(-20px);
}

.player-row.visible {
    opacity: 1;
    transform: translateX(0);
}

@media (hover: hover) {
    .player-row:hover { border-color: var(--border-strong); }
}

.player-rank {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
    width: 2.5rem;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.player-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

.player-stats { display: flex; gap: 1.5rem; }

.player-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.player-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.player-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.skeleton-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.skeleton-player .sk-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    flex-shrink: 0;
}

.skeleton-player .sk-body { flex: 1; }

/* ── VIP ── */
.vip-section { margin-top: 6rem; }

.vip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vip-card {
    padding: 1.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    opacity: 1;
    transform: none;
}

.vip-card.visible { opacity: 1; transform: none; }

.vip-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    color: var(--gold);
}

.vip-icon svg { width: 100%; height: 100%; }

.vip-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.vip-card .vip-games {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.status-private {
    color: var(--text-muted);
    font-size: 0.78rem;
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    grid-column: 1 / -1;
    padding: 2rem;
}

.stats-error {
    color: #e57373;
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.retry-btn {
    margin-top: 1rem;
    cursor: pointer;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (hover: hover) {
    .retry-btn:hover { border-color: var(--border-strong); }
    .vip-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    :root { --nav-h: 3.5rem; }

    nav { padding: 0 1rem; }

    .logo { font-size: 0.85rem; }

    .nav-links {
        gap: 0.15rem;
        overflow-x: auto;
    }

    .nav-links a {
        font-size: 0.65rem;
        padding: 0.35rem 0.6rem;
        flex-shrink: 0;
    }

    main { padding: 2rem 1rem 3.5rem; }

    .hero-header { padding: 2rem 0.5rem 2.5rem; }

    .actions { width: 100%; }

    .actions .btn { flex: 1; min-width: 0; }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    body.is-mobile .stat-card {
        transform: translateY(24px);
    }

    body.is-mobile .stat-card.animated {
        transform: translateY(0);
    }

    body.is-mobile .player-row {
        transform: translateY(16px);
    }

    body.is-mobile .player-row.visible {
        transform: translateY(0);
    }

    .podium-stage { gap: 0.5rem; min-height: 220px; }
    .podium-column { max-width: 110px; }
    .podium-avatar { width: 48px; height: 48px; font-size: 0.9rem; }
    .podium-1 .podium-avatar { width: 56px; height: 56px; }
    .podium-name { font-size: 0.7rem; }
    .podium-1 .podium-pedestal { height: 85px; font-size: 1.2rem; }
    .podium-2 .podium-pedestal { height: 62px; }
    .podium-3 .podium-pedestal { height: 48px; }

    .player-row { padding: 0.75rem 1rem; }
    .player-rank { width: 2rem; font-size: 0.8rem; }
    .player-name { font-size: 0.85rem; }
    .player-stats { gap: 0.75rem; }

    .vip-grid { grid-template-columns: 1fr; }

    html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}