/* Shared header controls keep the same outer height at every viewport size. */
.site-header { --header-control-gap:8px; }
.site-header:has(.social-header-tools) { column-gap:var(--header-control-gap); }
.site-header .social-header-tools { align-items:center; gap:var(--header-control-gap); }
.site-header .social-header-link, .site-header .header-account { align-items:center; justify-content:center; box-sizing:border-box; height:40px; min-height:40px; margin:0; border:1px solid #b6bea7; background:#edf0e2; }
.site-header .social-header-link { width:40px; min-width:40px; flex:0 0 40px; padding:7px; }
.site-header .header-account { flex-shrink:0; gap:8px; padding:7px 10px; }
.site-header .social-header-link svg { display:block; width:20px; height:20px; flex:none; }
.site-header .header-account > .player-pixel-avatar { width:24px; height:24px; flex:0 0 24px; }
.site-header .social-header-tools .social-header-link:hover, .site-header .social-header-tools .social-bell[open] .social-header-link, .site-header .header-account:hover { background:#e7daf6; border-color:#8262ac; }
.site-header .header-donate { box-sizing:border-box; height:40px; min-height:40px; box-shadow:none; }

/* Progressive enhancement: without JavaScript, the ordinary header links remain. */
.mobile-menu-toggle[hidden] { display:none; }
.mobile-menu-toggle, .mobile-menu-close { display:grid; place-items:center; width:44px; height:44px; flex:0 0 44px; padding:10px; border:1px solid #9b9f8c; background:#edf0e2; color:#343043; cursor:pointer; }
.mobile-menu-toggle svg, .mobile-menu-close svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; shape-rendering:crispEdges; }
.mobile-menu-toggle:hover, .mobile-menu-close:hover { background:#e7daf6; border-color:#8262ac; }
.mobile-menu-toggle:focus-visible, .mobile-navigation :focus-visible { outline:3px solid #9c7ac6; outline-offset:3px; }
.site-menu-open, .site-menu-open body { overflow:hidden; }
.mobile-navigation { position:fixed; inset:0 0 0 auto; width:min(340px,calc(100% - 32px)); max-width:none; height:100%; height:100dvh; max-height:none; box-sizing:border-box; margin:0; padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) 20px; border:0; border-left:2px solid #362a48; background:#f6f3e9; color:#30273d; box-shadow:-6px 0 0 #38274920; overflow-y:auto; overscroll-behavior:contain; }
.mobile-navigation:not([open]) { display:none; }
.mobile-navigation[open] { animation:site-menu-in .24s ease-out; }
.mobile-navigation::backdrop { background:#21132e80; animation:site-menu-backdrop .24s ease-out; }
.mobile-navigation.is-closing { animation:site-menu-out .18s ease-in forwards; }
.mobile-navigation-heading { position:sticky; top:0; z-index:1; background:#f6f3e9; display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:18px; margin-bottom:12px; border-bottom:1px solid #c6b8d3; }
.mobile-navigation-heading h2 { margin:0; font-size:22px; }
.mobile-navigation .main-nav, .mobile-navigation .main-nav:has(.content-nav-item) { display:flex; flex-direction:column; align-items:stretch; gap:6px; position:static; width:100%; margin:0; }
.mobile-navigation .main-nav a, .mobile-navigation .main-nav summary { display:flex; align-items:center; justify-content:flex-start; gap:10px; min-height:48px; box-sizing:border-box; padding:12px; font-size:14px; text-align:left; overflow-wrap:anywhere; color:#3f304b; }
.mobile-navigation .main-nav > a, .mobile-navigation .content-nav-item { flex:none; width:100%; }
.mobile-navigation .content-nav-item, .mobile-navigation .content-nav-item details { display:block; position:static; }
.mobile-navigation .content-nav-item summary { cursor:pointer; }
.mobile-navigation .content-nav-item summary > span { margin-left:auto; }
.mobile-navigation .main-nav .content-nav-children { position:static; display:grid; width:auto; min-width:0; max-width:none; padding:0 0 0 12px; margin:0 0 8px 12px; border:0; border-left:2px solid #d5c6e7; box-shadow:none; background:transparent; }
.mobile-navigation .main-nav details:not([open]) > .content-nav-children { display:none; }
.mobile-navigation .main-nav a:hover, .mobile-navigation .main-nav summary:hover { background:#e9e0f2; }
.mobile-navigation .header-donate { display:flex; justify-content:center; min-height:44px; width:100%; box-sizing:border-box; margin:22px 0 4px; }
.mobile-navigation .header-donate > span { display:inline; }
@keyframes site-menu-in { from { transform:translateX(100%); } to { transform:translateX(0); } }
@keyframes site-menu-out { to { transform:translateX(100%); opacity:0; } }
@keyframes site-menu-backdrop { from { opacity:0; } to { opacity:1; } }
@media (max-width:900px) {
    .site-header.menu-ready, .play-page .site-header.menu-ready { --header-control-gap:6px; flex-wrap:nowrap; gap:6px; }
    .site-header.menu-ready .brand { flex:1 1 200px; min-width:0; max-width:none; }
    .site-header.menu-ready .brand-logo { display:block; width:100%; max-width:232px; }
    .site-header.menu-ready .account-name { display:none; }
    .site-header.menu-ready .mobile-menu-toggle { order:3; }
    .site-header.menu-ready .social-header-tools { align-items:center; gap:6px; }
    .site-header.menu-ready .social-header-link,
    .site-header.menu-ready .header-account,
    .site-header.menu-ready .mobile-menu-toggle { align-items:center; justify-content:center; box-sizing:border-box; width:40px; height:40px; min-width:40px; min-height:40px; flex:0 0 40px; margin:0; padding:7px; border:1px solid #b6bea7; background:#edf0e2; }
    .site-header.menu-ready .social-header-link svg,
    .site-header.menu-ready .mobile-menu-toggle svg { display:block; width:20px; height:20px; flex:none; }
    .site-header.menu-ready .header-account > .player-pixel-avatar { width:24px; height:24px; flex:0 0 24px; }
    .site-header.menu-ready .header-account:hover,
    .site-header.menu-ready .mobile-menu-toggle:hover { background:#e7daf6; border-color:#8262ac; }
}
@media (prefers-reduced-motion:reduce) {
    .mobile-navigation[open], .mobile-navigation.is-closing, .mobile-navigation::backdrop { animation:none; }
}
