/* =========================================
   Layout — TopMenuLayout
   ========================================= */
:root {
    /* Site-wide content width.
       --site-content-max is the canonical page width every page is capped at,
       so home / leaderboards / store / blog all align to the same width.
       Value matches the store grid (5 × 220px card + 4 × 16px gap = 1164px). */
    --site-content-max: 1164px;
    --site-content-narrow: 698px;
    --content-max: 1280px;
    --content-vw: 94vw;

    --pixel-outline:
        1px 1px 0 #1c0f10,
        -1px 1px 0 #1c0f10,
        1px -1px 0 #1c0f10,
        -1px -1px 0 #1c0f10,
        0 2px 0 rgba(0, 0, 0, 0.55);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-container {
    flex: 1;
    background-image: url('/images/WebUI/Landscape.png?v=2');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    min-height: 100dvh;
    max-height: 100dvh;
    position: relative;
}

.top-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.top-overlay:has(.account-button-container:hover),
.top-overlay:has(.account-button-container:focus-within) {
    z-index: 1000000;
}

/* Fixed rather than absolute because it lives inside the scroller — on desktop it must
   stay pinned while the content moves past it. */
.top-overlay-branding {
    position: fixed;
    top: 25px;
    left: 0;
    right: 0;
    line-height: 0;
    z-index: 150;
    pointer-events: none;
}

.top-overlay-branding > a {
    pointer-events: auto;
    position: absolute;
    top: 0;
    left: calc(50% - 174px);
    display: block;
    width: 349px;
    transition: left 0.35s ease, width 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .top-overlay-branding > a {
        transition: none;
    }
}

.top-overlay-branding img {
    image-rendering: pixelated;
    width: 100%;
    height: auto;
}

.top-overlay-nav {
    position: absolute;
    top: 25px;
    right: 4%;
    display: flex;
    align-items: flex-start;
    gap: 2vw;
    z-index: 160;
}

.top-overlay-nav .account-button-container {
    padding-top: 0;
    width: auto;
    height: auto;
}

.top-overlay-nav .account-button--text-only {
    position: static;
    padding: 0;
    height: auto;
}

.content-overlay {
    margin-top: 130px;
    padding-top: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.content-overlay.has-scroll {
    scrollbar-gutter: stable;
}

.page-container {
    width: 100%;
    max-width: min(var(--site-content-max), var(--content-vw));
    margin-inline: auto;
    scrollbar-gutter: stable both-edges;
}

@media (min-width: 900px) {
    .top-overlay-branding > a {
        left: calc(50% - 349px);
        width: 698px;
    }

    .main-container.is-compact .top-overlay-branding > a {
        left: 80px;
        width: 349px;
    }

    .content-overlay {
        padding-top: 110px;
    }
}

@media (min-width: 769px) and (max-width: 899px) {
    .top-overlay-branding > a {
        left: 80px;
    }
}

/* Footer + region switcher styles live in footer.css (loaded separately). */

@media (max-width: 768px) {
    .top-overlay-nav {
        display: none;
    }

    .content-overlay {
        margin-top: 0;
        padding-top: 25px;
    }
    
    .content-overlay::after {
        content: "";
        display: block;
        flex-shrink: 0;
        height: 96px;
    }

    .top-overlay-branding {
        position: static;
        flex-shrink: 0;
        margin-bottom: 20px;
    }

    .top-overlay-branding > a {
        position: static;
        margin-inline: auto;
        max-width: 100%;
        transition: none;
    }
}

/* =========================================
   Error Pages
   ========================================= */
.enthroned-error-page {
    display: flex;
    flex-direction: row;
    align-items: center;
    max-width: 700px;
    margin: 3.5rem auto 0;
    border-image: url('/images/WebUI/Error_Box_Web.png') 20 16 20 16 fill / 40px 32px 40px 32px;
    padding: calc(40px + 2.5rem) calc(32px + 2.5rem) calc(40px + 2.5rem) calc(32px + 2.5rem);
    image-rendering: pixelated;
    gap: 2rem;
}

.enthroned-error-page .error-icon {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
}

.enthroned-error-page .error-icon img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.enthroned-error-page .error-content {
    text-align: center;
}

.enthroned-error-page .error-code {
    font-family: 'Ithaca', serif;
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    color: #c8a94e;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.enthroned-error-page .error-title {
    font-family: 'Ithaca', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #A8483F;
    margin-top: 0.5rem;
}

.enthroned-error-page .error-message {
    font-family: 'Ithaca', serif;
    font-size: 1.1rem;
    color: #d4cbbe;
    margin-top: 0.75rem;
    max-width: 420px;
    margin-inline: auto;
}

.enthroned-error-page .error-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.enthroned-error-page .btn-error {
    font-family: 'Ithaca', serif;
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    font-size: 0.95rem;
    border: 2px solid #A8483F;
}

.enthroned-error-page .btn-error:hover {
    transform: translateY(-1px);
}

.enthroned-error-page .btn-error-primary {
    background: #c8a94e;
    color: #A8483F;
    border-color: #c8a94e;
}

.enthroned-error-page .btn-error-primary:hover {
    background: #d4b85c;
    border-color: #d4b85c;
}

.enthroned-error-page .btn-error-secondary {
    background: #A8483F;
    color: #c8a94e;
    border-color: #A8483F;
}

.enthroned-error-page .btn-error-secondary:hover {
    background: #934039;
    border-color: #934039;
}

@media (max-width: 768px) {
    .enthroned-error-page {
        flex-direction: column;
        text-align: center;
    }

    .enthroned-error-page .error-content {
        text-align: center;
    }

    .enthroned-error-page .error-icon {
        width: 100px;
        height: 100px;
    }

    .enthroned-error-page .error-code {
        font-size: 5rem;
    }

    .enthroned-error-page .error-title {
        font-size: 1.5rem;
    }

    .enthroned-error-page .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

