:root {
    --header-bg: rgba(15, 15, 16, 0.94);
    --header-bg-scrolled: rgba(10, 10, 11, 0.985);
    --header-surface: #111112;
    --header-nav-surface: #0d0d0e;
    --header-border: rgba(255, 255, 255, 0.12);
}

.header {
    width: 100%;
    padding: 12px var(--page-padding);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: padding 0.3s ease, background 0.3s ease;
}

.header.is-scrolled {
    padding-top: 8px;
    padding-bottom: 8px;
    background: var(--header-bg-scrolled);
}

.header-inner {
    width: 100%;
    max-width: var(--page-width);
    min-height: 64px;
    margin: 0 auto;
    padding: 0 10px 0 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    background: var(--header-surface);
    border: 1px solid var(--header-border);
    clip-path: polygon(
        0 0,
        calc(100% - 13px) 0,
        100% 13px,
        100% 100%,
        13px 100%,
        0 calc(100% - 13px)
    );
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
    transition: min-height 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header.is-scrolled .header-inner {
    min-height: 56px;
    border-color: rgba(255, 101, 0, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.brand {
    width: fit-content;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: auto;
    display: block;
    flex: 0 0 auto;
    transition: width 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header.is-scrolled .brand img {
    width: 30px;
}

.brand:hover img {
    transform: translateY(-2px) rotate(-5deg);
}

.brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 0.9;
}

.brand-copy span {
    color: var(--text);
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-copy strong {
    margin-top: 5px;
    color: var(--orange);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav {
    height: 44px;
    display: flex;
    align-items: stretch;
    justify-self: center;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: var(--header-nav-surface);
    overflow: visible;
}

.nav-item-games {
    height: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
}

.nav > a,
.nav > .nav-item-games > .nav-top-link {
    min-width: 126px;
    height: 100%;
    padding: 0 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s ease;
}

.nav > a:last-child {
    border-right: 0;
}

.nav > a::before,
.nav > .nav-item-games > .nav-top-link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--orange);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav > a::after,
.nav > .nav-item-games > .nav-top-link::after {
    content: "";
    width: 7px;
    height: 7px;
    position: absolute;
    right: 5px;
    top: 5px;
    z-index: 1;
    background: var(--orange);
    clip-path: polygon(100% 0, 100% 100%, 0 0);
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.nav > a:hover::before,
.nav > a.is-active::before,
.nav > .nav-item-games > .nav-top-link:hover::before,
.nav > .nav-item-games > .nav-top-link.is-active::before,
.nav-item-games:is(:hover, :focus-within, .is-open) > .nav-top-link::before {
    transform: translateY(0);
}

.nav > a:hover,
.nav > a.is-active,
.nav > .nav-item-games > .nav-top-link:hover,
.nav > .nav-item-games > .nav-top-link.is-active,
.nav-item-games:is(:hover, :focus-within, .is-open) > .nav-top-link {
    color: var(--black);
}

.nav > a:hover::after,
.nav > a.is-active::after,
.nav > .nav-item-games > .nav-top-link:hover::after,
.nav > .nav-item-games > .nav-top-link.is-active::after,
.nav-item-games:is(:hover, :focus-within, .is-open) > .nav-top-link::after {
    opacity: 1;
    background: var(--black);
}

.nav-index,
.nav-label,
.nav-chevron {
    position: relative;
    z-index: 2;
}

.nav-index {
    color: var(--orange);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color 0.25s ease, transform 0.25s ease;
}

.nav-label {
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 0.25s ease;
}

.nav-chevron {
    width: 7px;
    height: 7px;
    margin-left: 1px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item-games:is(:hover, :focus-within, .is-open) .nav-chevron {
    transform: translateY(2px) rotate(225deg);
}

.nav > a:hover .nav-index,
.nav > a.is-active .nav-index,
.nav > .nav-item-games > .nav-top-link:hover .nav-index,
.nav > .nav-item-games > .nav-top-link.is-active .nav-index,
.nav-item-games:is(:hover, :focus-within, .is-open) > .nav-top-link .nav-index {
    color: var(--black);
    transform: translateX(-2px);
}

.nav > a:hover .nav-label,
.nav > a.is-active .nav-label,
.nav > .nav-item-games > .nav-top-link:hover .nav-label,
.nav > .nav-item-games > .nav-top-link.is-active .nav-label,
.nav-item-games:is(:hover, :focus-within, .is-open) > .nav-top-link .nav-label {
    transform: translateX(2px);
}

.header-cta {
    min-width: 134px;
    height: 42px;
    padding: 0 16px 0 18px;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    overflow: hidden;
    color: var(--black);
    background: var(--orange);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    clip-path: polygon(
        0 0,
        calc(100% - 10px) 0,
        100% 10px,
        100% 100%,
        10px 100%,
        0 calc(100% - 10px)
    );
    transform: translate(var(--mag-x, 0), var(--mag-y, 0));
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.header-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--text);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-cta:hover::before {
    transform: translateY(0);
}

.header-cta span,
.header-cta strong {
    position: relative;
    z-index: 1;
}

.header-cta strong {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.25s ease;
}

.header-cta:hover strong {
    transform: translate(2px, -2px);
}

@media (max-width: 1080px) {
    .brand-copy {
        display: none;
    }

    .nav > a,
    .nav > .nav-item-games > .nav-top-link {
        min-width: 108px;
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 820px) {
    .header {
        padding: 12px;
    }

    .header.is-scrolled {
        padding: 8px 12px;
    }

    .header-inner {
        min-height: 58px;
        padding-left: 12px;
        grid-template-columns: auto 1fr;
        gap: 14px;
    }

    .nav {
        justify-self: end;
    }

    .nav > a,
    .nav > .nav-item-games > .nav-top-link {
        min-width: 94px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-cta {
        display: none;
    }
}

@media (max-width: 700px) {
    .header-inner {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        padding-right: 8px;
    }

    .nav {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-item-games {
        min-width: 0;
    }

    .nav-index {
        display: none;
    }

    .nav > a,
    .nav > .nav-item-games > .nav-top-link {
        width: 100%;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
        gap: 6px;
    }

    .nav-label {
        min-width: 0;
        font-size: 10px;
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .header {
        padding-left: 6px;
        padding-right: 6px;
    }

    .header.is-scrolled {
        padding-left: 6px;
        padding-right: 6px;
    }

    .header-inner {
        gap: 6px;
        padding-left: 8px;
        padding-right: 6px;
    }

    .brand img {
        width: 25px;
    }

    .nav > a,
    .nav > .nav-item-games > .nav-top-link {
        padding-left: 5px;
        padding-right: 5px;
    }

    .nav-label {
        font-size: 9px;
    }

    .nav-chevron {
        width: 6px;
        height: 6px;
    }
}


/* Shared header hard-lock: keep the exact same dark header on every page. */
body .header,
body .header.is-scrolled {
    background: rgba(15, 15, 16, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

body .header.is-scrolled {
    background: rgba(10, 10, 11, 0.985) !important;
}

body .header .header-inner,
body .header.is-scrolled .header-inner {
    background: #111112 !important;
    background-color: #111112 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body .header.is-scrolled .header-inner {
    border-color: rgba(255, 101, 0, 0.2) !important;
}

body .header .nav {
    background: #0d0d0e !important;
    background-color: #0d0d0e !important;
}


/* Keep header arrows consistent across every page */
.header-cta strong {
    color: var(--black);
    font-family: "IBM Plex Mono", monospace;
    font-variant-emoji: text;
    font-style: normal;
}


@media (hover: none) and (pointer: coarse) {
    html {
        background: #ff6500;
    }
}
