/* Linux Game Bench - site theme (design "B"), shared by all pages.
   Loaded after each page's own <style> (the server injects it before </head>),
   so the tokens below override the older per-page palettes. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url(/static/fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url(/static/fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
    src: url(/static/fonts/chakra-600-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
    src: url(/static/fonts/chakra-600-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(/static/fonts/chakra-700-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(/static/fonts/chakra-700-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --bg: #09090f;
    --card: #13131d;
    --card-alt: #1b1b29;
    --card-hover: #1b1b29;
    --surface: #13131d;
    --border: rgba(255,255,255,0.1);
    --line: rgba(255,255,255,0.1);
    --text: #f5f5fa;
    --text-muted: #b4b4c8;
    --green: #4ade80;
    --yellow: #fcd34d;
    --red: #ff6b6b;
    --blue: #4fc3f7;
    --purple: #b69cff;
    --or: #ff7a1a;
    --or-hover: #ff8f3d;
    --vi: #a78bfa;
    --amd: #c8102e;
    --nv: #76b900;
    --intel: #0071c5;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; padding: 0; margin: 0; overflow-x: hidden; }
.lgb-display, .b-display, h1.lgb-page-title { font-family: 'Chakra Petch', 'Inter', sans-serif; letter-spacing: 0.01em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: 8px;
    background: var(--or); color: #09090f; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
[role="main"]:focus, main:focus { outline: none; }

/* ---------- Site header ---------- */
.lgb-top-wrap { position: relative; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(9,9,15,0.92); margin: 0; padding: 0; text-align: left; }
.b-hero .lgb-top-wrap { background: transparent; border-bottom: 0; }
.lgb-wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.lgb-top { display: flex; align-items: center; gap: 20px; min-height: 72px; position: relative; }
.lgb-logo { display: flex; align-items: center; gap: 10px; font-family: 'Chakra Petch', 'Inter', sans-serif; font-weight: 700; font-size: 20px;
    text-decoration: none; white-space: nowrap; color: var(--text); text-transform: uppercase; letter-spacing: 0.01em; }
.lgb-logo .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #09090f;
    background: conic-gradient(from 200deg, var(--or), var(--vi), var(--or)); }
.lgb-search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; margin: 0;
    background: rgba(19,19,29,.8); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 0 16px; height: 44px; color: var(--text-muted); }
.lgb-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: 500 15px 'Inter', system-ui, sans-serif; height: 100%; padding: 0; }
.lgb-search input::placeholder { color: var(--text-muted); opacity: 1; }
.lgb-search input:focus, .lgb-search input:focus-visible { outline: none; box-shadow: none; }
.lgb-search:focus-within { outline: 3px solid var(--or); outline-offset: 2px; }
.lgb-search-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; list-style: none; margin: 0; padding: 6px;
    background: #13131d; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.6); max-height: 360px; overflow-y: auto; }
.lgb-search-list[hidden] { display: none; }
.lgb-search-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text); font-size: 15px; }
.lgb-search-list li[aria-selected="true"], .lgb-search-list li:hover { background: rgba(255,122,26,.16); }
.lgb-search-list li img { width: 48px; height: 22px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.lgb-search-list .kind { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.lgb-search-list .empty { cursor: default; color: var(--text-muted); }
.lgb-nav { display: flex; gap: 18px; margin-left: auto; align-items: center; font-weight: 600; font-size: 15px; }
.lgb-nav > a { text-decoration: none; color: var(--text-muted); white-space: nowrap; }
.lgb-nav > a:hover, .lgb-nav > a[aria-current="page"] { color: var(--text); }
.lgb-auth { display: flex; gap: 10px; align-items: center; }
.lgb-auth .lgb-login { color: var(--text-muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.lgb-auth .lgb-login:hover { color: var(--text); }
.lgb-menu { display: none; align-items: center; gap: 6px; cursor: pointer; font: 700 15px 'Inter', system-ui, sans-serif; border-radius: 10px;
    padding: 9px 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); color: var(--text); }
.lgb-menu-panel { position: absolute; right: 24px; top: 68px; z-index: 50; display: flex; flex-direction: column; min-width: 220px; padding: 8px;
    background: #13131d; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.6); }
.lgb-menu-panel[hidden] { display: none; }
.lgb-menu-panel a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 9px; font-weight: 600; }
.lgb-menu-panel a:hover { background: rgba(255,255,255,.08); }

/* Buttons */
.lgb-btn, .b-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 15px;
    border-radius: 12px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.2; }
.lgb-btn.or, .b-btn.or { background: var(--or); color: #09090f; }
.lgb-btn.or:hover, .b-btn.or:hover { background: var(--or-hover); }
.lgb-btn.gl, .b-btn.gl { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: var(--text); }
.lgb-btn.gl:hover, .b-btn.gl:hover { background: rgba(255,255,255,.18); }
.lgb-btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.lgb-btn.lg, .b-btn.lg { padding: 14px 22px; font-size: 16px; }

/* User dropdown (same markup on every page) */
.user-dropdown { position: relative; }
.user-dropdown-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 12px; cursor: pointer; color: var(--text); font: inherit; }
.user-dropdown-toggle:hover { background: rgba(255,255,255,0.12); }
.user-dropdown-toggle .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #09090f;
    background: conic-gradient(from 200deg, var(--or), var(--vi), var(--or)); }
.user-dropdown-toggle .user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-dropdown-toggle .username { font-weight: 600; color: var(--text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-toggle .premium-badge { font-size: 12px; color: var(--yellow); }
.user-dropdown-toggle .arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; }
.user-dropdown.open .arrow { transform: rotate(180deg); }
.notification-bell { position: relative; text-decoration: none; display: inline-flex; padding: 2px 4px; }
.notification-bell[hidden] { display: none; }
.notification-badge { position: absolute; top: -4px; right: -6px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; min-width: 17px; height: 17px;
    border-radius: 9px; display: none; align-items: center; justify-content: center; padding: 0 4px; }
.notification-badge.show { display: flex; }
.user-dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; z-index: 60; display: none;
    background: #13131d; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.6); text-align: left; }
.user-dropdown.open .user-dropdown-menu { display: block; }
.user-dropdown-menu a, .user-dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px;
    color: var(--text); text-decoration: none; background: none; border: 0; font: 600 14px 'Inter', system-ui, sans-serif; cursor: pointer; text-align: left; }
.user-dropdown-menu a:hover, .user-dropdown-menu button:hover { background: rgba(255,255,255,.08); }
.user-dropdown-menu .icon { width: 20px; text-align: center; }
.user-dropdown-menu .divider { height: 1px; background: var(--line); margin: 6px 4px; }
.user-dropdown-menu .logout-item { color: var(--red); }

/* Unread dot on the avatar (the bell hides at 0 and is easy to miss on phones) + count in the menu */
.user-dropdown-toggle .avatar { position: relative; }
.user-dropdown-toggle .avatar[data-unread]::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px;
    border-radius: 50%; background: #ef4444; border: 2px solid var(--bg); }
.lgb-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff;
    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.lgb-count[hidden] { display: none; }
/* Next-badge card in the account menu */
.user-dropdown-menu a.lgb-tier { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 6px; background: rgba(255,255,255,.04); }
.user-dropdown-menu a.lgb-tier[hidden] { display: none; }
.lgb-tier-head { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.lgb-tier-head b { color: var(--text); }
.lgb-tier-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.lgb-tier-bar i { display: block; height: 100%; background: var(--or); border-radius: 3px; }
.lgb-tier small { font-size: 12px; color: var(--text-muted); font-weight: 500; }
/* Log in / Register in the phone menu */
.lgb-menu-panel .lgb-panel-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.lgb-menu-panel a.lgb-panel-cta { background: var(--or); color: #09090f; text-align: center; margin-top: 2px; }
.lgb-menu-panel a.lgb-panel-cta:hover { background: var(--or-hover); }
/* Run trend badge (My Benchmarks, profile) */
.run-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
    white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.run-trend.up { color: var(--green); background: rgba(74,222,128,.12); }
.run-trend.down { color: var(--red); background: rgba(255,107,107,.12); }
.run-trend:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Page scaffolding for sub pages ---------- */
h1.lgb-page-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; text-transform: uppercase; color: var(--text); margin: 32px 0 8px;
    background: none; -webkit-text-fill-color: currentColor; font-weight: 700; }
/* Sub pages used to center themselves on <body>; the shared header needs a normal flow */
body { display: block; max-width: none; min-height: 100vh; }
.lgb-main { margin-left: auto; margin-right: auto; padding: 0 24px 24px; box-sizing: border-box; }
.lgb-auth-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 56px 16px 24px; box-sizing: border-box; }
.lgb-legal { max-width: 800px; margin: 0 auto; padding: 8px 24px 24px; box-sizing: border-box; line-height: 1.7; }
.lgb-legal h1 { font-family: 'Chakra Petch', 'Inter', sans-serif; text-transform: uppercase; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 32px 0 12px; color: var(--text); }
.lgb-page-sub { color: var(--text-muted); margin: 0 0 24px; }
/* Title inside the login/register/password cards */
.lgb-auth-wrap .logo h1 { font-family: 'Chakra Petch', 'Inter', sans-serif; text-transform: uppercase; font-size: 30px; line-height: 1.1;
    background: none; -webkit-text-fill-color: currentColor; color: var(--text); }

/* Common legacy components in the new palette */
.btn-primary { background: var(--or) !important; color: #09090f !important; border-color: transparent !important; }
.btn-primary:hover:not(:disabled) { background: var(--or-hover) !important; opacity: 1; }
.btn-secondary { background: rgba(255,255,255,.1); color: var(--text); border: 1px solid rgba(255,255,255,.3); }
input, select, textarea, button { font-family: inherit; }
a { color: var(--blue); }
p a, label a { text-decoration: underline; text-underline-offset: 2px; }

/* Custom tooltip (replaces native title tooltips on every page) */
.lgb-tip { position: fixed; z-index: 100000; max-width: 320px; padding: 6px 10px; border-radius: 6px;
    background: #13131d; color: var(--text); border: 1px solid rgba(255,255,255,0.22); font-size: 13px; line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45); pointer-events: none; opacity: 0; transition: opacity 0.35s; }
.lgb-tip.show { opacity: 1; transition: opacity 0.12s; }

/* ---------- Site footer ---------- */
.lgb-foot { max-width: 1400px; margin: 48px auto 0; padding: 28px 24px 40px; border-top: 1px solid var(--line); color: var(--text-muted);
    text-align: center; font-size: 14px; }
.lgb-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lgb-foot a:hover { color: var(--or); }
.lgb-foot .kofi { color: #ff8a87; }
.lgb-foot .lgb-support { position: relative; }
.lgb-foot .lgb-support-tip { visibility: hidden; opacity: 0; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    width: 300px; max-width: 80vw; padding: 10px 12px; border-radius: 10px; background: #13131d; border: 1px solid rgba(255,255,255,.2);
    color: var(--text); font-size: 13px; line-height: 1.4; text-align: left; transition: opacity .3s .2s, visibility 0s .5s; z-index: 70; }
.lgb-foot .lgb-support:hover .lgb-support-tip, .lgb-foot .lgb-support:focus-visible .lgb-support-tip { visibility: visible; opacity: 1; transition-delay: 0s; }

@media (max-width: 1180px) {
    .lgb-menu { display: inline-flex; }
    .lgb-nav > a.hide-md { display: none; }
}
/* Tablets / narrow windows: search on its own row, icon-only menu (nav + search + menu don't fit in one row) */
@media (max-width: 900px) {
    .lgb-top { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 12px; min-height: 0; }
    .lgb-search { order: 3; flex: 1 1 100%; max-width: none; }
    .lgb-nav { gap: 10px; }
    .lgb-menu { padding: 9px 10px; }
    .lgb-menu .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .lgb-menu-panel { top: 60px; }
    .lgb-foot .lgb-support-tip { position: fixed; left: 16px; right: 16px; bottom: 72px; width: auto; max-width: none; transform: none; }
}
@media (max-width: 720px) {
    .lgb-wrap { padding: 0 16px; }
    .lgb-logo { font-size: 17px; }
    .lgb-auth .lgb-register { display: none; }
    .lgb-menu-panel { right: 16px; }
    .user-dropdown-toggle .user-info, .user-dropdown-toggle .arrow { display: none; }
    .user-dropdown-toggle { padding: 4px; }
    .lgb-auth { gap: 6px; }
    h1.lgb-page-title { margin-top: 22px; }
    .lgb-foot { padding: 24px 16px 32px; }
    .lgb-main, .lgb-legal { padding: 0 16px 16px; }
    .lgb-auth-wrap { padding-top: 28px; }
}
@media (max-width: 400px) {
    .lgb-logo { font-size: 15px; gap: 8px; }
    .lgb-logo .mark { width: 30px; height: 30px; }
}

/* Two sections side by side (landing pages: game performance + top contributors), stacked on phones */
.lgb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.lgb-two-col > * { min-width: 0; }
@media (max-width: 768px) { .lgb-two-col { grid-template-columns: 1fr; } }
/* Wide tables scroll inside their box on phones instead of widening the page */
.lgb-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
