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

        html {
            scrollbar-gutter: stable;
        }

        :root {
            --text: #e5e7eb;
            --text-dim: #9ca3af;
        }

        /* Hover glow toggle — suppress glow box-shadows AND border flash when disabled */
        body.no-glow *:hover {
            box-shadow: none !important;
            border-color: rgba(var(--primary-rgb), 0.2) !important;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            scrollbar-gutter: stable;
        }

        /* Site menu. Row 1 (.nav-main) is the same on every page; row 2
           (.nav-sub) lists the esport pages and exists only inside /esport.
           No borders or box-shadows in here: body.no-glow recolours both on
           hover, so lines are drawn with backgrounds and pseudo-elements. */
        .nav {
            background: var(--card);
            background: color-mix(in srgb, var(--card) 86%, transparent);
            -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
            position: sticky;
            top: 0;
            z-index: 300;
        }

        /* Accent line under the menu, fading out to the right. */
        .nav::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--primary), rgba(var(--primary-rgb), 0.3) 55%, rgba(var(--primary-rgb), 0.06));
            pointer-events: none;
        }

        .nav-main {
            height: 56px;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1.5rem;
        }

        .nav-left {
            display: flex;
            gap: 1.75rem;
            align-items: center;
            min-width: 0;
        }

        .logo {
            font-size: 1.45rem;
            font-weight: 800;
            color: var(--primary);
            text-decoration: none;
            letter-spacing: -0.5px;
            text-shadow: 0 0 22px rgba(var(--primary-rgb), 0.55);
        }

        .nav-links {
            display: flex;
            gap: 0.15rem;
            align-items: center;
            min-width: 0;
            overflow-x: auto; /* small tablets: scroll instead of covering the right side */
            scrollbar-width: none;
        }

        .nav-link {
            position: relative;
            padding: 0.45rem 0.7rem;
            border-radius: 8px;
            color: var(--text-dim);
            text-decoration: none;
            font-size: 0.92rem;
            font-weight: 600;
            white-space: nowrap;
            transition: color 0.15s, background-color 0.15s;
        }

        .nav-link:hover {
            color: var(--text);
            background: rgba(255, 255, 255, 0.06);
        }

        .nav-link.active {
            color: var(--primary);
            background: rgba(var(--primary-rgb), 0.13);
        }

        .nav-link--worlds,
        .nav-link--worlds:hover,
        .nav-link--worlds.active {
            color: #f5c542;
            background: rgba(245, 197, 66, 0.1);
        }

        .nav-link--worlds:hover,
        .nav-link--worlds.active {
            background: rgba(245, 197, 66, 0.2);
        }

        .nav-right {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-shrink: 0;
        }

        .nav-donate {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.42rem 0.85rem;
            border-radius: 999px;
            background: rgba(var(--primary-rgb), 0.14);
            color: var(--primary);
            font-size: 0.85rem;
            font-weight: 700;
            text-decoration: none;
            white-space: nowrap;
            transition: background-color 0.15s;
        }

        .nav-donate:hover,
        .nav-donate.active {
            background: rgba(var(--primary-rgb), 0.28);
        }

        .nav-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            color: var(--text-dim);
            transition: color 0.15s, background-color 0.15s;
        }

        .nav-icon:hover {
            color: var(--text);
            background: rgba(255, 255, 255, 0.06);
        }

        .nav-icon.active {
            color: var(--primary);
            background: rgba(var(--primary-rgb), 0.13);
        }

        /* Row 2: the pages of the esport section. It scrolls sideways when the
           window is narrower than the links. base.html's esport canvas maths
           counts on rows 1 + 2 being 97px tall. */
        .nav-sub {
            height: 41px;
            padding: 0 2rem 1px;
            display: flex;
            align-items: center;
            gap: 0.15rem;
            background: rgba(0, 0, 0, 0.28);
            overflow-x: auto;
            scrollbar-width: none;
            /* Fades the right padding, so links that run off the edge hint at the scroll. */
            -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
        }

        .nav-links::-webkit-scrollbar,
        .nav-sub::-webkit-scrollbar {
            display: none;
        }

        .nav-sub .nav-link {
            padding: 0.3rem 0.65rem;
            border-radius: 6px;
            font-size: 0.84rem;
        }

        .nav-sub .nav-link.active {
            color: var(--text);
            background: none;
        }

        /* The current esport page is underlined on the menu's accent line. */
        .nav-sub .nav-link.active::after {
            content: '';
            position: absolute;
            left: 0.65rem;
            right: 0.65rem;
            bottom: -6px;
            height: 2px;
            border-radius: 2px;
            background: var(--primary);
        }

        .mode-badge {
            margin-left: auto;
            padding-left: 1rem;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-dim);
            white-space: nowrap;
        }

        /* Small tablets and slim windows: a tighter row 1. */
        @media (max-width: 960px) {
            .nav-main {
                padding: 0 1rem;
                gap: 0.75rem;
            }

            .nav-left {
                gap: 0.9rem;
            }

            .nav-links .nav-link {
                padding: 0.45rem 0.5rem;
                font-size: 0.86rem;
            }

            .nav-sub {
                padding: 0 1rem 1px;
            }

            .nav-sub .nav-link {
                padding: 0.3rem 0.4rem;
                font-size: 0.8rem;
            }
        }

        /* The slimmest desktop layout (just above the phone menu). */
        @media (min-width: 769px) and (max-width: 860px) {
            .logo {
                font-size: 1.25rem;
            }

            .nav-links .nav-link {
                padding: 0.45rem 0.4rem;
                font-size: 0.82rem;
            }
        }

        /* Small laptops: the Donate pill keeps only its heart, which leaves row 1
           enough room for the longest translations (Russian). */
        @media (min-width: 769px) and (max-width: 1100px) {
            .nav-donate span {
                display: none;
            }

            .nav-donate {
                padding: 0.55rem;
            }
        }

        /* Narrow desktop windows: make room for the longer translated labels. */
        @media (max-width: 1200px) {
            .nav-sub .nav-link {
                padding: 0.3rem 0.5rem;
            }

            .mode-badge {
                display: none;
            }
        }

        .username {
            color: var(--text-dim);
            font-size: 0.9rem;
        }

        .btn {
            padding: 0.5rem 1.25rem;
            border-radius: 6px;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.2s;
            border: none;
            cursor: pointer;
        }

        .btn-primary {
            background: var(--primary);
            color: var(--bg);
        }

        .btn-primary:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

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

        .btn-outline:hover {
            background: var(--primary);
            color: var(--bg);
        }

        .container {
            width: 100%;
            max-width: 1400px;
            margin: 0 auto;
            padding: 2.5rem 1.5rem;
        }

        .breadcrumb {
            margin-bottom: 2rem;
            color: var(--text-dim);
            font-size: 0.9rem;
        }

        .breadcrumb a {
            color: var(--primary);
            text-decoration: none;
        }

        .breadcrumb a:hover {
            text-decoration: underline;
        }

        .page-header {
            margin-bottom: 2.5rem;
        }

        .page-title {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            letter-spacing: -1px;
        }

        .page-subtitle {
            color: var(--text-dim);
            font-size: 1.1rem;
        }

        .card {
            background: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            border: 1px solid rgba(255,255,255,0.05);
        }

        .stat-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2.5rem;
        }

        .stat-card {
            background: var(--card);
            padding: 1.75rem;
            border-radius: 12px;
            border-left: 4px solid var(--primary);
        }

        .stat-label {
            font-size: 0.8rem;
            text-transform: uppercase;
            color: var(--text-dim);
            font-weight: 600;
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
        }

        .stat-value {
            font-size: 2.25rem;
            font-weight: 700;
            color: var(--text);
        }

        @media (max-width: 768px) {
            .page-title {
                font-size: 2rem;
            }
        }


        .mobile-menu-btn {
        display: none;
        background: none;
        border: none;
        color: var(--text);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    @media (max-width: 768px) {
        .mobile-menu-btn {
            display: block;
        }

        /* The menu is not sticky on phones, so there is nothing to blur. */
        .nav {
            position: relative;
            background: var(--card);
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
        }

        .nav-main {
            position: relative; /* the dropdown opens under row 1, over row 2 */
            padding: 0 1rem;
            gap: 0.75rem;
        }

        .nav-links {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            z-index: 2;
            background: var(--card);
            flex-direction: column;
            align-items: stretch;
            padding: 0.75rem 1rem 1rem;
            border-bottom: 2px solid var(--primary);
            gap: 0.25rem;
            overflow: visible;
        }

        .nav-links.active {
            display: flex;
        }

        .nav-links .nav-link {
            padding: 0.75rem;
            font-size: 1rem;
        }

        .nav-sub {
            padding: 0 1rem 1px;
            -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1rem), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 1rem), transparent);
        }

        .page-title {
            font-size: 2rem;
        }
    }

    /* The smallest phones: the Donate pill keeps only its heart. */
    @media (max-width: 340px) {
        .nav-donate span {
            display: none;
        }

        .nav-donate {
            padding: 0.55rem;
        }
    }
