.mobile-header-toggle,.score-details-mobile{display:none}
@media(max-width:800px){
 /* One compact header row, with existing controls in an expandable menu. */
 html .site-header,html[data-social-layout=game] .site-header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:calc(10px + env(safe-area-inset-top)) 10px 10px;height:auto;min-height:0}
 html .site-header .header-brand,html[data-social-layout=game] .site-header .header-brand{display:flex;width:auto;min-width:0;flex:1;gap:8px;flex-wrap:nowrap;justify-content:flex-start}
 .site-header .brand{font-size:18px;gap:6px}.site-header .brand-sub{display:none}
 html .site-header .download-client,html[data-social-layout=game] .site-header .download-client{font-size:11px;white-space:normal;min-width:0;max-width:125px;padding:6px 8px;border-radius:6px;box-shadow:none}
 html .site-header .mobile-header-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:8px 10px;flex:none}
 html .site-header .header-meta,html[data-social-layout=game] .site-header .header-meta{display:none;width:100%;min-width:0;padding:10px 0 0;border-top:1px solid var(--line,#39434f);gap:10px;flex-wrap:wrap;align-items:center;justify-content:flex-start}
 html .site-header.mobile-menu-open .header-meta,html[data-social-layout=game] .site-header.mobile-menu-open .header-meta{display:flex}
 html .header-meta #game-layout-controls{display:flex;flex-wrap:wrap;gap:8px;width:100%;min-width:0;flex-shrink:1}
 html .header-meta .language-picker{display:flex;min-width:0;max-width:100%;flex:1 1 150px}
 html .header-meta .language-picker select{width:100%;min-width:0}
 html .site-header .header-meta .connection{font-size:12px!important;width:auto!important;height:auto!important;display:inline-flex!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;margin-left:0;padding:6px 8px}
 .header-meta .web-label{display:none}
 /* Link sharing belongs in the score sheet, not beside every mobile name. */
 .score-row .score-row-share{display:none}
 .score-value-desktop{display:none}.score-details-mobile{display:inline-flex!important;font:inherit!important;color:inherit!important;padding:3px 0!important;text-decoration:underline;text-underline-offset:3px;justify-content:flex-end;width:100%}
 /* Traffic entries are labelled cards instead of seven squeezed columns. */
 .ranking-table-wrap:has(.traffic-table){margin:0;padding:0;overflow:visible}
 .traffic-table,.traffic-table>tbody,.traffic-actions,.traffic-actions>tbody{display:block;width:100%;min-width:0;table-layout:auto}
 .traffic-table>thead,.traffic-actions>thead{display:none}
 .traffic-table .traffic-row,.traffic-actions tbody>tr{display:grid;grid-template-columns:minmax(0,1fr);padding:10px;margin:10px 0;border:1px solid var(--line,#39434f);border-radius:10px;background:var(--card,#191c21)}
 .traffic-table .traffic-row>td,.traffic-actions tbody>tr>td{display:block;width:auto!important;max-width:none!important;padding:7px 0;border:0;min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:left;font-size:12px}
 .traffic-table td[data-label]::before,.traffic-actions td[data-label]::before{content:attr(data-label);display:block;margin-bottom:3px;font:12px/1.5 sans-serif;color:var(--muted,#9aabb9)}
 .traffic-table td .link{white-space:normal;overflow-wrap:anywhere;text-align:left;max-width:100%;min-width:0}
 .traffic-table .traffic-log{display:block}.traffic-table .traffic-log>td{display:block;width:auto!important;padding:0 0 10px 8px!important;border:0}
 .traffic-log-body{min-width:0;padding-left:8px}.traffic-actions tbody>tr{padding:8px;margin-top:0}.traffic-actions tbody>tr>td{grid-template-columns:65px minmax(0,1fr)}
 .traffic-graph{height:auto;max-height:160px;aspect-ratio:750/180}
}
/* Phone shell: content first. Bottom tabs, one row of sub-tabs, everything else in the More sheet. */
.mobile-filter-toggle,#mobile-tabs,#mobile-more,.mobile-top,.mobile-strip-row{display:none}
@media(max-width:800px){
 html.mobile-browse .mobile-filter-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:42px;padding:8px 12px;margin:0;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:10px;color:var(--text)}
 html.mobile-browse .mobile-filter-toggle>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html.mobile-filters-open .mobile-filter-toggle>span:last-child{transform:rotate(180deg)}
 html.mobile-browse:not(.mobile-filters-open) .score-controls>.score-approved,html.mobile-browse:not(.mobile-filters-open) .score-controls>.score-controls-row{display:none}
 html.mobile-browse:not(.mobile-filters-open) .mobile-filter-toggle+.ranking-toolbar{display:none}
 html.mobile-browse .mobile-filter-toggle+.ranking-toolbar{margin-top:8px}
 html.mobile-browse .score-controls{padding:0;border:0;background:none;gap:8px}
 html.mobile-browse .score-control-boards>.score-control-label{display:none}
 html.mobile-browse .score-control-boards .score-boards{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:6px;border:0;background:none}
 html.mobile-browse .score-control-boards .score-boards::-webkit-scrollbar{display:none}
 html.mobile-browse .score-control-boards .score-boards button{flex:none;white-space:nowrap;min-height:36px;padding:7px 12px;border:1px solid var(--line);border-radius:999px}

 html.mobile-shell .sidebar,html.mobile-shell .game-self-area,html.mobile-shell .main-window>.window-title,html.mobile-shell .mobile-header-toggle,html.mobile-shell .site-header .brand>span:last-child,html.mobile-shell .tabs:has(>[data-kind=boards]){display:none!important}
 html.mobile-shell .site-header,html[data-social-layout=game].mobile-shell .site-header{position:sticky;top:0;z-index:40;gap:0 8px;padding:calc(6px + env(safe-area-inset-top)) 12px 0;background:color-mix(in srgb,var(--bg) 94%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
 html.mobile-shell .site-header .header-brand,html[data-social-layout=game].mobile-shell .site-header .header-brand{flex:none}
 html.mobile-shell .site-header .brand-mark{width:30px;height:30px;font-size:22px}
 .mobile-top{display:flex;align-items:center;gap:8px;flex:1;min-width:0;min-height:46px}
 .mobile-page-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;font-weight:600}
 .mobile-online{flex:none;white-space:nowrap}
 html .mobile-bell{position:relative;display:grid;place-items:center;flex:none;width:42px;height:42px;padding:0;background:none!important;border:0!important;border-radius:50%}
 .mobile-bell .bubble{position:absolute;top:0;right:0;margin:0}
 #mobile-shell .game-glyph,.mobile-top .game-glyph{font-family:VlitherGlyph;font-style:normal;font-size:20px;line-height:1}
 .mobile-strip-row{position:relative;display:flex;align-items:flex-start;gap:4px;flex:0 0 100%;width:0;min-width:100%}
 html .mobile-strip-more{display:grid;place-items:center;flex:none;width:36px;height:36px;margin-top:2px;padding:0;font-size:15px;color:var(--text);background:var(--card);border:1px solid var(--line);border-radius:50%}
 .mobile-strip-more[hidden]{display:none!important}
 .mobile-strip-more[aria-expanded=true] span{display:block;transform:rotate(180deg)}
 .mobile-strip-all{position:absolute;top:100%;left:0;right:0;z-index:41;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 28px #000a}
 .mobile-strip-all[hidden]{display:none}
 html .mobile-strip-all button{display:flex;align-items:center;gap:7px;min-width:0;min-height:42px;padding:8px 10px;text-align:left;font-size:13px;color:var(--muted);background:var(--card);border:1px solid var(--line);border-radius:10px}
 html .mobile-strip-all button.active{color:var(--text);border-color:var(--accent)}
 .mobile-strip-all button>span:not([data-nav-badges]){flex:1;min-width:0;overflow-wrap:anywhere}
 .mobile-strip-all .bubble{position:static;margin:0}
 html[data-social-layout=game] .mobile-strip-row .tab-dot{background:var(--explore-color,#edc45c);box-shadow:0 0 8px color-mix(in srgb,var(--explore-color,#edc45c),transparent 45%)}
 html.mobile-shell .site-header>.notice-board-button{flex:none;display:grid;place-items:center;width:42px;height:42px;padding:0;font-size:19px;line-height:1;background:none!important;border:0!important}
 html.mobile-shell .site-header>.notice-board-button [data-text]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 html.mobile-shell .site-header>.notice-board-button[hidden]{display:none}
 html.mobile-shell .site-header>.notice-board-button .bubble{top:0;right:0;font-size:10px}
 .mobile-strip{display:flex;flex:1;gap:6px;min-width:0;padding:2px 0 8px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent)}
 .mobile-strip::-webkit-scrollbar{display:none}
 html .mobile-strip button{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:36px;padding:6px 13px;white-space:nowrap;font-size:13px;color:var(--muted);background:none;border:1px solid transparent;border-radius:999px}
 html .mobile-strip button.active{color:var(--text);background:color-mix(in srgb,var(--accent) 20%,transparent);border-color:color-mix(in srgb,var(--accent) 65%,transparent)}
 .mobile-strip .bubble{margin:0}

 html.mobile-shell body{padding-bottom:calc(60px + env(safe-area-inset-bottom))}
 html.mobile-shell .workspace,html.mobile-shell .workspace.with-detail,html[data-social-layout=game].mobile-shell .workspace{display:block;padding:10px 10px 16px}
 html.mobile-shell .main-window{min-width:0;border-radius:12px}
 html.mobile-shell #main-content{padding:12px}
 html.mobile-shell .site-footer{padding-bottom:10px}

 #mobile-tabs{position:fixed;left:0;right:0;bottom:0;z-index:45;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding-bottom:env(safe-area-inset-bottom);background:color-mix(in srgb,var(--bg) 96%,#000);border-top:1px solid var(--line)}
 html #mobile-tabs>button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;height:58px;padding:4px 2px;font-size:11px;color:var(--muted);background:none;border:0;border-radius:0}
 html #mobile-tabs>button>span:not(.game-glyph):not([data-nav-badges]){max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html #mobile-tabs>button.active{color:var(--accent)}
 html #mobile-tabs>button.active:before{content:"";position:absolute;top:-1px;left:22%;right:22%;height:2px;border-radius:2px;background:var(--accent)}
 #mobile-tabs [data-nav-badges]{position:absolute;top:3px;left:calc(50% + 6px);display:flex;gap:2px}
 #mobile-tabs [data-mobile-more] [data-nav-badges]{left:auto;right:3px}
 #mobile-tabs .bubble,#mobile-tabs .setting-new{position:static;margin:0}
 /* Signed-out landing: the sign-in form within the first screen. */
 html.mobile-browse:not(.mobile-shell) .welcome-intro h1,html.mobile-browse:not(.mobile-shell) .auth-layout h1{font-size:23px;line-height:1.2;letter-spacing:-.3px}

 #mobile-more{position:fixed;inset:0;z-index:46;display:flex;align-items:flex-end;background:#0009}
 #mobile-more[hidden]{display:none}
 html.mobile-shell body:has(#mobile-more:not([hidden])){overflow:hidden}
 .mobile-more-panel{display:flex;flex-direction:column;gap:12px;width:100%;max-height:calc(100dvh - 40px);padding:12px 14px calc(14px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;background:var(--panel);border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;animation:sheet-up .18s ease-out}
 .mobile-more-head{display:flex;align-items:center;justify-content:space-between;font-size:17px}
 html .mobile-more-head button{width:40px;height:40px;padding:0;font-size:22px;background:none;border:0}
 html .mobile-more-panel>.my-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:10px}
 .mobile-more-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 html .mobile-more-list button{display:flex;align-items:center;gap:9px;min-width:0;min-height:48px;padding:8px 10px;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:10px}
 html .mobile-more-list button.active{border-color:var(--accent)}
 .mobile-more-list button>span:nth-of-type(2){flex:1;min-width:0;overflow-wrap:anywhere}
 .mobile-more-list [data-nav-badges]{display:flex;align-items:center;gap:4px;margin-left:auto}
 .mobile-more-list .bubble,.mobile-more-list .setting-new{position:static;margin:0}
 #mobile-more-controls{display:flex;flex-direction:column;gap:10px;padding-top:12px;border-top:1px solid var(--line)}
 html #mobile-more-controls .header-meta,html[data-social-layout=game] #mobile-more-controls .header-meta{display:flex;width:100%;padding:0;border:0}
 html #mobile-more-controls .download-client,html[data-social-layout=game] #mobile-more-controls .download-client{width:100%;max-width:none;min-height:44px;justify-content:center;font-size:14px;border-radius:10px}
 .mobile-signout{align-self:center;min-height:42px;color:var(--muted)!important;background:none!important;border:0!important}

 html.mobile-shell .toasts{bottom:calc(68px + env(safe-area-inset-bottom))}
 html.mobile-shell .cookie-banner{bottom:calc(64px + env(safe-area-inset-bottom))}
 /* Profiles and other detail windows open as a full page over the tabs, with their own close button. */
 html.mobile-shell .workspace .detail-window:not(.clan-detail-overlay),html[data-social-layout=game].mobile-shell .workspace .detail-window:not(.clan-detail-overlay){position:fixed;inset:0;z-index:47;width:auto;max-width:none;height:auto;max-height:none;margin:0;padding-top:env(safe-area-inset-top);overflow-y:auto;overscroll-behavior:contain;border-radius:0;background:var(--bg);transform:none}
 html.mobile-shell .clan-detail-overlay{z-index:47}
 html.mobile-shell #modal-root .modal-overlay{z-index:48}
}
