/* The landing's lean layout (templates/landing_base.html, decision 2026-11-17 "One Dark
 * Table"). Linear's measured rules: a near-black page, surfaces about 1% apart, four text
 * grays, one container, one accent (teal green, for live state and lines only), Inter for
 * everything except the wordmark and the heading (Saira Condensed capitals).
 * Dark is the look; light keeps the same structure with its own grays.
 * base.html loads this file too, for the shared header and footer only
 * (templates/partials/site_header.html and site_footer.html, decision 2026-11-18): the chrome
 * rules match body.lp or body.pe-site (base.html's body), and every page-level rule stays on
 * body.lp. :is() keeps each selector's specificity as it was, so the landing does not change.
 * The base.html-only rules are at the end of the file. */

body.lp {
    --lp-page: #08090A;
    --lp-s1: #0F1011;
    --lp-s2: #161718;
    --lp-hair: rgba(255, 255, 255, 0.08);
    --lp-t1: #F7F8F8;
    --lp-t2: #D0D6E0;
    --lp-t3: #8A8F98;
    --lp-t4: #62666D;
    --lp-accent: #34D399;
    --lp-display: 'Saira Condensed', 'Arial Narrow', sans-serif;
    /* One container: 1320 max with 60px gutters, shrinking on short desktop screens so the
       first row of games reaches the first screen. */
    --lp-col: min(1320px, 100% - 120px, max(960px, calc((100vh - 230px) * 16 / 9)));

    margin: 0;
    background: var(--lp-page);
    color: var(--lp-t2);
    font: 400 15px/1.5 Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body.lp {
    --lp-page: #F7F8F8;
    --lp-s1: #FFFFFF;
    --lp-s2: #ECEEF0;
    --lp-hair: rgba(8, 9, 10, 0.1);
    --lp-t1: #08090A;
    --lp-t2: #30343A;
    --lp-t3: #5E636B;
    --lp-t4: #8A8F98;
    --lp-accent: #047857;
}

html:has(body.lp) {
    background: var(--lp-page, #08090A);
}

.lp-wrap {
    width: var(--lp-col);
    margin-left: auto;
    margin-right: auto;
}

/* One link style everywhere: primary text, a quiet underline, the accent on hover.
   The bundled site CSS colours `a:not(.btn):not(.nav-link)`; these selectors outrank it.
   Scoped to the page's own parts so the cookie strip (added to <body>) keeps its colours. */
body.lp :is(.lp-main, .lp-foot) a:not(.btn):not(.nav-link),
body.lp :is(.lp-main, .lp-foot) a:not(.btn):not(.nav-link):visited {
    color: var(--lp-t1);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--lp-t1) 28%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

body.lp :is(.lp-main, .lp-foot) a:not(.btn):not(.nav-link):hover {
    color: var(--lp-t1);
    text-decoration-color: var(--lp-accent);
}

body.lp a:focus-visible,
body.lp button:focus-visible,
body.lp summary:focus-visible {
    outline: 2px solid var(--lp-t1);
    outline-offset: 2px;
    border-radius: 4px;
}

.lp-skip {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    padding: 8px 12px;
    background: var(--lp-s2);
}

.lp-skip:focus {
    left: 8px;
}

/* ── Top bar: the mark and wordmark, six text links, Log in or the account on the right ── */
.lp-top {
    position: relative;
    z-index: 20;
    flex: none;
}

.lp-top__bar {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 64px;
}

:is(body.lp, body.pe-site) .lp-logo:not(.btn):not(.nav-link),
:is(body.lp, body.pe-site) .lp-logo:not(.btn):not(.nav-link):visited,
:is(body.lp, body.pe-site) .lp-logo:not(.btn):not(.nav-link):hover {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    color: var(--lp-t1);
    font: 700 20px/1 var(--lp-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.lp-logo img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex: none;
}

.lp-nav {
    display: flex;
    gap: 24px;
}

/* main.bundled.css paints #navbarNav with var(--nav-bg) !important up to 991px; inline,
   the links sit on the page itself. */
:is(body.lp, body.pe-site) #navbarNav {
    --nav-bg: transparent;
}

:is(body.lp, body.pe-site) .lp-nav a:not(.btn):not(.nav-link),
:is(body.lp, body.pe-site) .lp-nav a:not(.btn):not(.nav-link):visited {
    color: var(--lp-t2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

:is(body.lp, body.pe-site) .lp-nav a:not(.btn):not(.nav-link):hover {
    color: var(--lp-t1);
}

.lp-top__sp {
    flex: 1;
}

:is(body.lp, body.pe-site) .lp-login:not(.btn):not(.nav-link),
:is(body.lp, body.pe-site) .lp-login:not(.btn):not(.nav-link):visited,
:is(body.lp, body.pe-site) .lp-login:not(.btn):not(.nav-link):hover {
    flex: none;
    padding: 7px 14px;
    border: 1px solid var(--lp-hair);
    border-radius: 8px;
    background: var(--lp-s1);
    color: var(--lp-t1);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

/* Signed in: the account is a plain disclosure (no Bootstrap JS); Get Credits lives in it. */
.lp-account {
    position: relative;
    flex: none;
}

.lp-account summary {
    list-style: none;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 14px;
    border: 1px solid var(--lp-hair);
    border-radius: 8px;
    background: var(--lp-s1);
    color: var(--lp-t1);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.lp-account summary::-webkit-details-marker {
    display: none;
}

.lp-account__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    padding: 6px 0;
    border: 1px solid var(--lp-hair);
    border-radius: 10px;
    background: var(--lp-s2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.lp-account__credits {
    margin: 0;
    padding: 8px 16px 6px;
    font-size: 12px;
    color: var(--lp-t3);
}

:is(body.lp, body.pe-site) .lp-account__menu a:not(.btn):not(.nav-link),
:is(body.lp, body.pe-site) .lp-account__menu a:not(.btn):not(.nav-link):visited {
    display: block;
    padding: 8px 16px;
    color: var(--lp-t2);
    font-size: 14px;
    text-decoration: none;
}

:is(body.lp, body.pe-site) .lp-account__menu a:not(.btn):not(.nav-link):hover {
    background: var(--lp-s1);
    color: var(--lp-t1);
}

:is(body.lp, body.pe-site) .lp-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--lp-t1);
    cursor: pointer;
    flex-direction: column;
    gap: 0;
}

.lp-menu-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    margin: 2px auto;
    background: currentColor;
}

/* ── Body ── */
.lp-main {
    flex: 1 0 auto;
}

/* ── Footer: one row of muted links ── */
.lp-foot {
    flex: none;
    margin-top: 72px;
    border-top: 1px solid var(--lp-hair);
}

.lp-foot__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    padding-top: 22px;
}

:is(body.lp, body.pe-site) .lp-foot__links a:not(.btn):not(.nav-link),
:is(body.lp, body.pe-site) .lp-foot__links a:not(.btn):not(.nav-link):visited,
:is(body.lp, body.pe-site) .lp-theme {
    padding: 0;
    border: 0;
    background: none;
    color: var(--lp-t3);
    font: 400 13px/1.5 Inter, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

:is(body.lp, body.pe-site) .lp-foot__links a:not(.btn):not(.nav-link):hover,
:is(body.lp, body.pe-site) .lp-theme:hover {
    color: var(--lp-t2);
}

.lp-foot__note {
    margin: 10px 0 0;
    padding-bottom: 40px;
    font-size: 12px;
    /* t3, not the dimmer t4: the copyright and disclaimer text has to clear 4.5:1 on the
       page in both themes (t4 was 3.5:1 dark and 3:1 light). */
    color: var(--lp-t3);
}

/* ── Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
    body.lp {
        --lp-col: calc(100% - 64px);
    }

    .lp-top__bar {
        gap: 18px;
    }

    .lp-nav {
        gap: 16px;
    }
}

/* ── Phone: the links fold into a panel under the bar ── */
@media (max-width: 1023px) and (min-width: 768px) {
    .lp-logo span {
        display: none;
    }
}

@media (max-width: 767px) {
    body.lp {
        --lp-col: calc(100% - 32px);
    }

    .lp-top__bar {
        height: 56px;
        gap: 12px;
    }

    :is(body.lp, body.pe-site) .lp-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* navbar-mobile.js toggles .show; Bootstrap's CSS is not on this page, so the hide
       rule is here. Without it the six links would always show. */
    .lp-nav.collapse:not(.show) {
        display: none;
    }

    /* main.bundled.css paints #navbarNav with var(--nav-bg) !important below 992px (the
       site's navy); pointing that variable at this page's surface keeps one set of greys. */
    :is(body.lp, body.pe-site) #navbarNav {
        --nav-bg: var(--lp-s1);
    }

    .lp-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 56px;
        flex-direction: column;
        gap: 0;
        background: var(--lp-s1);
        border-bottom: 1px solid var(--lp-hair);
    }

    :is(body.lp, body.pe-site) .lp-nav a:not(.btn):not(.nav-link),
    :is(body.lp, body.pe-site) .lp-nav a:not(.btn):not(.nav-link):visited {
        display: block;
        padding: 14px 16px;
        border-top: 1px solid var(--lp-hair);
        font-size: 15px;
        color: var(--lp-t1);
    }

    .lp-account summary {
        max-width: 150px;
    }

    .lp-foot {
        margin-top: 48px;
    }

    .lp-foot__links {
        gap: 10px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.lp a {
        transition: none !important;
    }
}

/* ── base.html pages: the same header and footer over Bootstrap and the site bundle ──
 * Scoped to body.pe-site, so none of this reaches the landing. The tokens repeat the landing's
 * so the chrome looks the same whatever the page underneath paints; the header and footer carry
 * their own background for the same reason. */
body.pe-site {
    --lp-page: #08090A;
    --lp-s1: #0F1011;
    --lp-s2: #161718;
    --lp-hair: rgba(255, 255, 255, 0.08);
    --lp-t1: #F7F8F8;
    --lp-t2: #D0D6E0;
    --lp-t3: #8A8F98;
    --lp-t4: #62666D;
    --lp-accent: #34D399;
    --lp-display: 'Saira Condensed', 'Arial Narrow', sans-serif;
    --lp-col: min(1320px, 100% - 120px);
}

[data-theme="light"] body.pe-site {
    --lp-page: #F7F8F8;
    --lp-s1: #FFFFFF;
    --lp-s2: #ECEEF0;
    --lp-hair: rgba(8, 9, 10, 0.1);
    --lp-t1: #08090A;
    --lp-t2: #30343A;
    --lp-t3: #5E636B;
    --lp-t4: #8A8F98;
    --lp-accent: #047857;
}

body.pe-site :is(.lp-top, .lp-foot) {
    background: var(--lp-page);
    color: var(--lp-t2);
    font: 400 15px/1.5 Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Above the pages' own sticky and raised parts (the account menu and the phone panel drop over
   them), below Bootstrap's modals (1055). */
body.pe-site .lp-top {
    z-index: 1030;
    border-bottom: 1px solid var(--lp-hair);
}

/* Bootstrap's .collapse:not(.show) hides the links at every width; from 768px they sit inline
   in the bar as on the landing. Under 768px the landing's phone rule above folds them. */
@media (min-width: 768px) {
    body.pe-site .lp-nav.collapse {
        display: flex;
    }
}

/* global.css (loaded by about nine pages) forces #navbarNav to a light grey and position:
   relative below 992px, with !important, for the old Bootstrap navbar. */
@media (max-width: 991.98px) {
    body.pe-site #navbarNav.lp-nav {
        background-color: var(--nav-bg) !important;
    }
}

/* The track record as one quiet line under the nav row (decision 2026-11-18, d3).
   static/js/trust-banner.js fills it by id and hides it when no week has results. */
body.pe-site .pe-track {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 16px;
    margin-top: -8px;
    padding-bottom: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--lp-t3);
}

body.pe-site .pe-track__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
    margin: 0;
}

body.pe-site .pe-track .stat-label {
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: 0;
    text-transform: none;
}

/* trust-banner.js paints the rate a pale green from 55% for the old green bar; on this line the
   rate is the accent in both themes. */
body.pe-site .pe-track__rate {
    color: var(--lp-accent) !important;
    font-weight: 500;
}

body.pe-site .pe-track__sep {
    color: var(--lp-t4);
}

body.pe-site .pe-track__link:not(.btn):not(.nav-link),
body.pe-site .pe-track__link:not(.btn):not(.nav-link):visited {
    color: var(--lp-t2);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

body.pe-site .pe-track__link:not(.btn):not(.nav-link):hover {
    color: var(--lp-t1);
}

@media (min-width: 768px) and (max-width: 1023px) {
    body.pe-site {
        --lp-col: calc(100% - 64px);
    }
}

@media (max-width: 767px) {
    body.pe-site {
        --lp-col: calc(100% - 32px);
    }

    /* global.css's position: relative !important would pin the phone panel into the bar. */
    body.pe-site #navbarNav.lp-nav {
        position: absolute !important;
    }

    body.pe-site .pe-track {
        margin-top: 0;
        font-size: 12px;
    }
}
