*{box-sizing:border-box}html,body{margin:0;height:100%;background:#111;color:#eee;font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif}button,a{touch-action:manipulation}a{color:inherit;text-decoration:none}button{font:inherit;cursor:pointer}.app-header{height:60px;background:#f38ab7;display:flex;align-items:center;gap:18px;padding:0 25px;color:#18151a}.brand{font-size:12px;font-weight:800;letter-spacing:.1em}.app-header strong{font-size:19px;letter-spacing:.015em}.create{margin-left:auto;color:#fff;background:#2b2430;border-radius:8px;padding:10px 19px;font-size:14px;font-weight:700}.studio{display:grid;grid-template-columns:minmax(315px,40%) minmax(0,1fr);height:calc(100dvh - 60px);max-width:1280px;margin:auto;min-height:400px}.preview{background:#17171a;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px;gap:11px;border-right:1px solid #313035}.canvas-frame{height:min(100%,calc(100dvh - 155px));aspect-ratio:2/3;max-width:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;border-radius:10px}#avatar{width:100%;height:100%;object-fit:contain;display:block}.undress{max-width:390px;display:flex;gap:6px;justify-content:center;flex-wrap:wrap}.undress button{border:1px solid #555;background:#29292e;color:#eee;font-size:11px;border-radius:6px;padding:6px 9px}.undress button.off{color:#f38ab7;border-color:#f38ab7}.editor{display:flex;flex-direction:column;min-height:0;overflow:hidden}.main-menu{height:70px;flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:#262328;border-bottom:1px solid #494149}.main-menu a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:12px;color:#ddd;border-bottom:3px solid transparent}.main-menu a.active{color:#f7a0c5;border-color:#f38ab7;background:#332931}.main-menu img{height:27px;width:27px;object-fit:contain}.editor-scroll{min-height:0;overflow:auto;padding-bottom:18px}.subnav{display:flex;gap:5px;overflow-x:auto;padding:11px;background:#1c1b1f;position:sticky;top:0;z-index:2}.subnav button{min-width:67px;flex:0 0 auto;border:1px solid #424047;background:#29272c;color:#eee;padding:6px;border-radius:8px;font-size:11px;display:flex;flex-direction:column;align-items:center;gap:4px}.subnav button.active{border-color:#f38ab7;background:#503544}.subnav img{height:25px;width:30px;object-fit:contain}.catalog{padding:15px}.catalog h2{font-size:15px;margin:6px 0 13px;font-weight:650}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:11px}.card{min-width:0;padding:9px;border:1px solid #414046;border-radius:10px;background:#262429;text-align:center}.card>button{width:100%;background:#fff;border:0;border-radius:7px;padding:6px;min-height:110px;display:grid;place-items:center}.card>button img{width:100%;max-height:125px;object-fit:contain}.card h3{font-size:11px;margin:8px 0 6px;line-height:1.4;min-height:2.6em;overflow-wrap:anywhere}.card small{color:#aaa}.colors{display:flex;flex-wrap:wrap;gap:5px;justify-content:center;margin-top:7px}.colors button{height:24px;min-width:24px;background:transparent;border:1px solid #777;border-radius:100px;padding:1px}.colors img{width:19px;height:19px;object-fit:contain}.empty{padding:20px;color:#bbb}.notice{font-size:12px;color:#ccc}
@media(max-width:780px){.app-header{height:52px;padding:0 13px;gap:9px}.app-header strong{font-size:16px}.brand{font-size:9px}.create{padding:9px 13px}.studio{height:calc(100dvh - 52px);min-height:0;display:flex;flex-direction:column}.preview{flex:0 0 auto;height:clamp(210px,46dvh,490px);padding:7px 8px 5px;gap:5px;border:0}.canvas-frame{height:calc(100% - 33px);max-height:none;aspect-ratio:2/3}.undress{height:28px;overflow-x:auto;max-width:100%;flex-wrap:nowrap;justify-content:flex-start}.undress button{white-space:nowrap;font-size:10px;padding:4px 7px}.editor{flex:1;min-height:0}.main-menu{height:61px;order:2;border-top:1px solid #4a4148;border-bottom:0}.main-menu img{height:25px;width:25px}.editor-scroll{order:1;flex:1}.subnav{padding:7px}.subnav button{min-width:59px}.catalog{padding:9px}.cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.card{padding:4px;border-radius:7px}.card>button{min-height:66px;padding:2px}.card>button img{max-height:90px}.card h3{font-size:9px;margin:5px 0;min-height:2.5em}.card small{font-size:9px}}
@media(max-height:650px) and (max-width:780px){.preview{height:37dvh;min-height:170px}.canvas-frame{height:calc(100% - 26px)}.undress{height:23px}}

/* Shared header logo and subnavigation */
.app-header{position:relative;justify-content:space-between}
.app-logo{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:37px;max-width:39%;object-fit:contain;pointer-events:none}
.brand,.create{position:relative;z-index:1}.brand{white-space:nowrap}.create{margin-left:auto}
.subnav button span{display:block;font-size:10px;line-height:1.15;font-weight:600;white-space:nowrap}
.subnav button{padding:7px 6px 6px;min-width:74px;gap:5px;justify-content:center}
.subnav img{width:34px;height:33px;object-fit:contain}
body:has(.main-menu a:first-child.active) .canvas-frame{aspect-ratio:10/27;height:min(calc(100dvh - 140px),100%);max-height:none}
@media(max-width:780px){.app-logo{height:29px;max-width:34%}.brand{font-size:9px;letter-spacing:0}.create{font-size:11px;padding:9px 8px}.subnav button{min-width:65px;padding:5px}.subnav img{height:27px;width:30px}body:has(.main-menu a:first-child.active) .preview{height:clamp(235px,52dvh,560px)}body:has(.main-menu a:first-child.active) .canvas-frame{height:calc(100% - 30px);max-height:100%}}
@media(max-width:400px){.app-logo{height:25px;max-width:31%}.brand{font-size:8px}.create{font-size:10px}}


/* Stable editor styles migrated from JS (2026-11-04). */

  #catalog .gf-face-thumb button{overflow:hidden;display:flex;align-items:center;justify-content:center}
  #catalog .gf-face-thumb button img{transform:scale(1.5);transform-origin:50% 50%;flex-shrink:0}
  #catalog .gf-face-thumb.gf-face-thumb-200 button img{transform:scale(2)}
  /* Hair / Skin / Eye / Brow colors: circular crop with a fine white edge. */
  #catalog .gf-face-colors,#catalog .gf-hair-colors{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;align-items:center!important;align-content:flex-start!important;text-align:left!important;width:100%!important;box-sizing:border-box!important;gap:8px!important;margin:8px 0 16px!important}
  #catalog .gf-face-colors button,#catalog .gf-hair-colors button{display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 36px!important;box-sizing:border-box!important;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:1px!important;overflow:hidden!important;border:1px solid #fff!important;border-radius:50%!important;background:#fff!important;box-shadow:0 0 0 1px rgba(0,0,0,.42)!important;cursor:pointer}
  #catalog .gf-face-colors button.active,#catalog .gf-hair-colors button.active{box-shadow:0 0 0 2px #f48ab1!important}
  #catalog .gf-face-colors button img,#catalog .gf-hair-colors button img{display:block!important;box-sizing:border-box!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center!important;border-radius:50%!important;clip-path:circle(50% at 50% 50%)}
  #catalog .gf-face-colors button:focus-visible,#catalog .gf-hair-colors button:focus-visible{outline:2px solid #f48ab1!important;outline-offset:3px!important}
  #catalog .gf-face-controls{display:flex;align-items:center;justify-content:space-between;gap:8px}
  #catalog .gf-face-remove{border:0;background:transparent;cursor:pointer;padding:4px}
  #catalog .gf-face-remove img{display:block;width:26px;height:26px;object-fit:contain}
 

  #undress.gf-fit-controls{display:flex!important;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;padding:10px 12px;margin:0;box-sizing:border-box;max-width:100%;}
  #undress.gf-fit-controls .gf-fit-button{border:0!important;box-shadow:none!important;background:transparent!important;appearance:none;display:flex;align-items:center;justify-content:center;min-width:0;width:54px;height:auto;padding:2px!important;cursor:pointer;flex:0 0 auto;}
  #undress.gf-fit-controls .gf-fit-button img{display:block;width:100%;max-width:52px;height:auto;object-fit:contain;}
  #undress.gf-fit-controls .gf-fit-button:disabled{opacity:.55;cursor:default;}
  #undress.gf-fit-controls .gf-fit-button:focus-visible{outline:2px solid #ed8db8;outline-offset:2px;border-radius:6px;}
  /* Catalog text: product ID is kept in image alt but not visible. */
  #catalog #gf-fashion-items .cards .card h3{font-size:12px!important;line-height:1.45!important;font-weight:400!important;letter-spacing:normal!important;}
  /* Three evenly spaced round swatches, with a bright edge on dark cards. */
  #catalog #gf-fashion-items .cards .card .colors{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;align-items:center!important;justify-content:stretch!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:5px 2px!important;margin:0!important;}
  #catalog #gf-fashion-items .cards .card .colors button{display:flex!important;align-items:center!important;justify-content:center!important;justify-self:center!important;flex:none!important;box-sizing:border-box!important;min-width:0!important;width:32px!important;max-width:100%!important;height:32px!important;min-height:0!important;padding:1px!important;margin:0!important;overflow:hidden!important;border-radius:50%!important;border:1px solid #fff!important;background:#fff!important;box-shadow:0 0 0 1px rgba(0,0,0,.42)!important;cursor:pointer;}
  #catalog #gf-fashion-items .cards .card .colors button img{display:block!important;box-sizing:border-box!important;min-width:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center!important;border-radius:50%!important;clip-path:circle(50% at 50% 50%);}
  #catalog #gf-fashion-items .cards .card .colors button:focus-visible{outline:2px solid #f48ab1!important;outline-offset:3px!important;}
  @media(max-width:820px){
    #catalog.gf-fashion-catalog{overflow-y:auto!important;-webkit-overflow-scrolling:touch;min-height:0;overscroll-behavior:contain;}
    #catalog.gf-fashion-catalog #subnav{position:static!important;inset:auto!important;transform:none!important;max-width:100%;width:100%;display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;box-sizing:border-box;flex:0 0 auto;padding:8px 10px;margin:0;}
    #catalog.gf-fashion-catalog #subnav button{flex:0 0 auto;}
    /* Mobile fit controls: a single horizontal row, fully visible and scrollable. */
    #catalog.gf-fashion-catalog #undress{position:static!important;inset:auto!important;transform:none!important;display:flex!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;flex:0 0 auto!important;box-sizing:border-box!important;justify-content:flex-start!important;align-items:center!important;flex-wrap:nowrap!important;gap:5px!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding:8px 10px 14px!important;margin:0!important;}
    #catalog.gf-fashion-catalog #undress .gf-fit-button{display:flex!important;flex:0 0 48px!important;width:48px!important;min-width:48px!important;max-width:48px!important;height:auto!important;min-height:0!important;max-height:none!important;box-sizing:border-box!important;padding:2px!important;overflow:visible!important;}
    #catalog.gf-fashion-catalog #undress .gf-fit-button img{display:block!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;object-fit:contain!important;}
    #catalog.gf-fashion-catalog #gf-fashion-items{min-width:0;}
    #catalog.gf-fashion-catalog #gf-fashion-items .cards .card .colors button{width:30px!important;height:30px!important;}

  }
 

/* Server-rendered SEO explanation (previously inline in app.php). */
/* Small server-rendered service explanation at the end of the scrollable editor. */
.gf-seo-about{margin:20px 15px 28px;padding:16px 18px;border:1px solid #39363c;border-radius:10px;background:#222126;color:#ddd}
.gf-seo-about h1{margin:0 0 9px;font-size:16px;line-height:1.55;font-weight:700;color:#f3f3f3}
.gf-seo-about p{margin:0 0 8px;font-size:12px;line-height:1.8;color:#c9c6cd}
.gf-seo-about p:last-child{margin-bottom:0}
@media(max-width:780px){.gf-seo-about{margin:14px 9px 24px;padding:13px 12px}.gf-seo-about h1{font-size:14px}.gf-seo-about p{font-size:12px}}

/* 2026-11-07: Desktop rails, full-height editor geometry, and page-level footer. */
/* The editor canvas is 400 x 1080. Matching its container ratio removes the
   white bars caused by object-fit:contain; wallpapers are not cropped. */
body:has(.main-menu a:first-child.active) .canvas-frame{aspect-ratio:10/27}
@media (min-width:821px){
  #undress.gf-fit-controls{justify-content:flex-start!important;align-items:center!important;}
}
.gf-page-footer{width:100%;background:#151519;padding:22px 18px 42px}
.gf-page-footer-inner{max-width:1280px;margin:0 auto}
.gf-editor-ad{box-sizing:border-box;min-height:130px;padding:10px 18px 18px;text-align:center}
.gf-editor-ad ins.adsbygoogle{display:block;max-width:970px;margin:0 auto}
.gf-page-footer .gf-seo-about{max-width:980px;margin:18px auto 0;padding:22px 25px;border-radius:8px;background:#202025}
.gf-page-footer .gf-seo-about h1{font-size:18px;margin:0 0 12px}
.gf-page-footer .gf-seo-about h2{font-size:14px;font-weight:700;line-height:1.6;margin:18px 0 8px}
.gf-page-footer .gf-seo-about p{font-size:13px;line-height:1.85}
@media (max-width:820px){
  /* On phones only the image-creation page carries bottom ad/help content. */
  .gf-page-footer{display:none!important}
}


/* 2026-11-07: Face/Item/Wallpaper wallpaper coverage and mobile preview toggle. */
/* Desktop Face/Items/Wallpaper: constrain the FRAME to the native 480x720
   (2:3) canvas ratio before fitting the image. A max-width alone can compress
   the frame's width without reducing its explicit height; object-fit:fill
   then stretches the entire character vertically. */
@media (min-width:781px){
  .studio:not(:has(.main-menu a:first-child.active)) .canvas-frame{
    width:min(100%, calc(66.6666667dvh - 103.333333px));
    height:auto;
    max-height:calc(100dvh - 155px);
    aspect-ratio:2/3;
    flex:0 0 auto;
  }
  .studio:not(:has(.main-menu a:first-child.active)) #avatar{
    width:100%;height:100%;object-fit:contain;
  }
}
.gf-mobile-preview-toggle{display:none}
@media (max-width:780px){
  /* Preview switch is reachable both before and after the part selector collapses. */
  .gf-mobile-preview-toggle{
    display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;gap:7px;
    max-width:100%;min-height:29px;padding:5px 14px;border-radius:17px;
    border:1px solid #76717c;background:#2a292e;color:#f4edf0;
    font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;
  }
  .gf-mobile-preview-toggle .gf-preview-toggle-symbol{font-size:16px;line-height:1}
  .studio .preview{gap:5px}
  .studio .preview .canvas-frame{min-height:0;height:calc(100% - 38px);max-height:100%;width:auto;aspect-ratio:2/3}
  .studio:has(.main-menu a:first-child.active) .preview .canvas-frame{aspect-ratio:10/27;height:calc(100% - 38px)}
  /* Expanded state: keep the bottom main menu visible, hide the parts list. */
  body.gf-preview-expanded .studio .preview{flex:1 1 auto!important;height:auto!important;min-height:0!important;padding:8px 8px 6px}
  /* Both width and height limits preserve the correct canvas aspect ratio. */
  body.gf-preview-expanded .studio .preview .canvas-frame{flex:0 1 auto!important;height:min(calc(100dvh - 174px), 150vw)!important;width:auto!important;max-width:100%!important;max-height:100%!important}
  body.gf-preview-expanded .studio:has(.main-menu a:first-child.active) .preview .canvas-frame{height:min(calc(100dvh - 174px), 270vw)!important}
  body.gf-preview-expanded .studio .editor{flex:0 0 61px!important;min-height:61px!important;height:61px!important}
  body.gf-preview-expanded .studio .editor-scroll{display:none!important}
  body.gf-preview-expanded .studio .main-menu{height:61px;flex:0 0 61px}
}
