/* Garam shared desktop/tablet & mobile shell.
   Keep this stylesheet AFTER /style.css.  Preserves --garam-theme-* variables. */
:root {
    --garam-layout-ink: #111217;
    --garam-layout-muted: #68717e;
    --garam-layout-accent: var(--garam-theme-accent, #087cce);
}
html { scroll-padding-top: 95px; }
html body.garam-shell-body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    width: 100%;
    background: #fff !important;
    color: var(--garam-layout-ink);
}
/* Previously style.css and the old template drew a fixed full-bleed gradient.
   Suppress it so the page stays white OUTSIDE our inset panel. */
html body.garam-shell-body::before,
html body.garam-shell-body::after,
html body.garam-shell-body .garam-page::before {
    content: none !important;
    display: none !important;
}
html body.garam-shell-body #container.garam-site-root {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: #fff;
}
html body.garam-shell-body .white-space { display: none !important; }

/* Desktop and tablet: centered, pure-white navigation tab. */
html body.garam-shell-body header.garam-site-header {
    position: fixed !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    display: grid !important;
    grid-template-columns: minmax(140px, 1fr) minmax(0, auto) minmax(140px, 1fr);
    align-content: center;
    align-items: center;
    column-gap: 14px;
    width: min(1100px, calc(100% - 100px)) !important;
    height: 76px;
    min-height: 0 !important;
    margin: 0;
    padding: 0 18px 0 28px;
    border: 1px solid rgba(0, 0, 0, .035);
    border-top: none;
    border-radius: 0 0 28px 28px;
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 10px 34px rgba(5, 25, 39, .09);
    box-sizing: border-box;
    transition: box-shadow .2s ease;
}
html body.garam-shell-body header.garam-site-header.is-scrolling {
    background: #fff !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 38px rgba(5, 25, 39, .16);
}
.garam-header-brand { min-width: 0; display: flex; align-items: center; }
.garam-brand-link { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.garam-header-logo { display: block; width: clamp(116px, 12vw, 172px); max-width: 100%; height: auto; object-fit: contain; }
html body.garam-shell-body header.garam-site-header nav#menu.garam-header-links {
    display: flex !important;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    flex-wrap: nowrap;
    gap: clamp(8px, 1.55vw, 22px);
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
html body.garam-shell-body #menu.garam-header-links a {
    font-family: inherit;
    font-size: clamp(11px, 1.03vw, 14px);
    font-weight: 700;
    line-height: 1.25;
    color: #181818 !important;
    text-decoration: none !important;
    transition: color .16s;
}
html body.garam-shell-body #menu.garam-header-links a:hover,
html body.garam-shell-body #menu.garam-header-links a:focus-visible { color: var(--garam-layout-accent) !important; }
.garam-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}
/* Dark CTA from the reference, login when signed out; Discord avatar when signed in. */
html body.garam-shell-body a.garam-header-login {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 !important;
    padding: 12px 22px !important;
    min-height: 44px;
    border-radius: 18px;
    border: none;
    background: #0b0b0e !important;
    color: #fff !important;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: transform .18s, background-color .18s;
}
a.garam-header-login:hover { transform: translateY(-1px); background: var(--garam-layout-accent) !important; }
html body.garam-shell-body .garam-account-container {
    position: relative; display: inline-flex; align-items: center; flex-shrink: 0; z-index: 10051;
    overflow: visible !important;
}
.garam-account-trigger {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 0; border: 0; border-radius: 50%;
    background: transparent; cursor: pointer;
}
.garam-account-trigger img {
    display: block; width: 46px; height: 46px; object-fit: cover;
    border-radius: 50%; border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--garam-layout-accent);
}
.garam-account-trigger:focus-visible { outline: 3px solid var(--garam-layout-accent); outline-offset: 5px; }
.garam-account-dropdown {
    position: absolute; top: calc(100% + 14px); right: 0;
    width: 252px; max-width: calc(100vw - 20px); max-height: calc(100dvh - 100px);
    overflow: auto; z-index: 10060;
    padding: 8px; border-radius: 17px;
    border: 1px solid var(--garam-c-b1d8f2, #b1d8f2);
    color: var(--garam-c-123c5c, #123c5c);
    background: #fff; box-shadow: 0 16px 50px rgba(7,24,35,.23);
    font: inherit; font-size: 14px; text-align: left;
}
.garam-account-dropdown[hidden], .garam-theme-palette[hidden] { display: none !important; }
.garam-account-menu-item {
    display: flex; width: 100%; gap: 10px; align-items: center; min-height: 43px;
    padding: 10px 12px; border: 0; border-radius: 11px;
    background: transparent; color: var(--garam-c-155a8d,#155a8d);
    font: inherit; font-weight: 700; font-size: 14px;
    text-decoration: none; box-sizing: border-box; cursor: pointer;
}
.garam-account-menu-item:hover, .garam-account-menu-item:focus-visible { background: var(--garam-c-e5f5ff,#e5f5ff); }
.garam-account-chevron { margin-left: auto; }
.garam-account-logout { margin-top: 5px; border-top: 1px solid var(--garam-c-c8e5f6,#c8e5f6); }
.garam-theme-palette { padding: 12px 10px 14px; border-radius: 12px; background: var(--garam-c-f0f9ff,#f0f9ff); }
.garam-theme-label { display: block; margin-bottom: 12px; font-size: 12px; font-weight: 700; color: var(--garam-c-44718d,#44718d); }
.garam-theme-presets { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.garam-theme-presets button {
    width: 31px; height: 31px; display: inline-flex; border-radius: 50%;
    border: 2px solid white; background: var(--swatch); cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15); transition: transform .15s;
}
.garam-theme-presets button:hover { transform: scale(1.13); }
.garam-theme-presets button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--garam-c-123c5c,#123c5c); }
.garam-theme-custom { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.garam-theme-custom input { width: 42px; height: 32px; padding: 2px; border: 1px solid var(--garam-c-b7d8ed,#b7d8ed); border-radius: 8px; background: white; cursor: pointer; }
.garam-theme-reset { width: 100%; margin-top: 10px; padding: 8px; border: 1px solid var(--garam-c-b1d8f2,#b1d8f2); border-radius: 9px; color: var(--garam-c-155a8d,#155a8d); background: white; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }

/* White outside the rounded panel; theme gradient stays INSIDE. */
html body.garam-shell-body main.garam-site-frame {
    flex: 1 0 auto;
    position: relative;
    isolation: isolate;
    width: calc(100% - 40px);
    max-width: none;
    min-height: max(72vh, 560px);
    margin: 24px 20px 0;
    padding: 125px 0 74px;
    border-radius: 52px 52px 0 0;
    background-color: var(--garam-theme-surface, #d2edfe) !important;
    background-image: var(--garam-theme-gradient, linear-gradient(#087cce,#d2edfe)) !important;
    background-size: 100% 50vh;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px rgba(255,255,255,.13);
    box-sizing: border-box;
}
html body.garam-shell-body main.garam-site-frame > #centertext {
    width: 100%; max-width: none;
    padding: 0 16px;
    margin: 0 auto;
    box-sizing: border-box;
}
/* Some pages were already styled to control the body background; stop these
   old selectors from painting over the new white gutters. */
html body.garam-shell-body.pricing-page,
html body.garam-shell-body.guide-page { background-color: white !important; }

/* The legal footer is FULL BLEED white and visually meets the main panel. */
html body.garam-shell-body footer#jufooter.garam-site-footer {
    position: relative !important;
    z-index: 2;
    flex: 0 0 auto;
    display: block !important;
    height: auto !important;
    width: 100%;
    max-width: none;
    margin: -28px 0 0;
    padding: 68px 34px 26px;
    border-radius: 42px 42px 0 0;
    background: #fff !important;
    color: #101318 !important;
    box-sizing: border-box;
    box-shadow: 0 -4px 18px rgba(0,0,0,.045);
}
.garam-footer-inner { max-width: 1130px; width: 100%; margin: 0 auto; }
.garam-footer-top {
    display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
    gap: 28px; padding: 0 0 42px;
}
.garam-footer-brand { max-width: 350px; }
.garam-footer-brand img, .garam-footer-brand svg.garam-footer-logo { display: block; width: 180px; max-width: 100%; height: auto; }
.garam-footer-brand p { margin: 17px 0 0; max-width: 320px; color: #63707d; font-size: 14px; line-height: 1.65; }
.garam-footer-nav { display: flex; flex-wrap: wrap; gap: 14px 27px; justify-content: flex-end; padding: 12px 0 0; }
.garam-footer-nav a, .garam-footer-legal a { color: #1c2730 !important; font-size: 13px; font-weight: 650; text-decoration: none !important; }
.garam-footer-nav a:hover, .garam-footer-legal a:hover { color: var(--garam-layout-accent) !important; }
.garam-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; align-items: center; padding-top: 22px; border-top: 1px solid #e7e9ec; color: #727983; font-size: 13px; }
.garam-footer-legal { display: flex; flex-wrap: wrap; gap: 18px; }

/* Handheld menu: preserve the existing .hamburger -> .is-active X animation. */
html body.garam-shell-body .garam-site-header .hamburger { display: none !important; }
html body.garam-shell-body nav.garam-mobile-nav,
html body.garam-shell-body .garam-mobile-backdrop { display: none; }

@media (max-width: 1000px) and (min-width: 701px) {
    html body.garam-shell-body header.garam-site-header {
        width: calc(100% - 72px) !important;
        grid-template-columns: minmax(112px, 1fr) minmax(0,auto) minmax(90px,1fr);
        padding: 0 14px 0 18px; column-gap: 8px;
    }
    .garam-header-logo { width: 124px; }
    html body.garam-shell-body #menu.garam-header-links a { font-size: 11px; }
    /* Keep the center navigation readable on tablets.
       Support/Invite remain available in the mobile menu and footer. */
    html body.garam-shell-body #menu.garam-header-links a:nth-last-child(-n+2) { display: none; }
}
@media (max-width: 700px) {
    html { scroll-padding-top: 88px; }
    html body.garam-shell-body { background: var(--garam-theme-surface, #d2edfe) !important; }
    html body.garam-shell-body #container.garam-site-root { background: var(--garam-theme-surface, #d2edfe); }
    html body.garam-shell-body header.garam-site-header,
    html body.garam-shell-body header.garam-site-header.is-scrolling {
        position: fixed !important;
        top: 9px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 16px) !important;
        height: 64px;
        min-height: 0 !important;
        padding: 7px 9px 7px 12px;
        border: 1px solid rgba(220, 224, 239, .98);
        border-radius: 23px;
        background: #fff !important; /* Fully opaque so the dim layer never tints the header. */
        box-shadow: 0 7px 24px rgba(27,38,58,.15);
        grid-template-columns: 1fr auto;
        gap: 8px;
        backdrop-filter: blur(14px) !important;
    }
    .garam-header-logo { width: 124px; }
    html body.garam-shell-body header.garam-site-header nav#menu.garam-header-links { display: none !important; }
    .garam-header-actions { gap: 9px; }
    html body.garam-shell-body .garam-site-header .hamburger {
        display: inline-flex !important;
        justify-content: center; align-items: center;
        flex: 0 0 auto; width: 45px; height: 45px;
        min-width: 0; margin: 0; padding: 10px;
        position: relative; border: 1px solid #e6e8ef; border-radius: 13px;
        background: white !important;
        cursor: pointer; box-sizing: border-box;
    }
    /* Same .hamburger + .is-active class used in your old header.
       Draw the bars explicitly so they remain visible against white and
       still morph into an X, regardless of the old style.css colors. */
    html body.garam-shell-body .hamburger::before,
    html body.garam-shell-body .hamburger::after { content:none !important; display:none !important; }
    html body.garam-shell-body .hamburger .bar {
        position:relative !important; display:block !important;
        width:23px !important; height:2px !important;
        margin:0 !important; border-radius:2px;
        opacity:1 !important; background:#111217 !important;
        transform:none !important;
        transition:background .2s ease !important;
    }
    html body.garam-shell-body .hamburger .bar::before,
    html body.garam-shell-body .hamburger .bar::after {
        content:"" !important; display:block !important;
        position:absolute; left:0; top:0; width:23px; height:2px;
        border-radius:2px; background:#111217 !important;
        transition:transform .25s ease !important;
    }
    html body.garam-shell-body .hamburger .bar::before { transform:translateY(-7px); }
    html body.garam-shell-body .hamburger .bar::after { transform:translateY(7px); }
    html body.garam-shell-body .hamburger.is-active .bar { background:transparent !important; opacity:1 !important; }
    html body.garam-shell-body .hamburger.is-active .bar::before { transform:rotate(45deg) !important; }
    html body.garam-shell-body .hamburger.is-active .bar::after { transform:rotate(-45deg) !important; }
    html body.garam-shell-body .garam-site-header .hamburger:focus-visible {
        outline:3px solid var(--garam-layout-accent); outline-offset:2px;
    }
    html body.garam-shell-body a.garam-header-login {
        min-height: 38px; padding: 9px 13px !important;
        border-radius: 12px; font-size: 12px;
    }
    .garam-account-trigger img { width: 39px; height: 39px; }
    .garam-account-dropdown { right: -55px; top: calc(100% + 16px); }
    html body.garam-shell-body main.garam-site-frame {
        width: 100%;
        margin: 0;
        padding: 108px 0 63px;
        min-height: max(70vh, 500px);
        border-radius: 0;
        background-image: var(--garam-theme-gradient, linear-gradient(#087cce,#d2edfe)) !important;
        background-size: 100% 50vh;
        background-repeat: no-repeat;
    }
    html body.garam-shell-body main.garam-site-frame > #centertext { padding: 0 8px; }
    /* Keep the sliding drawer BELOW the mobile header (top 9px + 64px height + 9px gap). */
    /* The right drawer still occupies 80% of the screen width. */
    html body.garam-shell-body { --garam-mobile-drawer-top: 82px; }
    html body.garam-shell-body .garam-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0; /* Shade the entire viewport, including behind the floating header. */
        z-index: 10030; /* Below drawer (10040) and header (10050). Header stays undimmed. */
        background: rgb(10 10 10 / 40%) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .28s ease, visibility .28s ease;
    }
    html body.garam-shell-body .garam-mobile-backdrop.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    html body.garam-shell-body.garam-mobile-menu-open { overflow: hidden !important; }

    html body.garam-shell-body nav.garam-mobile-nav {
        display: flex !important;
        position: fixed;
        top: var(--garam-mobile-drawer-top);
        right: 0;
        bottom: 0;
        left: auto;
        width: 80vw;
        width: 80%;
        height: auto; /* Fill the area from below the header to the bottom of the viewport. */
        max-height: none;
        padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        margin: 0;
        z-index: 10040;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff !important;
        border: none;
        border-left: 1px solid #e4e9f0;
        border-radius: 24px 0 0 0;
        box-shadow: -10px 0 30px rgba(10,10,10,.13);
        transform: translateX(100%);
        visibility: hidden;
        opacity: 1;
        pointer-events: none;
        transition: transform .30s cubic-bezier(.2,.8,.2,1), visibility .30s ease;
        box-sizing: border-box;
    }
    html body.garam-shell-body nav.garam-mobile-nav.is-active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    .garam-mobile-nav a {
        display: block; padding: 13px 15px; border-radius: 12px;
        color: #1a1e28 !important; font: inherit; font-size: 14px;
        font-weight: 700; text-decoration: none !important;
    }
    .garam-mobile-nav a:hover,.garam-mobile-nav a:focus-visible {
        color: var(--garam-layout-accent) !important;
        background: var(--garam-c-e5f5ff,#e5f5ff);
    }
    html body.garam-shell-body footer#jufooter.garam-site-footer {
        margin: -20px 0 0;
        padding: 48px 20px 22px;
        border-radius: 28px 28px 0 0;
    }
    .garam-footer-top { flex-direction: column; gap: 22px; padding-bottom: 30px; }
    .garam-footer-nav { justify-content: flex-start; gap: 14px 20px; }
}
@media (max-width: 370px) {
    .garam-header-logo { width: 106px; }
    html body.garam-shell-body a.garam-header-login { padding: 9px 11px !important; }
    .garam-header-actions { gap: 6px; }
    .garam-account-dropdown { right: -56px; }
}
@media (prefers-reduced-motion: reduce) {
    .garam-account-trigger, .garam-header-links a, .garam-account-menu-item,
    .garam-mobile-backdrop, html body.garam-shell-body nav.garam-mobile-nav {
        transition: none !important;
    }
}


/* Inventory modals are portaled to <body> by garamwebtemplate.js.
   They must cover the shared header (z-index:10050) and full-width footer. */
html body.garam-shell-body #garam3DModal.garam-modal {
    position: fixed !important;
    inset: 0;
    z-index: 200000 !important;
    background: rgb(10 10 10 / 40%) !important;
}
html body.garam-shell-body #garamOwnerModal.garam-owner-modal {
    position: fixed !important;
    inset: 0;
    z-index: 200001 !important;
}

/* Inline SVG paths inherit the current Garam theme in both header and footer.
   The original logo's dark paths (#060609) are intentionally untouched. */
.garam-header-brand svg.garam-header-logo,
.garam-footer-brand svg.garam-footer-logo {
    overflow: visible;
    flex-shrink: 0;
}
