/* Shared top navigation of the Server 1 site (home page, Market, Download, player profile): the same eight
   entries everywhere. Wide screens keep the one-line header of styles.css; below 1120px the entries move to
   their own line, which scrolls sideways on a phone. Loaded after styles.css. */
.topbar nav a{white-space:nowrap}
@media(max-width:1400px){.topbar,.topbar nav{gap:18px}.auth{gap:14px}}

/* One page width for the whole site: the header, the content of every page and the footer share the same left
   and right edge. Before, each page had its own (home and Download 1240px, Market 1440, player profile 1180,
   My account 980, admin 1400, and the header ran edge to edge). 1320px keeps the Market's three columns
   without a sideways scroll in its table. Change the two numbers here to resize the whole site. */
:root{--site-width:1320px;--site-pad:30px;scrollbar-gutter:stable}   /* stable: a short page does not sit 7px to the right of a long one */
@media(max-width:760px){:root{--site-pad:20px}}
.content,.hero-inner,body>footer,.dl-wrap,.mk-shell,.profile-shell,.ma-shell,.owner-shell{max-width:var(--site-width);margin-left:auto;margin-right:auto;padding-left:var(--site-pad);padding-right:var(--site-pad)}
.topbar{padding-left:max(var(--site-pad),calc((100% - var(--site-width))/2 + var(--site-pad)));padding-right:max(var(--site-pad),calc((100% - var(--site-width))/2 + var(--site-pad)))}
/* The same header on every page: logo, then the navigation at a fixed distance, the account area at the right.
   Before, the navigation sat in the middle of the free space, so it stood in a different place on each page
   and moved when the account area changed width (Sign in / name + My account / name + Sign out). */
.topbar{justify-content:flex-start}
.topbar nav{margin-left:20px}
.topbar .auth{margin-left:auto}
/* Download page on a phone: a panel may be narrower than the table inside it (the table scrolls in its own
   box). Before, the 520px table pushed its panel, and the whole page, to 594px on a 375px screen. */
.dl-panel{min-width:0}
/* My account: the sign-in and register forms keep a readable width inside the wider page. */
.ma-page:not(.signed-in) .ma-view{max-width:920px}
/* Admin page under the sticky site header: its tab bar and sections stop below the header when scrolled to. */
.owner-shell section,.owner-shell .admin-tabs{scroll-margin-top:114px}

/* site-header.js: player search (magnifier + small box under the header) and the signed-in state. */
.topbar .auth>.site-search-toggle{display:grid}   /* styles.css hides a first button in .auth on narrow screens */
.site-search-toggle{width:38px;height:38px;flex-shrink:0;display:grid;place-items:center;border:1px solid var(--line);font-size:20px;line-height:1;color:var(--gold)}
.site-search-toggle:hover,.site-search-toggle[aria-expanded="true"]{border-color:var(--gold);background:#cd9f5a15}
.site-search{position:absolute;top:100%;right:max(var(--site-pad),calc((100% - var(--site-width))/2 + var(--site-pad)));z-index:11;width:min(320px,calc(100vw - 32px));display:grid;grid-template-columns:1fr auto;gap:10px;padding:16px;background:var(--panel);border:1px solid var(--gold-dim);border-top:2px solid var(--gold);box-shadow:0 20px 50px #000a}
.site-search[hidden]{display:none}
.site-search strong{grid-column:1/-1;font-size:10px;letter-spacing:1.8px;color:var(--gold)}
.site-search input{min-width:0;padding:10px 12px;border:1px solid var(--line);background:var(--bg-deep);color:var(--text);font:13px Manrope,Arial,sans-serif}
.site-search input:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.site-search .gold{padding:10px 14px;font-size:12px}
.site-search p{grid-column:1/-1;font-size:11px;line-height:1.5}
/* The signed-in name looks the same on every page (.ma-user is the account page's own element). */
.site-user,.ma-user{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2;max-width:160px}
.site-user small,.ma-user small{font-size:9px;font-weight:400;letter-spacing:1.6px;color:var(--jade)}
.site-user strong,.ma-user strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 15px Manrope,Arial,sans-serif;color:var(--gold-bright)}
.ma-user[hidden]{display:none}
@media(max-width:420px){.ma-user{display:none}}
.topbar .ma-auth{gap:23px}
@media(max-width:1400px){.topbar .ma-auth{gap:14px}}

/* Phones: the header stays two lines. The magnifier does not fit beside the logo and the account links there
   (the Ranking tab has its own "Open a character profile" box); a signed-in visitor sees the name only. */
@media(max-width:480px){.topbar .auth>.site-search-toggle{display:none}}
@media(max-width:560px){.topbar .auth .site-user+.outline{display:none}.site-user{max-width:130px}}

@media(max-width:1340px){
  .topbar{height:auto;min-height:80px;flex-wrap:wrap;padding-top:10px;row-gap:0}
  .topbar nav{order:3;width:100%;margin-left:0;justify-content:flex-start;gap:24px;overflow-x:auto;scrollbar-width:none;padding-right:30px;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 30px),transparent)}
  .topbar nav::-webkit-scrollbar{display:none}
  .topbar nav a{padding:12px 0;flex-shrink:0}
}
@media(max-width:760px){.topbar{padding-top:18px}.topbar nav{gap:20px}}

/* Pages that had no site header before (Market, player profile): their sticky side panels sit under it. */
.mk-filters,.mk-side{top:104px}
@media(max-width:1340px){.mk-filters{top:140px}}
.site-foot{padding-top:26px;padding-bottom:26px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px 25px;border-top:1px solid var(--line-soft)}
.site-foot p,.site-foot a{font-size:11px;color:var(--muted)}
.site-foot a:hover{color:var(--gold-bright)}
.site-foot>div{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center}
