/* Mobile layout for the Hexi top bar and shared page chrome. Load AFTER topbar-more.css. */
.ns-more-logout,.ns-avatar-tab{display:none!important}

@media(max-width:760px){
  /* ---- top bar: row 1 = logo + bell + currency, row 2 = full-width tab bar ---- */
  header.ns-top{display:flex;flex-wrap:wrap;align-items:center;gap:0 8px;padding:10px 12px 0}
  header.ns-top .ns-logo{order:1;height:24px;margin:0 auto 0 0}
  header.ns-top .ns-right{order:2;position:static;top:auto;right:auto;gap:6px;margin-left:auto}
  header.ns-top .ns-center{order:3;width:0;height:0}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .ns-row{width:100%;gap:0}
  .ns-search{display:none}
  .ns-nav>a.ns-avatar-tab{display:inline-flex!important}
  .ns-more-menu a.ns-avatar-dup{display:none}
  .ns-nav .ns-more-btn.active{background:none}
  .ns-nav>a.ns-link[href*="workshop"]{display:none}

  .ns-pill.ns-nav,.ns-nav{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:2500;width:auto;max-width:none;height:56px;padding:4px;gap:2px;overflow:visible;background:rgba(var(--input-rgb,42,38,56),.96);box-shadow:0 -4px 24px rgba(0,0,0,.5);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
  .ns-nav>.ns-link,.ns-nav>.ns-more{flex:1 1 0;min-width:0}
  .ns-nav .ns-link{flex-direction:column;justify-content:center;gap:3px;height:46px;padding:0 2px;font-size:11px;font-weight:600;line-height:1;width:100%}
  .ns-nav .ns-link svg{width:19px;height:19px}
  .ns-nav .ns-more{margin-left:0}
  .ns-nav .ns-more .ns-link.ns-more-btn{gap:3px}
  .ns-nav .ns-more-btn svg.ns-more-icon{width:19px;height:19px}
  .ns-nav .ns-more-btn svg.ns-more-chev{display:none}

  .ns-pill.hx-corner-currency,.ns-right .hx-corner-currency{height:36px;padding:0 10px;gap:10px}
  .hx-corner-currency-item{font-size:13px}

  /* More menu opens upward from the bottom tab bar */
  .ns-more-menu{left:12px!important;right:12px;width:auto;height:auto;flex-direction:column;align-items:stretch;gap:2px;padding:6px;border-radius:12px}
  .ns-more-menu.open{display:flex}
  .ns-more-menu a.ns-link,.ns-nav .ns-more-menu a.ns-link{flex-direction:row;justify-content:flex-start;height:44px;padding:0 14px;font-size:15px;font-weight:500;border-radius:8px}
  .ns-more-menu .ns-more-logout{display:inline-flex!important;color:#ff8a8a;border-top:1px solid var(--pill-border);border-radius:0 0 8px 8px;margin-top:4px}

  /* notifications panel fits the screen */
  .hx-notif-panel{position:fixed!important;left:12px!important;right:12px!important;top:62px!important;width:auto!important;max-width:none!important}

  /* touch targets + no iOS zoom on focus */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important}
  button,.btn{min-height:36px}

  /* general content */
  html[data-theme] main{padding:16px 12px 28px}
  img,video,canvas{max-width:100%}
  footer{display:none!important}
}

@media(max-width:360px){
  .ns-nav .ns-link{font-size:10px}
  .hx-corner-currency-item svg{display:none}
}

/* ===== Avatar page (phones) ===== */
@media(max-width:760px){
  html[data-theme] .rbx-avatar-layout{row-gap:20px}
  html[data-theme] .rbx-panel-title{font-size:16px;font-weight:600;margin:0 0 10px 2px;letter-spacing:.2px}
  html[data-theme] .rbx-avatar-colors .rbx-panel-title{text-align:left}

  /* 3D preview: shorter, framed, with a soft purple glow behind the avatar */
  html[data-theme] .avatar-preview-box{width:100%!important;height:min(58vh,340px);border-radius:16px;
    background:radial-gradient(ellipse at 50% 40%,rgba(var(--accent-rgb,139,63,224),.22),transparent 65%),#1d1a28}

  /* currently wearing: one swipeable row */
  html[data-theme] .rbx-wearing-list{flex-wrap:nowrap;overflow-x:auto;gap:12px;padding:4px 2px 8px;margin:0 -12px;padding-left:12px;padding-right:12px;scroll-snap-type:x proximity;scrollbar-width:none}
  html[data-theme] .rbx-wearing-list::-webkit-scrollbar{display:none}
  html[data-theme] .rbx-wear-card{width:88px;flex:0 0 88px;scroll-snap-align:start}
  html[data-theme] .rbx-wear-card .rbx-item-thumb{width:88px;height:88px;border-radius:12px}
  html[data-theme] .rbx-wear-card .rbx-item-name{font-size:12px;margin:6px 0 0;text-align:center}
  html[data-theme] .rbx-wear-remove{top:5px;right:5px;width:22px;height:22px;min-width:22px;min-height:22px;padding:0;display:flex;align-items:center;justify-content:center;line-height:1;border-radius:50%;background:rgba(var(--bg-rgb,20,18,28),.85);border:1px solid var(--border-color,#3d3852)}

  /* inventory */
  html[data-theme] .rbx-inventory-card{padding:0;border:0;background:none;border-radius:0;min-height:0}
  html[data-theme] .rbx-category-tabs{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;gap:6px;margin:0 -12px 6px;padding:0 12px 12px;scrollbar-width:none}
  html[data-theme] .rbx-category-tabs::-webkit-scrollbar{display:none}
  html[data-theme] .rbx-tab-link{flex:0 0 auto;white-space:nowrap;padding:8px 13px;font-size:13px;gap:6px;border-radius:999px}
  html[data-theme] .rbx-tab-link svg{width:15px;height:15px}
  html[data-theme] .rbx-item-grid{grid-template-columns:repeat(auto-fill,88px)!important;justify-content:start;gap:14px 12px;max-height:min(46vh,380px);overflow-y:auto;padding:6px 2px 4px}
  html[data-theme] .rbx-item-card{width:88px!important;min-width:0}
  html[data-theme] .rbx-item-grid .rbx-item-thumb{width:88px!important;height:88px!important;aspect-ratio:auto;border-radius:12px}
  html[data-theme] .rbx-item-name{font-size:11px;margin:4px 0 0;width:100%;text-align:center}
  html[data-theme] .rbx-item-thumb{border-radius:10px}
  html[data-theme] .rbx-item-badge{top:-4px;right:-4px;width:16px;height:16px;line-height:16px;font-size:10px!important}

  /* body colors */
  html[data-theme] .rbx-colors-card{padding:14px;border-radius:16px}
  #avatar2d{width:150px}
  .a2d-wheel-wrap canvas{max-width:240px;width:100%;height:auto}
}
