header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--header-top-height) + var(--header-bottom-height));
}

.header-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-top-height);
    background-color: var(--colour-blue);
    display: flex;
    align-items: center;
    box-sizing: border-box;
    z-index: 10000;
}

#header-burger {
    display: none;
}

#header-elements {
    width: 100%;
    display: flex;
    padding: 0 10px;
    box-sizing: border-box;
    gap: 10px;
    font-size: 18px;
}

#header-elements > a {
    padding: 4px 8px;
    display: inline-block;
    text-align: center;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#header-elements > a > img {
    width: auto;
    height: 32px;
}

.header-spacer {
    width: 100%;
    height: 100%;
}

.header-account {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    height: var(--header-top-height);
    width: 200px;
    justify-content: center;
}
.header-account.active::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    translate: -50% 0;
    rotate: 45deg;
    background-color: var(--colour-black);
    width: 20px;
    height: 20px;
    border-top: 1px solid var(--colour-white);
    border-left: 1px solid var(--colour-white);
    cursor: default;
    clip-path: polygon(0 100%, 0 0, 100% 0, 70% 70%);
}
.header-account.active::after {
    content: '';
    width: var(--account-popup-width);
    height: 10px;
    position: absolute;
    top: var(--header-top-height);
    right: 0;
}

#account-username {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
}
#account-username.logged-in {
    flex-direction: column;
    gap: 0;
}
#account-username.logged-in > #account-username-subtext {
    font-size: 12px;
    text-transform: none;
    margin-bottom: -2px;
}

#account-username-subtext {
    font-size: 10px;
    text-transform: uppercase;
}

.header-account > img {
    border-radius: 100%;
    height: calc(100% - 16px);
    width: auto;
}

#account-icon {
    font-size: 14px;    
}

#account-popup {
    display: none;
    position: fixed;
    top: calc(var(--header-top-height) + 10px);
    right: 10px;
    width: var(--account-popup-width);
    height: fit-content;
    background-color: var(--colour-black);
    box-sizing: border-box;
    border: 1px solid var(--colour-white);
    border-radius: 6px;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    z-index: 1001;
}
#account-popup:has(*).visible {
    display: flex;
}

.account-popup-button {
    cursor: pointer;
}

.header-bottom {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: var(--header-bottom-height);
    padding: 0 20px;
    box-sizing: border-box;
    background-color: var(--colour-dblue);
    margin-top: var(--header-top-height);
}

.header-bottom > * {
    font-weight: 100;
    font-size: 18px;
    text-transform: uppercase;
}

@media only screen and (max-width: 800px) {
    #header-elements {
        align-items: flex-start;
        flex-direction: column;
        width: 240px;
        max-width: calc(100vw - 100px);
        background-color: var(--colour-blue);
        height: 100%;
        z-index: 199;
        position: fixed;
        left: -240px;
        transition: left 300ms ease-in-out;
        top: 0;
        padding: 10px;
        height: 200vh;
    }

    #header-burger {
        display: block;
        cursor: pointer;
        width: 60px;
        height: 60px;
        margin: 0;
    }

    #header-fade {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0,0,0,0.8);
        z-index: 100;
        opacity: 0;
        display: none;
        transition: opacity 300ms ease-in-out;
    }

    .header-account {
        position: fixed;
        bottom: 10px;
        flex-direction: row-reverse;
    }

    .header-bottom {
        padding: 0 10px;
    }

    .header-bottom > a {
        overflow-x: hidden;
        width: 0px;
    }
}