/* Shared responsive safeguards for every public and staff page. */
html{max-width:100%;overflow-x:clip}
body{min-width:320px;max-width:100%;overflow-x:clip}
main,section,article,aside,header,footer,form,fieldset,dialog{min-width:0}
img,video,canvas,svg{max-width:100%}
iframe{max-width:100%}
input,select,textarea,button{max-width:100%;font:inherit}
input,select,textarea{min-width:0}
button,a,summary,[role="button"]{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible,[role="button"]:focus-visible{outline:2px solid #e8e9ec;outline-offset:3px}
table{max-width:100%}
pre,code{overflow-wrap:anywhere}
[class*="grid"],[class*="layout"],[class*="row"],[class*="actions"]{min-width:0}

/* A compact, keyboard accessible navigation drawer replaces cramped mobile nav rows. */
.nav-mobile-toggle{display:none}
@media(max-width:820px){
  .site-header{z-index:100;min-height:0;padding:8px 12px;background:rgba(9,10,11,.96)}
  .site-header>.nav{position:relative;display:grid;width:100%;max-width:none;grid-template-columns:minmax(0,1fr) auto 44px;grid-template-areas:"brand status toggle" "auth auth auth";align-items:center;gap:6px 10px;overflow:visible}
  .site-header .brand{grid-area:brand;min-width:0;width:max-content;max-width:100%;}
  .site-header .brand-logo{width:112px;height:40px;object-fit:contain;object-position:left center}
  .nav-mobile-toggle{grid-area:toggle;display:grid;width:44px;height:44px;align-content:center;justify-items:center;gap:5px;padding:0;border:1px solid rgba(255,255,255,.13);border-radius:11px;background:#141517;color:#f5f5f5;cursor:pointer}
  .nav-mobile-toggle span{display:block;width:18px;height:2px;border-radius:2px;background:currentColor;transition:transform .18s,opacity .18s}
  .nav-mobile-toggle[aria-expanded="true"] span:first-child{transform:translateY(7px) rotate(45deg)}
  .nav-mobile-toggle[aria-expanded="true"] span:nth-child(2){opacity:0}
  .nav-mobile-toggle[aria-expanded="true"] span:last-child{transform:translateY(-7px) rotate(-45deg)}
  .site-header .auth-nav{grid-area:auth;display:flex;width:100%;min-width:0;justify-content:flex-end;gap:8px;margin:0}
  .site-header .auth-nav>a:not([hidden]){min-height:40px;align-items:center;justify-content:center;padding-inline:13px}
  .site-header .account-menu{max-width:min(100%,360px)}
  .site-header .nav-links{position:absolute;z-index:1001;top:calc(100% + 8px);right:0;left:0;display:none;width:auto;min-width:0;max-width:none;max-height:min(72svh,560px);overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:10px;border:1px solid rgba(255,255,255,.13);border-radius:14px;background:#101112;box-shadow:0 18px 50px #000b;scrollbar-width:thin}
  .site-header .nav-links.is-mobile-open{display:grid!important}
  .site-header .nav-links>li{min-width:0;}
  .site-header .nav-links>li>a,.site-header .nav-links .nav-dropdown-trigger{display:flex;width:100%;min-height:44px;align-items:center;justify-content:flex-start;gap:8px;padding:10px 12px;border-radius:9px;font-size:12px;text-align:left;white-space:normal}
  .site-header .nav-links .nav-dropdown{min-width:0}
  .site-header .nav-links .nav-dropdown-details{width:100%}
  .site-header .nav-links .nav-dropdown-menu{position:static;display:grid;width:100%;min-width:0;max-width:none;gap:2px;padding:4px 0 4px 8px;transform:none;border:0;border-left:1px solid rgba(255,255,255,.14);border-radius:0;background:transparent;box-shadow:none}
  .site-header .nav-links .nav-dropdown-menu a{min-height:42px;padding:9px 10px;font-size:12px}
  .site-header .nav-links .nav-dropdown-trigger{padding-right:30px;padding-left:12px}
  .site-header .nav-dropdown-trigger>span{right:12px}
  .site-header .account-menu-dropdown{position:absolute;top:calc(100% + 7px);right:0;left:auto;max-width:calc(100vw - 24px)}
  .site-header .nav-dropdown-menu{max-width:calc(100vw - 24px)}
  .site-header .server-status{grid-area:status;display:flex;min-width:0;max-width:150px;align-self:center;margin:0;padding:5px 8px}
  .nav.has-mobile-menu-open{z-index:1002}
  .clans-page{padding-top:106px}
  .clan-war-page,.clan-admin-page{padding-top:112px}
}

@media(max-width:600px){
  .site-header{padding:7px 10px}
  .site-header .brand-logo{width:100px;height:36px}
  .nav-mobile-toggle{width:42px;height:42px}
  .site-header .auth-nav{justify-content:stretch;gap:7px}
  .site-header .auth-nav>.login-link,.site-header .auth-nav>.register-cta{flex:1 1 0;min-width:0;}
  .site-header .auth-nav>.account-profile{flex:0 1 auto;margin-left:auto}
  .site-header .nav-links{grid-template-columns:1fr;max-height:calc(100svh - 116px)}
  .site-header .server-status{max-width:128px;gap:6px;padding:5px 7px}
  .site-header .server-status-address{font-size:8px}
  .site-header .server-status-players{font-size:8px}
  .site-header .nav-links>li>a,.site-header .nav-links .nav-dropdown-trigger{min-height:46px;font-size:13px}
  .site-header .nav-links .nav-dropdown-menu a{min-height:44px}
  .clans-page{padding-top:100px}
  .page-main,.staff-page,.support-page,.application-public-page{width:100%;padding-right:16px;padding-left:16px}
  .section-inner,.page-inner{width:100%;}
  .section-heading,.clan-war-page-heading,.clan-admin-section-heading,.dashboard-users-heading,.support-heading,.application-form-editor>header,.application-review-card>header{min-width:0;flex-wrap:wrap}
  .profile-tabs,.clan-notice-categories,.clan-admin-tabs,.dashboard-users-tabs{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
  .admin-management-grid,.admin-shopier-grid,.application-filter-row,.application-question-row{grid-template-columns:minmax(0,1fr)}
  .application-question-row>textarea{grid-column:1}
  .application-review-card{padding:16px}
  .application-review-card>footer{flex-wrap:wrap}
  .footer-inner,.footer-note,.footer-social{max-width:100%;flex-wrap:wrap}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{min-height:42px}
  .button,.admin-action-button,.support-button,.clan-small-button,.clan-admin-primary,.clan-staff-primary,.dashboard-icon-button,.clan-notice-category,.profile-tabs a{min-height:42px}
  dialog{max-width:calc(100vw - 20px);max-height:calc(100svh - 20px);overflow:auto}
  table{display:block;width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
  /* Account, public profile, auth and payment pages. */
  .register-layout,.profile-layout,.support-layout,.storefront-checkout-layout,.apply-box{grid-template-columns:minmax(0,1fr)}
  .register-layout,.profile-layout,.support-layout,.storefront-checkout-layout{gap:14px}
  .register-card,.auth-card,.support-card,.support-ticket-sidebar,.storefront-checkout-product,.storefront-order-summary{min-width:0;max-width:100%;}
  .account-summary,.profile-game-grid,.credit-product-grid,.credit-store-benefits,.storefront-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .profile-game-card-featured{grid-column:1/-1;width:100%;margin:0}
  .profile-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .checkout-layout,.checkout-product,.storefront-checkout-product-info{grid-template-columns:minmax(0,1fr)}
  .storefront-checkout-product-info>img{width:100%;max-height:240px;object-fit:contain}
  /* Clan public, management and notification views. */
  .clan-community-grid,.clan-admin-overview,.clan-admin-leave-request,.clan-admin-member,.clan-admin-form,.clan-admin-role,.clan-permission-grid,.clan-alliance-duration-controls{grid-template-columns:minmax(0,1fr)}
  .clan-member-row,.clan-member-actions,.clan-admin-member-actions,.clan-notice-category,.clan-staff-section-heading{min-width:0;flex-wrap:wrap}
  .clan-member-actions>* ,.clan-admin-member-actions>*{max-width:100%;}
  .clan-public-chat-composer{grid-template-columns:minmax(0,1fr) auto}
  .clan-staff-body{grid-template-columns:minmax(0,1fr)}
  .clan-staff-sidebar{position:sticky;top:0;z-index:35;display:flex;width:100%;height:auto;flex-direction:row;align-items:center;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;padding:7px;border-right:0;border-bottom:1px solid rgba(255,255,255,.1);scrollbar-width:thin}
  .clan-staff-brand,.clan-staff-nav-label,.clan-staff-sidebar-back,.clan-staff-sidebar-foot{display:none}
  .clan-staff-nav-item{flex:0 0 auto;justify-content:flex-start;width:auto;min-width:max-content;min-height:44px;margin:0;padding:0 11px;font-size:11px}
  .clan-staff-nav-item>span{font-size:14px}
  .clan-staff-nav-item i{position:static;transform:none}
  .clan-staff-main{min-width:0;padding:14px 12px 34px}
  .clan-staff-topbar,.clan-war-page-heading,.clan-war-notice-matchup,.clan-staff-war-matchup{min-width:0;flex-wrap:wrap}
  /* Staff admin, applications and configurable forms. */
  .dashboard-users-heading,.dashboard-role-editor>header,.dashboard-profile-section-heading,.dashboard-settings-heading,.dashboard-store-product-heading{align-items:flex-start;flex-wrap:wrap}
  .dashboard-user-profile-layout,.dashboard-profile-facts,.dashboard-settings-row,.dashboard-store-category-fields,.dashboard-store-product-main-fields,.dashboard-store-product-fields,.dashboard-store-variable-row,.dashboard-store-command-row,.dashboard-coupon-limit-row,.dashboard-coupon-input-action,.dashboard-dialog-fields,.dashboard-profile-image-role-list,.application-question-row,.application-filter-row,.application-form-editor form{grid-template-columns:minmax(0,1fr)}
  .dashboard-store-command-row>*,.dashboard-store-variable-row>*,.dashboard-role-fields>label,.dashboard-dialog-fields>*{min-width:0;max-width:100%}
  .dashboard-users-heading>*,.dashboard-users-pagination>*,.dashboard-topline>*{max-width:100%;}
  .dashboard-users-pagination{align-items:flex-start;flex-wrap:wrap}
  .dashboard-role-permissions>div,.dashboard-role-permission-items{grid-template-columns:repeat(2,minmax(0,1fr))}
  .application-question-row>textarea{grid-column:1}
  .application-form-editor,.application-review-card,.application-questions-box{padding:14px}
  .application-review-card>footer,.application-row-actions{flex-wrap:wrap}
  /* Homepage, store and footer cards. */
  .community-hub-inner,.community-server-list,.clan-war-results-list{grid-template-columns:minmax(0,1fr)}
  .clan-war-result-matchup{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:6px}
  .clan-war-result-team{min-width:0;overflow-wrap:anywhere}
  .storefront-hero,.credit-store-hero{grid-template-columns:minmax(0,1fr)}
  .storefront-listing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:420px){
  .site-header .nav{gap:5px 8px}
  .site-header .nav-links{padding:8px}
  .site-header .auth-nav>.login-link,.site-header .auth-nav>.register-cta{padding-inline:8px;font-size:11px}
  .site-header .account-menu .account-profile{max-width:calc(100vw - 105px)}
  .site-header .account-menu .profile-name{max-width:84px}
  .site-header .server-status{max-width:106px;gap:5px;padding:4px 6px}
  .site-header .server-status-address{font-size:7px}
  .site-header .server-status-players{font-size:7px}
  .clan-war-matchup,.clan-war-notice-matchup,.clan-staff-war-matchup{grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr);gap:5px}
  .clan-war-side,.clan-staff-war-side{min-width:0}
  .clan-war-side strong,.clan-staff-war-side strong{max-width:100%;overflow-wrap:anywhere}
  .site-music-player.is-youtube-player{width:calc(100vw - 20px)}
  .profile-page{padding-top:108px}
  .public-staff-profile{padding-top:108px}
  .credit-transfer-profile{margin-top:108px}
  .account-summary,.credit-product-grid,.credit-store-benefits,.storefront-category-grid,.dashboard-role-permissions>div,.dashboard-role-permission-items{grid-template-columns:minmax(0,1fr)}
  .clan-public-chat-composer{grid-template-columns:minmax(0,1fr)}
  .clan-public-chat-composer button{width:100%}
  .application-questions-heading,.application-questions-heading>*{max-width:100%;}
  .application-question-required{white-space:normal}
}

@media(min-width:601px) and (max-width:900px){
  .register-layout,.profile-layout,.support-layout,.clan-community-grid,.storefront-checkout-layout{grid-template-columns:minmax(0,1fr)}
  .profile-image-grid,.credit-product-grid,.storefront-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .application-question-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .application-question-row>textarea{grid-column:1/-1}
  .clan-staff-body{grid-template-columns:64px minmax(0,1fr)}
  .clan-staff-sidebar{padding-inline:8px}
}

/* Keep account/profile loading feedback visible and neatly contained on phones. */
.profile-identity .is-loading{display:flex;max-width:100%;align-items:center;gap:9px;color:#aeb7bd}
.profile-identity .is-loading::before,.account-message.is-loading::before,.public-profile-message.is-loading::before{display:inline-block;width:14px;height:14px;flex:0 0 14px;border:2px solid rgba(205,218,224,.26);border-top-color:#e6ecef;border-radius:50%;content:"";animation:responsive-loading-spin .8s linear infinite}
.account-message.is-loading,.public-profile-message.is-loading{display:flex;width:fit-content;max-width:100%;min-height:44px;align-items:center;gap:10px;padding:10px 13px;border:1px solid rgba(255,255,255,.09);border-radius:10px;background:rgba(255,255,255,.025);color:#aeb7bd;overflow-wrap:anywhere}
.profile-identity .is-loading{min-height:1.35em;font-size:clamp(12px,3.5vw,14px)}
@keyframes responsive-loading-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){
  .profile-page{padding-top:108px!important}
  .public-staff-profile{padding-top:108px}
  .public-staff-profile-content{padding-top:25px}
  .credit-transfer-profile{margin-top:108px!important}
  .account-profile-cover{margin-bottom:54px}
  .account-profile-cover .profile-tabs{bottom:-5px}
  .account-profile-cover .profile-tabs-panel{display:grid;width:min(100%,350px);grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:5px}
  .account-profile-cover .profile-tabs-panel a{justify-content:center;min-width:0;padding:0 8px;white-space:normal;text-align:center;line-height:1.25}
  .credit-transfer-profile{margin-bottom:54px!important}
  .credit-transfer-profile .profile-tabs-panel{display:grid;width:min(100%,350px);grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .credit-transfer-profile .profile-tabs-panel a{justify-content:center;min-width:0;padding:0 8px;white-space:normal;text-align:center;line-height:1.25}
  .profile-identity{max-width:calc(100vw - 126px)}
  .profile-identity h1{overflow-wrap:anywhere}
  .public-profile-message.is-loading,.account-message.is-loading{width:100%}
}
@media(prefers-reduced-motion:reduce){.profile-identity .is-loading::before,.account-message.is-loading::before,.public-profile-message.is-loading::before{animation:none;border-right-color:transparent}}

@media(prefers-reduced-motion:reduce){.nav-mobile-toggle span{transition:none}}
@media(max-width:820px){.profile-page{padding-top:108px}.public-staff-profile{padding-top:108px}.credit-transfer-profile{margin-top:108px}}
