/* Just Pet Reimagined — game-world presentation layer.
   Existing P53 game.js, canvas coordinates, accessories and interactions remain untouched. */
:root{--cream:#fff6e7;--cream2:#f8e9d4;--rose:#e96f98;--rose2:#c74e78;--gold:#d4ac70;--ink:#704637;--ink2:#956a56;--glass:#fff5e8dd;}
*{box-sizing:border-box}
html,body{min-height:100%;}
body{margin:0;color:var(--ink);font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;background:#f6d8ca url('assets/reimagined-room.webp') center center/cover fixed no-repeat;}
button,input{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .14s ease,filter .14s ease}
button:active{transform:translateY(1px) scale(.985)}
button:disabled{cursor:default;filter:grayscale(.2);opacity:.55}
[hidden]{display:none!important}

/* Landing: the room is the game world, not a rounded web card. */
.homepage{width:min(1480px,100%);min-height:100svh;margin:auto;padding:clamp(12px,2vw,26px) clamp(14px,3vw,42px) 18px;display:grid;grid-template-rows:auto 1fr auto auto;gap:clamp(7px,1.2vh,16px);align-content:stretch;}
.home-top{display:flex;align-items:center;justify-content:space-between;color:#80533f;font-size:12px;font-weight:800;letter-spacing:.1em;text-shadow:0 1px 0 #fff9ed;}
.home-top>span{background:#fff4e8c9;border:1px solid #d9b78f;border-radius:18px;padding:8px 14px;box-shadow:0 3px 0 #a8794e44,inset 0 1px #fff;}
.head-actions{display:flex;align-items:center;gap:8px;}
.home-top button,.head-actions button{min-height:40px;padding:7px 14px;border:1px solid #e6c59a;border-radius:16px;background:linear-gradient(#fffdf6,#f6dec0);box-shadow:0 3px 0 #b27b4b66,inset 0 1px #fff;color:#7d4a32;font-weight:800;}
.hero{position:relative;min-height:0;overflow:visible;isolation:isolate;border:0;border-radius:0;background:transparent!important;box-shadow:none;display:flex;flex-direction:column;align-items:center;}
.hero::after{content:none!important}
.hero-title{position:relative;z-index:3;text-align:center;padding:0;text-shadow:0 2px 8px #fff8ed;}
.hero-title h1.brand-logo{width:min(64vw,510px);height:clamp(82px,12vw,142px);max-width:none;margin:0 auto;background:url('assets/ui-logo.webp') center/contain no-repeat;color:transparent;font-size:0;text-shadow:none;}
.hero-title p{margin:-2px 0 0;color:#875c47;font:700 clamp(14px,1.8vw,21px) Georgia,serif;letter-spacing:.12em;text-shadow:0 1px 0 #fff8ec;}
.models{position:relative;inset:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;justify-items:center;width:min(940px,94%);flex:1;min-height:230px;margin:clamp(-8px,-1vh,-2px) auto 0;gap:clamp(4px,2vw,24px);}
.model{position:relative;width:100%;height:100%;min-width:0;min-height:0;max-width:290px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;padding:0 4px 27px;border:0;border-radius:24px;background:transparent!important;box-shadow:none;}
.model::before{content:"";position:absolute;bottom:14px;left:10%;width:80%;height:22px;border-radius:50%;background:#8d54372a;filter:blur(9px);}
.model img{position:relative;width:100%;height:100%;max-height:clamp(230px,43vh,440px);object-fit:contain;object-position:center bottom;filter:drop-shadow(0 13px 10px #71452e44);pointer-events:none;transition:transform .18s ease;}
.model span{position:absolute;z-index:2;bottom:0;left:50%;transform:translateX(-50%);padding:8px 24px;min-width:106px;text-align:center;border:1px solid #e5c18e;border-radius:18px;background:linear-gradient(#fffdf5,#f4dfbf);box-shadow:0 4px 0 #b17b4a55,inset 0 1px #fff;color:#754832;font-size:13px;font-weight:900;white-space:nowrap;}
.model:hover img,.model:focus-visible img{transform:translateY(-5px) scale(1.025)}
.model:focus-visible span{background:linear-gradient(#ffe1e8,#f5a7bb);}
.model:nth-child(2){z-index:1}
.home-cta{display:grid;justify-items:center;gap:6px;text-align:center;}
.home-cta button{min-width:min(82vw,320px);min-height:58px;padding:10px 24px;border:0;background:url('assets/ui-button-active.webp') center/100% 100% no-repeat;color:#773549;font:900 20px Georgia,serif;text-shadow:0 1px #fff2df;filter:drop-shadow(0 5px 3px #80533d44);}
.home-cta p{margin:0;color:#845a46;font-weight:700;font-size:clamp(11px,1.3vw,14px);text-shadow:0 1px #fff8e8;}
.home-foot{text-align:center;color:#8d644f;font-size:10px;font-weight:700;text-shadow:0 1px #fff8e8;}

/* Studio shell: three visual zones inside a single illustrated room. */
#studio{width:min(1500px,100%);min-height:100svh;margin:0 auto;padding:clamp(9px,1.4vh,18px) clamp(10px,2.2vw,30px) 14px;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;background:transparent;}
#studio header{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:clamp(56px,8vh,86px);margin:0;padding:2px 8px;color:#81513d;}
#studio header>div:first-child{display:flex;align-items:center;gap:14px;min-width:0;}
#studio header h1.brand-logo{display:block;width:clamp(160px,20vw,270px);height:clamp(50px,7vw,84px);min-height:0;margin:0;padding:0;background:url('assets/ui-logo.webp') center/contain no-repeat;color:transparent;font-size:0;text-shadow:none;overflow:hidden;flex:none;}
#studio header small{display:block;color:#875c47;font:700 clamp(11px,1.2vw,15px) Georgia,serif;letter-spacing:.1em;text-shadow:0 1px #fff6e8;white-space:nowrap;}
#studio header .head-actions{gap:6px;}
#studio header .head-actions button{min-width:42px;min-height:40px;padding:6px 12px;border:1px solid #e3c294;border-radius:15px;background:linear-gradient(#fffdf6,#f2dabb);box-shadow:0 3px 0 #a9774b66,inset 0 1px #fff;color:#784a34;font-weight:850;}
#studio #musicToggle[aria-pressed=true]{background:linear-gradient(#ffd3df,#f08aa9);color:#8d3756;}
.layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(370px,.92fr);gap:clamp(12px,2.2vw,32px);align-items:center;}
.stage{width:100%;max-width:620px;justify-self:center;display:flex;flex-direction:column;align-items:center;gap:8px;padding:0 5px;background:transparent;border:0;border-radius:0;box-shadow:none;min-width:0;}
.pets{display:flex;gap:clamp(5px,1vw,10px);justify-content:center;width:min(100%,530px);margin:0 0 1px;}
.pets button{display:flex;align-items:center;justify-content:flex-start;gap:7px;flex:1;min-width:0;max-width:160px;min-height:43px;padding:5px 10px 5px 6px;border:1px solid #d9b384;border-radius:22px;background:linear-gradient(#fffdf6,#f2dfc4);box-shadow:0 4px 0 #a9784c55,inset 0 1px #fff;color:#80513a;font-size:13px;font-weight:850;}
.pets button::before{content:"";width:31px;height:31px;flex:none;border-radius:50%;background-color:#ffe9d6;background-size:170%;background-position:50% 12%;background-repeat:no-repeat;box-shadow:0 0 0 1px #e4c59a;}
#catPet::before{background-image:url('assets/cat.webp')}#dogPet::before{background-image:url('assets/dog.webp')}#pigPet::before{background-image:url('assets/pig.webp')}
.pets button.active{background:linear-gradient(#ffe2e9,#f5adbf);border-color:#d96589;box-shadow:0 4px 0 #ae536c66,inset 0 1px #fff;color:#783346;}
.portrait-frame{position:relative;width:min(100%,520px);aspect-ratio:549/669;flex:none;background:url('assets/ui-frame.webp') center/100% 100% no-repeat;isolation:isolate;filter:drop-shadow(0 10px 14px #67402c33);}
.portrait-frame canvas{position:absolute;top:14%;left:11%;width:78%;height:78%;display:block;aspect-ratio:6/7;border-radius:0;box-shadow:none;z-index:-1;touch-action:none;}
.stage-dock{width:min(100%,520px);display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:-1px;padding:0 7px;min-width:0;}
.stage-dock .name{flex:1;min-width:0;display:flex;align-items:center;gap:7px;margin:0;color:#79503e;font-size:12px;font-weight:850;text-shadow:0 1px #fff6ea;}
.stage-dock .name label{white-space:nowrap;}
.stage-dock .name input{width:100%;min-width:0;min-height:40px;padding:5px 13px;border:0;border-radius:0;background:url('assets/ui-button.webp') center/100% 100% no-repeat;color:#754351;text-align:center;font-weight:800;box-shadow:none;}
.stage-dock .name input:focus{outline:2px solid #be6081;outline-offset:1px;}
.stage-dock .shutter-row{flex:0 0 min(44%,205px);margin:0;}
.stage-dock #save{width:100%;min-height:52px;padding:4px 10px;border:0;background:url('assets/ui-button-active.webp') center/100% 100% no-repeat;color:#783247;font-weight:900;font-size:15px;box-shadow:none;white-space:nowrap;}
.stage-dock #save::before{content:"";display:inline-block;width:27px;height:27px;margin-right:7px;vertical-align:middle;background:url('assets/ui-shutter.webp') center/contain no-repeat;}

/* Accessory wardrobe is a rendered object, not a browser card. */
.panel{width:100%;max-width:510px;min-width:0;max-height:calc(100svh - 132px);overflow:auto;justify-self:center;padding:clamp(30px,4vh,46px) clamp(26px,3.5vw,42px) clamp(22px,3vh,34px);background:transparent url('assets/ui-cabinet.webp') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:none;color:#744a38;scrollbar-width:thin;scrollbar-color:#cf9c8a transparent;}
.panel .tabs{display:flex;gap:8px;margin:0 0 10px;padding:0;}
.panel .tabs button{flex:1;min-height:44px;padding:6px 5px;border:0;border-radius:0;background:url('assets/ui-button.webp') center/100% 100% no-repeat;color:#754b36;font-weight:900;font-size:14px;box-shadow:none;}
.panel .tabs button.active{background-image:url('assets/ui-button-active.webp');color:#7a344b;}
.panel .themes{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:0 0 10px;}
.panel .themes button{min-height:48px;padding:6px 8px;border:1px solid #dbb58b;border-radius:13px;background:linear-gradient(#fff8e9dd,#f1d8b8e8);color:#78503b;font-size:12px;font-weight:850;box-shadow:0 3px 0 #b57e4f44,inset 0 1px #fff;}
.panel .themes button.active{outline:2px solid #e87a9b;outline-offset:-2px;background:linear-gradient(#ffe6ed,#f8c6d3);color:#853c54;}
.panel h2{margin:8px 0 7px;color:#704531;text-align:center;font:900 clamp(16px,1.4vw,19px) Georgia,serif;letter-spacing:.015em;text-shadow:0 1px #fff5df;}
.panel .items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:7px;border:1px solid #d2ad7c;border-radius:17px;background:#fff4e2b8;box-shadow:inset 0 2px 6px #9b6b3730;}
.panel .items button{position:relative;display:grid;place-items:center;align-content:center;gap:3px;min-width:0;height:80px;min-height:0;padding:4px;border:1px solid #e3c9a5;border-radius:13px;background:linear-gradient(#fffdf6,#f4e3ce);box-shadow:0 3px 0 #c19a6a55,inset 0 1px #fff;color:#74503d;font-size:10px;font-weight:800;line-height:1.1;}
.panel .items button img{width:100%;max-width:68px;height:46px;object-fit:contain;filter:drop-shadow(0 3px 2px #76513a33);}
.panel .items button.active{border:2px solid #e36f91;background:linear-gradient(#fff8f5,#ffd8e2);box-shadow:0 0 0 2px #fff5e7,0 4px 0 #cb8190;color:#81364f;}
.panel .items button.equipped::after{content:"✓";position:absolute;top:3px;right:4px;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#e96f98;color:white;font-size:11px;font-weight:900;box-shadow:0 1px 3px #78445a44;}
.panel .hint{margin:8px 0;color:#845b46;text-align:center;font-size:11px;font-weight:700;line-height:1.35;}
.panel .control-dock{margin-top:7px;padding:7px 8px 6px;border:1px solid #dfbf96;border-radius:15px;background:#fff0dba8;box-shadow:inset 0 1px #fff8eb;}
.panel .tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;}
.panel .tools button,.panel .control-dock .actions button,.panel #cameraTools .actions button{min-width:0;min-height:36px;padding:5px 4px;border:0;border-radius:0;background:url('assets/ui-button.webp') center/100% 100% no-repeat;color:#754b36;font-size:11px;font-weight:850;box-shadow:none;white-space:nowrap;}
.panel .tools button:active,.panel .control-dock .actions button:active,.panel #cameraTools .actions button:active{background-image:url('assets/ui-button-active.webp');}
.panel .control-dock .actions{display:flex;gap:7px;margin:6px 0 0;}
.panel #cameraTools{padding:8px 2px 2px;border:0;background:transparent;box-shadow:none;}
.panel #cameraTools h2{text-align:center;}
.panel #cameraTools input[type=range]{width:100%;accent-color:#e46d91;}
.panel .photo-option{display:flex;align-items:center;justify-content:center;gap:9px;margin:12px auto 2px;padding:9px;border:1px solid #dfc197;border-radius:14px;background:#fff5e6b5;color:#744d38;font-weight:800;}
.panel .photo-option input{width:18px;height:18px;accent-color:#de6f91;}
#status{min-height:17px;margin:5px 0 0;color:#8b5364;text-align:center;font-size:11px;font-weight:800;}
#studio footer{display:none;}

/* Dialogs retain the same physical stationery language. */
dialog{max-width:min(92vw,560px);max-height:94svh;padding:14px;border:2px solid #e0b98f;border-radius:22px;background:linear-gradient(#fff8ed,#f2dfc7);color:#734b38;box-shadow:0 16px 50px #462b2655;}
dialog::backdrop{background:#3e2a2b88;backdrop-filter:blur(3px);}
dialog img{display:block;width:100%;max-height:72svh;object-fit:contain;border-radius:12px;background:#fff2e0;}
dialog .actions{display:flex;gap:8px;margin-top:10px;}
dialog .actions button{flex:1;min-height:44px;border:0;border-radius:0;background:url('assets/ui-button.webp') center/100% 100% no-repeat;color:#704a36;font-weight:900;}
dialog .actions .primary{background-image:url('assets/ui-button-active.webp');color:#7d354d;}
.home-help{width:min(450px,92vw);}
.home-help h2{color:#794a36;text-align:center;font:900 24px Georgia,serif;}
.home-help ol{padding-left:23px;line-height:1.6;color:#7f5946;}
.home-help li{margin-bottom:7px;}
.sound-option{display:flex;align-items:center;gap:9px;min-height:40px;color:#7d503c;font-weight:800;}
.sound-option input{width:18px;height:18px;accent-color:#e46e92;}
.home-help>#helpClose{width:100%;min-height:46px;border:0;background:url('assets/ui-button-active.webp') center/100% 100% no-repeat;color:#79364c;font-weight:900;}
#flash{position:fixed;inset:0;z-index:50;background:#fff;pointer-events:none;opacity:0;}
button:focus-visible,input:focus-visible{outline:2px solid #b74470;outline-offset:2px;}

@media(max-width:900px){
  #studio{padding:8px 10px 12px;gap:4px;}
  #studio header{min-height:52px;padding:0 5px;}
  #studio header h1.brand-logo{width:160px;height:50px;}
  .layout{grid-template-columns:minmax(0,1fr) minmax(330px,.92fr);gap:10px;}
  .portrait-frame{width:min(100%,430px);}
  .panel{max-height:calc(100svh - 100px);padding:28px 27px 22px;}
  .panel .items{gap:6px;}
  .panel .items button{height:72px;}
}
@media(max-width:720px){
  body{background-attachment:scroll;background-position:center top;}
  .homepage{min-height:100svh;padding:10px 11px 12px;gap:7px;}
  .home-top>span{font-size:10px;padding:7px 10px;}
  .home-top button{min-height:34px;padding:5px 10px;font-size:12px;}
  .hero-title h1.brand-logo{width:min(90vw,390px);height:clamp(76px,15vw,110px);}
  .hero-title p{font-size:13px;}
  .models{width:100%;min-height:0;height:clamp(220px,41svh,350px);gap:0;}
  .model{padding:0 1px 25px;}
  .model img{max-height:100%;width:100%;}
  .model span{min-width:0;padding:6px 12px;font-size:11px;bottom:0;}
  .home-cta button{min-height:49px;font-size:17px;min-width:min(78vw,270px);}
  .home-foot{font-size:9px;}
  #studio{padding:5px 8px 10px;gap:5px;}
  #studio header{min-height:43px;margin:0;padding:0 2px;}
  #studio header h1.brand-logo{width:120px;height:40px;}
  #studio header small{font-size:9px;letter-spacing:.04em;}
  #studio header .head-actions{gap:3px;}
  #studio header .head-actions button{min-width:31px;min-height:32px;padding:4px 7px;font-size:11px;border-radius:12px;}
  .layout{grid-template-columns:1fr;grid-template-rows:auto auto;gap:7px;align-content:start;}
  .stage{max-width:min(100%,410px);gap:4px;}
  .pets{max-width:370px;gap:5px;}
  .pets button{max-width:none;min-height:34px;padding:3px 8px 3px 4px;font-size:11px;gap:5px;}
  .pets button::before{width:26px;height:26px;}
  .portrait-frame{width:min(100%,calc(clamp(240px,47svh,380px)*.821));max-width:360px;}
  .stage-dock{width:100%;max-width:390px;gap:6px;padding:0 3px;}
  .stage-dock .name{font-size:10px;gap:4px;}
  .stage-dock .name input{min-height:35px;padding:3px 8px;font-size:12px;}
  .stage-dock .shutter-row{flex-basis:45%;}
  .stage-dock #save{min-height:43px;font-size:12px;padding:3px 5px;}
  .stage-dock #save::before{width:21px;height:21px;margin-right:3px;}
  .panel{width:100%;max-width:480px;max-height:none;overflow:visible;padding:25px 25px 19px;margin:0 auto;background-size:100% 100%;}
  .panel .tabs{gap:6px;margin-bottom:6px;}
  .panel .tabs button{min-height:37px;font-size:12px;}
  .panel .themes{margin-bottom:6px;gap:6px;}
  .panel .themes button{min-height:38px;font-size:11px;}
  .panel h2{font-size:15px;margin:5px 0;}
  .panel .items{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:5px;}
  .panel .items button{height:60px;min-height:0;padding:2px 1px;font-size:9px;}
  .panel .items button img{height:34px;width:100%;}
  .panel .hint{margin:5px 0;font-size:10px;}
  .panel .control-dock{margin-top:4px;padding:5px;}
  .panel .tools{gap:4px;}
  .panel .tools button,.panel .control-dock .actions button,.panel #cameraTools .actions button{min-height:31px;font-size:10px;padding:3px 2px;}
  .panel .control-dock .actions{margin-top:4px;}
  #status{font-size:10px;min-height:13px;margin-top:3px;}
}
@media(max-width:380px){
  .models{height:clamp(205px,38svh,300px);}
  .model span{padding:5px 9px;font-size:10px;}
  .panel{padding:22px 21px 16px;}
  .panel .items{gap:3px;padding:4px;}
  .panel .items button{height:56px;font-size:8px;}
  .panel .items button img{height:30px;}
}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px){
  .homepage{grid-template-rows:auto 1fr auto;grid-template-columns:1fr 210px;align-items:center;gap:6px;padding:6px 20px;}
  .home-top,.home-foot{grid-column:1/-1;}
  .hero{min-height:0;height:calc(100svh - 76px);}
  .hero-title h1.brand-logo{height:65px;width:250px;}
  .hero-title p{font-size:11px;}
  .models{height:auto;min-height:0;position:absolute;inset:30% 2% 9%;}
  .model{padding-bottom:22px;}
  .model span{font-size:9px;padding:4px 9px;}
  .home-cta{grid-column:2;grid-row:2;}
  #studio{padding:3px 12px 0;gap:3px;}
  #studio header{min-height:37px;}
  #studio header h1.brand-logo{width:120px;height:38px;}
  #studio header small{font-size:9px;}
  .layout{grid-template-columns:minmax(0,1fr) minmax(310px,.85fr);gap:12px;}
  .stage{max-width:none;display:grid;grid-template-columns:minmax(0,1fr) 90px;grid-template-rows:auto auto;gap:1px 8px;}
  .stage .pets{grid-column:1/-1;grid-row:1;max-width:100%;}
  .stage .portrait-frame{grid-column:1;grid-row:2;width:min(100%,calc((100svh - 115px)*.70));justify-self:center;}
  .stage .stage-dock{grid-column:2;grid-row:2;display:flex;flex-direction:column;align-items:stretch;justify-content:center;padding:0;}
  .stage-dock .name{display:grid;gap:3px;}
  .stage-dock .shutter-row{flex:initial;width:100%;}
  .stage-dock #save{min-height:36px;font-size:10px;}
  .stage-dock #save::before{width:17px;height:17px;}
  .panel{max-height:calc(100svh - 50px);padding:22px 25px 16px;}
  .panel .tabs button{min-height:32px;font-size:11px;}
  .panel .themes{margin-bottom:4px;}
  .panel .themes button{min-height:31px;padding:3px;font-size:9px;}
  .panel h2{font-size:13px;margin:3px 0;}
  .panel .items{gap:4px;padding:4px;}
  .panel .items button{height:47px;font-size:8px;padding:2px;}
  .panel .items button img{height:26px;}
  .panel .hint{font-size:9px;margin:3px 0;}
  .panel .control-dock{margin-top:3px;padding:3px;}
  .panel .tools button,.panel .control-dock .actions button{min-height:26px;font-size:9px;}
  #status{font-size:9px;min-height:10px;margin-top:2px;}
}

/* P02 — pedestal pet stage + open floating accessory carousel. */
:root{--p02-cream:#fff5e6;--p02-rose:#e96d96;--p02-gold:#d7ac70;--p02-ink:#784a3d;}
body{background:#f7d9d2 url('assets/reimagined-room.webp') center center/cover no-repeat fixed;color:var(--p02-ink);}
#studio{width:min(1540px,100%);padding:clamp(8px,1.2vh,16px) clamp(10px,2vw,30px) 10px;gap:4px;}
#studio header{min-height:clamp(48px,6.5vh,72px);padding:0 6px;margin:0;}
#studio header>div:first-child{gap:0;}
#studio header h1.brand-logo{width:clamp(145px,17vw,220px);height:clamp(46px,6vw,68px);}
#studio header small{display:none!important;}
#studio header .head-actions{gap:8px;}
#studio header .head-actions button,.home-top button{min-width:48px;min-height:42px;padding:7px 16px;border:0;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;box-shadow:none;color:#784735;font-weight:900;}
.layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.12fr) minmax(390px,.88fr);gap:clamp(8px,1.5vw,24px);align-items:center;}
.stage{width:100%;max-width:660px;gap:6px;padding:0;background:transparent;border:0;box-shadow:none;}
.stage .pets{width:min(100%,550px);gap:10px;margin:0 0 0;}
.stage .pets button{flex:1;max-width:160px;min-height:44px;padding:5px 11px 5px 7px;border:0;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;box-shadow:none;color:#704639;font-size:13px;transition:transform .18s ease,filter .18s ease;}
.stage .pets button::before{width:35px;height:35px;background-size:165%;box-shadow:0 2px 5px #744b3933;}
.stage .pets button.active{background-image:url('assets/ui-button-active.webp');color:#843e55;transform:translateY(-3px) scale(1.035);filter:drop-shadow(0 5px 4px #8f506033);}
.stage .pets button.active::before{box-shadow:0 0 0 2px #fff1de,0 2px 6px #a75b6833;}
.portrait-frame{position:relative;width:min(100%,600px);aspect-ratio:6/7;flex:none;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;filter:none!important;overflow:visible;}
.portrait-frame canvas{position:relative!important;top:auto!important;left:auto!important;width:100%!important;height:auto!important;aspect-ratio:6/7;display:block;z-index:auto!important;border:0!important;border-radius:0!important;box-shadow:none!important;touch-action:none;}
.stage-dock{width:min(100%,590px);padding:0 8px;gap:12px;margin:0;}
.stage-dock .name{font-size:13px;gap:7px;}
.stage-dock .name input{min-height:44px;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;border:0;box-shadow:none;text-align:center;}
.stage-dock .shutter-row{flex:0 0 min(43%,210px);}
.stage-dock #save{min-height:54px;background:transparent url('assets/ui-button-active.webp') center/100% 100% no-repeat;border:0;box-shadow:none;}
.panel{width:100%;max-width:560px;max-height:calc(100svh - 88px);overflow:visible;justify-self:center;align-self:center;padding:8px 6px 10px!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:#754b39;}
.panel .tabs{display:flex;gap:9px;margin:0 0 7px;padding:0;background:transparent;border:0;box-shadow:none;}
.panel .tabs button,.panel .tools button,.panel .control-dock .actions button,.panel #cameraTools .actions button,.panel .themes button{min-height:40px;padding:6px 12px;border:0;border-radius:0;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;box-shadow:none;color:#724735;font-size:13px;font-weight:900;}
.panel .tabs button.active,.panel .tools button:active,.panel .control-dock .actions button:active,.panel .themes button.active{background-image:url('assets/ui-button-active.webp');color:#833e55;}
.panel .themes{display:flex;gap:8px;margin:0 0 6px;}
.panel .themes button{flex:1;min-height:38px;font-size:12px;}
.panel h2{margin:7px 0 0;text-align:left;font:900 clamp(17px,1.5vw,22px) Georgia,serif;color:#774738;text-shadow:0 1px #fff5e6;}
.item-browser{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;gap:3px;margin:2px 0 0;}
.item-browser .rail-arrow{width:40px;height:48px;min-height:0;padding:0;border:0;background:transparent url('assets/ui-button-active.webp') center/100% 100% no-repeat;color:#873d54;font:900 25px Georgia,serif;box-shadow:none;}
.panel .items{display:flex;align-items:stretch;gap:5px;min-width:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:#d68aa0 #fff0e3;padding:8px 4px 14px;border:0;border-radius:0;background:transparent;box-shadow:none;}
.panel .items button{position:relative;flex:0 0 clamp(116px,13vw,148px);height:142px;min-height:0;padding:5px 7px 8px;border:0;border-radius:0;background:transparent url('assets/accessory-plinth.webp') center bottom/100% 80% no-repeat;box-shadow:none;color:#754738;font-size:12px;font-weight:900;line-height:1.15;scroll-snap-align:center;transition:transform .18s ease,filter .18s ease;}
.panel .items button img{width:100%;max-width:118px;height:92px;object-fit:contain;filter:drop-shadow(0 5px 3px #714c3544);transition:transform .18s ease;}
.panel .items button span{display:block;position:relative;margin-top:-2px;text-shadow:0 1px 2px #fff8ed;}
.panel .items button.active{background-image:url('assets/accessory-plinth.webp');filter:drop-shadow(0 0 5px #e96f98);transform:translateY(-5px) scale(1.04);color:#8c3553;}
.panel .items button.equipped::after{top:0;right:7px;width:23px;height:23px;font-size:14px;background:#e96f98;box-shadow:0 2px 4px #70423255;}
.panel .hint{margin:0;color:#7d5848;text-align:center;font-size:11px;font-weight:750;}
.panel .control-dock{margin-top:4px;padding:4px 2px 2px;border:0;border-radius:0;background:transparent;box-shadow:none;}
.panel .tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0;}
.panel .tools button{min-height:37px;padding:4px 3px;font-size:11px;}
.panel .control-dock .actions{display:flex;gap:8px;margin:3px auto 0;max-width:70%;}
.panel #cameraTools{padding:8px 3px;background:transparent;border:0;box-shadow:none;}
.panel #cameraTools h2{text-align:left;}
.panel #cameraTools .actions{display:flex;gap:8px;}
.panel #cameraTools .actions button{flex:1;}
#status{min-height:14px;margin:1px 0;color:#8b5364;text-align:center;font-size:11px;}
#studio footer{display:none;}
button:focus-visible,input:focus-visible{outline:2px solid #b74470;outline-offset:2px;}
/* Home: real pet art, no CSS cards; title/logo anchored in the top-left. */
.homepage{position:relative;width:min(1480px,100%);min-height:100svh;padding:10px clamp(14px,3vw,38px) 12px;grid-template-rows:auto 1fr auto;gap:4px;}
.home-top{min-height:58px;}
.home-top h1.brand-logo{width:clamp(140px,18vw,225px);height:clamp(48px,6vw,68px);margin:0;background:url('assets/ui-logo.webp') center/contain no-repeat;color:transparent;font-size:0;}
.home-top button{min-height:42px;}
.hero-title{display:none;}
.models{width:min(1120px,98%);gap:clamp(8px,2.4vw,30px);margin:0 auto;min-height:260px;}
.model{max-width:350px;padding:0 3px 26px;}
.model img{max-height:clamp(260px,54vh,530px);filter:drop-shadow(0 18px 12px #6a3d2f50);}
.model span{min-width:124px;padding:9px 24px;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;border:0;box-shadow:none;color:#704638;font-size:14px;}
.model:focus-visible img,.model:hover img{transform:translateY(-8px) scale(1.04);}
.home-cta button{background:transparent url('assets/ui-button-active.webp') center/100% 100% no-repeat;border:0;box-shadow:none;}
.home-foot{display:none;}
.home-cta p{font-size:12px;}
/* Modal and photo controls use the same 3D button family. */
dialog{border:0;background:linear-gradient(#fff8ed,#f3dfcb);box-shadow:0 16px 50px #462b2655;}
dialog .actions button,.home-help>#helpClose{border:0;background:transparent url('assets/ui-button.webp') center/100% 100% no-repeat;color:#704a36;box-shadow:none;}
dialog .actions .primary,.home-help>#helpClose{background-image:url('assets/ui-button-active.webp');color:#7d354d;}
@media(max-width:900px){.layout{grid-template-columns:minmax(0,1fr) minmax(340px,.95fr);gap:7px;}.panel{max-height:calc(100svh - 70px);}.portrait-frame{width:min(100%,500px);}}
@media(max-width:720px){
 #studio{min-height:100svh;padding:4px 8px 8px;gap:2px;}
 #studio header{min-height:43px;padding:0 2px;}
 #studio header h1.brand-logo{width:126px;height:42px;}
 #studio header .head-actions button{min-width:40px;min-height:35px;padding:4px 10px;font-size:12px;}
 .layout{display:flex;flex-direction:column;align-items:stretch;gap:0;}
 .stage{width:100%;max-width:none;gap:2px;padding:0;}
 .stage .pets{width:min(100%,440px);gap:4px;margin:0 auto;}
 .stage .pets button{max-width:132px;min-height:35px;font-size:11px;padding:3px 7px 3px 4px;}
 .stage .pets button::before{width:29px;height:29px;}
 .portrait-frame{width:min(100%,calc(43svh * 6 / 7));max-width:390px;margin:0 auto;}
 .stage-dock{width:min(100%,420px);gap:5px;margin:0 auto;padding:0 3px;}
 .stage-dock .name{font-size:11px;gap:4px;}
 .stage-dock .name input{min-height:37px;padding:3px 7px;font-size:12px;}
 .stage-dock .shutter-row{flex-basis:42%;}
 .stage-dock #save{min-height:42px;font-size:12px;padding:3px 6px;}
 .stage-dock #save::before{width:21px;height:21px;margin-right:3px;}
 .panel{width:100%;max-width:520px;max-height:none;overflow:visible;padding:1px 0 2px!important;margin:0 auto;}
 .panel .tabs{margin:0 0 2px;gap:5px;}
 .panel .tabs button{min-height:33px;padding:3px 8px;font-size:12px;}
 .panel .themes{gap:5px;margin-bottom:1px;}
 .panel .themes button{min-height:29px;padding:3px 5px;font-size:10px;}
 .panel h2{font-size:15px;margin:2px 4px 0;}
 .item-browser{grid-template-columns:32px minmax(0,1fr) 32px;gap:1px;margin-top:0;}
 .item-browser .rail-arrow{width:32px;height:40px;font-size:21px;}
 .panel .items{gap:1px;padding:2px 1px 5px;}
 .panel .items button{flex-basis:clamp(108px,31vw,132px);height:107px;padding:3px 5px 5px;background-size:100% 76%;font-size:10px;}
 .panel .items button img{height:65px;max-width:95px;}
 .panel .items button span{margin-top:-2px;}
 .panel .items button.equipped::after{width:19px;height:19px;font-size:12px;}
 .panel .hint{font-size:10px;margin:0;line-height:1.15;}
 .panel .control-dock{margin-top:1px;padding:0;}
 .panel .tools{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;}
 .panel .tools button{min-height:30px;padding:2px;font-size:10px;}
 .panel .control-dock .actions{max-width:65%;margin-top:1px;}
 .panel .control-dock .actions button{min-height:30px;padding:2px 4px;font-size:10px;}
 #status{font-size:9px;min-height:10px;margin:0;}
 .home-top{min-height:46px;}
 .home-top h1.brand-logo{width:145px;height:48px;}
 .models{width:100%;min-height:0;gap:4px;}
 .model{padding-bottom:22px;}
 .model img{max-height:42svh;}
 .model span{min-width:90px;padding:6px 12px;font-size:11px;}
 .home-cta button{min-height:48px;min-width:min(78vw,270px);font-size:16px;}
}
@media(max-width:390px){.portrait-frame{width:min(100%,calc(41svh * 6 / 7));}.panel .items button{flex-basis:108px;}#studio header h1.brand-logo{width:110px;}.panel .tools button{font-size:9px;}}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px){
 #studio{min-height:100svh;padding:3px 12px 5px;gap:1px;}
 #studio header{min-height:38px;}#studio header h1.brand-logo{width:120px;height:38px;}
 .layout{grid-template-columns:minmax(0,1fr) minmax(340px,.95fr);gap:8px;}
 .stage{max-width:calc((100svh - 120px)*6/7 + 24px);gap:2px;}
 .stage .pets button{min-height:30px;font-size:10px;}
 .stage .pets button::before{width:25px;height:25px;}
 .portrait-frame{width:min(100%,calc(100svh - 125px));}
 .stage-dock .name input{min-height:32px;} .stage-dock #save{min-height:34px;font-size:11px;}
 .panel{max-height:calc(100svh - 44px);padding:1px!important;}
 .panel .tabs button{min-height:30px;font-size:11px;}
 .panel .themes button{min-height:26px;font-size:9px;}
 .panel h2{font-size:13px;margin:1px 3px 0;}
 .panel .items button{height:92px;flex-basis:110px;font-size:9px;}
 .panel .items button img{height:56px;}
 .panel .tools button,.panel .control-dock .actions button{min-height:27px;font-size:9px;}
 .model img{max-height:54svh;}
}
/* Mini podium artwork keeps accessory items visually grounded without enclosing them in cards. */
.panel .items button{background-size:100% auto!important;background-position:center bottom!important;}
.panel .items button img{position:relative;z-index:1;margin-bottom:-12px;}
.home-brand{display:flex;align-items:center;gap:10px;min-width:0;}
.home-brand span{color:#875c47;font:700 clamp(11px,1.2vw,14px) Georgia,serif;letter-spacing:.05em;text-shadow:0 1px #fff8e8;white-space:nowrap;}
@media(max-width:720px){.home-brand{gap:6px}.home-brand span{font-size:10px}}
/* Accessories are thumbnail-cropped independently of their original wearable art. */
.panel .items button{flex-basis:clamp(128px,13.4vw,156px);height:158px;}
.panel .items button img{max-width:136px;height:112px;object-fit:contain;margin-bottom:-14px;}
@media(max-width:720px){.panel .items button{flex-basis:clamp(116px,32vw,138px);height:124px;}.panel .items button img{max-width:116px;height:86px;margin-bottom:-10px;}}
@media(max-width:390px){.panel .items button{flex-basis:114px;height:120px;}.panel .items button img{max-width:108px;height:81px;}}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px){.panel .items button{height:98px;flex-basis:118px;}.panel .items button img{height:65px;max-width:108px;margin-bottom:-8px;}.stage{max-width:calc((100svh - 102px)*6/7 + 24px);}}
/* High-specificity P02 overrides for legacy #studio item-grid sizing. */
#studio .panel .items{display:flex!important;grid-template-columns:none!important;grid-auto-flow:unset!important;grid-auto-columns:unset!important;align-items:stretch!important;gap:5px!important;overflow-x:auto!important;overflow-y:hidden!important;height:auto!important;max-height:none!important;padding:8px 4px 14px!important;}
#studio .panel .items button{display:grid!important;flex:0 0 clamp(136px,13.4vw,160px)!important;width:auto!important;height:158px!important;min-height:0!important;max-height:none!important;padding:5px 7px 8px!important;}
#studio .panel .items button img{display:block!important;width:100%!important;max-width:140px!important;height:112px!important;max-height:none!important;object-fit:contain!important;margin-bottom:-14px!important;}
@media(max-width:720px){#studio .panel .items{gap:2px!important;padding:2px 1px 6px!important;}#studio .panel .items button{flex:0 0 clamp(124px,32vw,142px)!important;height:132px!important;padding:3px 5px 5px!important;}#studio .panel .items button img{max-width:124px!important;height:94px!important;margin-bottom:-12px!important;}}
@media(max-width:390px){#studio .panel .items button{flex-basis:120px!important;height:126px!important;}#studio .panel .items button img{max-width:116px!important;height:88px!important;}}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px){#studio .panel .items{gap:2px!important;padding:1px!important;}#studio .panel .items button{flex-basis:126px!important;height:108px!important;}#studio .panel .items button img{max-width:112px!important;height:73px!important;margin-bottom:-9px!important;}}

/* P02 wardrobe: reuse illustrated plinth and ivory nameplate, separate art from labels. */
#studio .panel .items button{grid-template-rows:minmax(0,1fr) 26px!important;align-content:stretch!important;gap:0!important;background-size:100% auto!important;background-position:center calc(100% - 26px)!important;}
#studio .panel .items button img{align-self:end;margin-bottom:9px!important;filter:drop-shadow(0 4px 3px #714c3544);}
#studio .panel .items button span{align-self:end;justify-self:stretch;display:grid;place-items:center;min-height:24px;margin:0;padding:3px 5px;background:url('assets/ui-button.webp') center/100% 100% no-repeat;color:#754738;font-size:11px;line-height:1.05;text-align:center;}
#studio .panel .items button.active span{background-image:url('assets/ui-button-active.webp');color:#713047;}
#studio .panel .items button.active{transform:none;filter:drop-shadow(0 0 4px #e96f98);}
#studio .panel .items button.active img{transform:translateY(-3px);}
@media(max-width:720px){#studio .panel .items button{grid-template-rows:minmax(0,1fr) 23px!important;background-position:center calc(100% - 23px)!important;}#studio .panel .items button span{min-height:22px;font-size:10px;}#studio .panel .items button img{margin-bottom:5px!important;}}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px){#studio .panel .items button{grid-template-rows:minmax(0,1fr) 20px!important;background-position:center calc(100% - 20px)!important;}#studio .panel .items button span{min-height:19px;font-size:9px;}#studio .panel .items button img{margin-bottom:3px!important;}}
/* P02.2: floating studio controls, existing illustrated assets only. */
#studio .panel .control-dock{background:none!important;border:0!important;box-shadow:none!important;padding:5px 0!important;margin-top:8px;}
#studio .panel .control-dock .tools{gap:8px;}
#studio .panel .control-dock .actions{max-width:76%;gap:10px;margin:7px auto 0;}
#studio .panel .control-dock button{filter:drop-shadow(0 2px 2px #75473540);font-family:Georgia,serif;font-weight:700;}
#studio .panel .control-dock button:disabled{opacity:.52;}
#studio .panel .item-browser .rail-arrow{background-image:url('assets/ui-button.webp');color:#754738;filter:drop-shadow(0 2px 2px #75473544);}
#studio .panel .item-browser .rail-arrow:active{background-image:url('assets/ui-button-active.webp');}
#studio .panel .items{scrollbar-width:none;gap:8px!important;scroll-padding-inline:4px;}
#studio .panel .items::-webkit-scrollbar{display:none;}
#studio .panel .items button{flex:0 0 calc((100% - 16px)/3)!important;min-width:0!important;scroll-snap-align:start;}
#studio .panel .items button img{max-width:100%!important;}
#studio .panel #wardrobe{background:url('assets/ui-sign.webp') center/100% 100% no-repeat;width:min(270px,90%);min-height:42px;display:grid;place-items:center;margin:3px auto;padding:8px 24px;color:#754738;font-size:15px;}
@media(max-width:720px){#studio .panel .items button{flex-basis:calc((100% - 8px)/2)!important;}#studio .panel #wardrobe{min-height:34px;font-size:13px;}#studio .panel .control-dock .tools{gap:4px;}}
/* P02.3: unify existing illustrated controls; keep the studio open. */
#studio .head-actions button,#studio .stage .pets button,#studio .panel .tabs button,#studio .panel .control-dock button,#studio #cameraTools .actions button{font-family:Georgia,'Times New Roman',serif;font-weight:700;letter-spacing:.15px;text-shadow:0 1px #fff8;filter:drop-shadow(0 2px 2px #70443838);}
#studio .panel .control-dock .tools,#studio .panel .control-dock .actions{background:transparent!important;border:0!important;box-shadow:none!important;}
#studio .panel .control-dock button:not(:disabled):hover{background-image:url('assets/ui-button-active.webp');color:#713047;}
#studio .panel .control-dock button:disabled{filter:none;opacity:.65;}
#studio .panel .item-browser .rail-arrow{width:34px;height:44px;}
#studio .panel .items button span{font-family:Georgia,'Times New Roman',serif;font-weight:700;}
#studio .panel .hint,#studio #status{color:#754738;text-shadow:0 1px 2px #fff5e5;}
@media(max-width:720px){#studio .panel .item-browser .rail-arrow{width:28px;height:36px;}#studio .panel .control-dock .actions{max-width:86%;}}
