/* One uniform 941 x 1672 reference coordinate space for every Home layer. */
#app:has(#screen-home.active){background:#9dddeb url('assets/home/habitat.png') center/var(--home-width) var(--home-height) no-repeat}
#app:has(#screen-home.active) #bottomnav{display:none}
#app:has(#screen-home.active) .pet-region{position:absolute;inset:0}
#app:has(#screen-home.active) #screens{position:absolute;left:var(--home-left);top:var(--home-top);width:941px;height:1672px;transform:scale(var(--home-scale));transform-origin:top left;padding:0;overflow:visible}
#screen-home{position:relative;width:941px;height:1672px;color:#17445e;font-family:Arial,'Sarabun',sans-serif}
#screen-home.active{animation:none}
#app:has(#screen-home.active) #topbar{position:absolute;left:var(--home-left);top:var(--home-top);width:941px;height:190px;padding:0;transform:scale(var(--home-scale));transform-origin:top left;z-index:5;display:block;background:none;font-family:Arial,'Sarabun',sans-serif}
#app:has(#screen-home.active) .tb-left{position:absolute;left:145px;top:38px;width:329px;height:57px;padding:8px 20px 8px 42px;background:linear-gradient(110deg,#064c6cde,#145573ae);border:2px solid #89e7eb8a;border-radius:40px}
#app:has(#screen-home.active) .tb-name{font:600 34px Arial,sans-serif;line-height:38px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 2px 3px #194c6a}
#app:has(#screen-home.active) .tb-day,#app:has(#screen-home.active) .tb-right{display:none}
.home-header-hud{display:none}
#app:has(#screen-home.active) .home-header-hud{display:block}
.home-avatar{position:absolute;left:25px;top:22px;width:151px;height:147px;object-fit:contain;filter:drop-shadow(0 2px 4px #227a96aa);cursor:pointer;border-radius:50%}
.home-avatar:focus-visible{outline:6px solid #fff;outline-offset:3px}
.avatar-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}
.avatar-choice{appearance:none;border:3px solid #bfeef6;border-radius:22px;padding:12px 10px 10px;background:linear-gradient(160deg,#f5ffff,#cceff5);color:#17445e;font:700 1rem Arial,'Sarabun',sans-serif;cursor:pointer;box-shadow:0 6px 14px #1e6f8a22}
.avatar-choice img{display:block;width:100%;aspect-ratio:1;object-fit:contain;margin:0 auto 7px;filter:drop-shadow(0 3px 5px #216b8655)}
.avatar-choice span{display:block}
.avatar-choice.selected{border-color:#17c9de;background:linear-gradient(160deg,#e7ffff,#9de7ef);box-shadow:0 0 0 3px #bffaff,0 7px 18px #16a9c044}
.avatar-choice:focus-visible{outline:3px solid #734cff;outline-offset:3px}
.onboarding-dialog{max-width:410px!important;padding:22px!important;border:3px solid #eaffff!important;background:linear-gradient(155deg,#f8fffff7,#d3f4f7f5)!important;box-shadow:inset 0 0 0 4px #8fe8ee77,0 22px 55px #082c5066!important}
.onboarding-steps{display:flex;align-items:flex-start;justify-content:center;margin:0 0 18px}
.onboarding-step{position:relative;display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;gap:4px;color:#77a1ae;font:700 .68rem Arial,'Sarabun',sans-serif}
.onboarding-step:not(:last-child)::after{content:'';position:absolute;left:62%;right:-38%;top:15px;height:3px;border-radius:4px;background:#b7dfe4}
.onboarding-step b{position:relative;z-index:1;display:grid;place-items:center;width:31px;height:31px;border-radius:50%;background:#c3e8ec;color:#527a88;font-size:.82rem;box-shadow:0 2px 6px #28627722}
.onboarding-step.active{color:#075878}.onboarding-step.active b{background:linear-gradient(#20d9e7,#08aeca);color:white;box-shadow:0 0 0 4px #b9f8fb,0 4px 9px #0ba5c066}
.onboarding-step.done b{background:#72d5b0;color:white}.onboarding-step.done:not(:last-child)::after{background:#72d5b0}
.onboarding-egg-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:17px 0 16px}
.onboarding-egg{min-width:0;padding:7px 4px 8px;border:2px solid #bce7ec;border-radius:16px;background:#f7ffffba;color:#17445e;font:700 .65rem Arial,'Sarabun',sans-serif;cursor:pointer;box-shadow:0 4px 10px #1f698522}
.onboarding-egg img{display:block;width:100%;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 3px 4px #23596a55)}
.onboarding-egg span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.onboarding-egg.selected{border-color:#ffc328;background:#fff2a8;box-shadow:0 0 0 3px #fff5bd,0 5px 13px #bc861844}
.onboarding-back{width:100%}
.onboarding-summary{display:flex;align-items:center;justify-content:center;gap:13px;margin:13px 0 14px;color:#159eb3;font-size:1.4rem;font-weight:700}
.onboarding-summary img{width:86px;height:86px;object-fit:contain;filter:drop-shadow(0 3px 5px #20566b44)}
.onboarding-name{width:100%;box-sizing:border-box;padding:14px 16px;border:3px solid #b9e5eb;border-radius:16px;background:#ffffffd9;color:#173d59;font:700 1.05rem Arial,'Sarabun',sans-serif;text-align:center;outline:none}
.onboarding-name:focus{border-color:#18c6da;box-shadow:0 0 0 4px #aef5fa}.onboarding-name.invalid{border-color:#ef596b;animation:shake .25s}
.onboarding-actions{display:grid;grid-template-columns:1fr 1.45fr;gap:10px;margin-top:14px}.onboarding-actions .btn-primary,.onboarding-actions .btn-ghost{margin:0}
@media(max-width:370px){.onboarding-dialog{padding:16px!important}.onboarding-egg-grid{gap:6px}.onboarding-egg{padding:5px 2px;font-size:.58rem}.onboarding-summary img{width:72px;height:72px}}
.home-header-hud .hero-card{position:absolute;left:175px;top:98px;width:331px;height:52px;background:linear-gradient(90deg,#075b76b5,#145575c9);border:2px solid #86e8ef99;border-radius:30px;margin:0;padding:0;box-shadow:inset 0 0 0 4px #91d9e344;backdrop-filter:none}
.home-header-hud .hero-top{position:absolute;left:0;top:3px;margin:0}
.home-header-hud .lvl-badge{display:block;background:linear-gradient(#126b88b8,#207f9bab);border:2px solid #83ebf0aa;border-radius:25px;padding:3px 12px;height:40px;min-width:101px;color:white;font:26px Arial,sans-serif}
.home-header-hud .hero-stage{display:none}
.home-header-hud .exp-wrap{position:absolute;left:111px;top:7px;width:207px;height:35px;border:2px solid #7fbed870;border-radius:22px;background:#082f4bbc;cursor:pointer;padding:4px 8px 4px 47px}
.home-header-hud .exp-label{position:absolute;left:7px;top:6px;margin:0;color:white;font:20px Arial,sans-serif}
.home-header-hud #home-exp{display:none}
.home-header-hud .bar{height:24px;border-radius:16px;background:#3b6785a8;box-shadow:inset 0 2px 3px #051d3877}
.home-header-hud .bar-fill.exp{background:linear-gradient(#ceff79,#a5ed43);box-shadow:inset 0 1px 3px white}
.home-header-hud .status-row{position:absolute;left:529px;top:142px;width:270px;height:44px;margin:0;padding:5px 12px;display:flex;justify-content:center;gap:12px;border:1px solid #bbdeee8a;border-radius:26px;background:linear-gradient(#184f6ecc,#155375c9);color:#fff}
.home-header-hud .status-row .bar{display:none}
.home-header-hud .st-name{width:auto;font-size:0}
.home-header-hud .st-name::after{content:'HP';font:26px Arial,sans-serif}
.home-header-hud .st-val{width:auto;font:26px Arial,sans-serif}
.home-money,.home-energy{position:absolute;border-radius:30px;background:linear-gradient(#174f78e8,#174969bc);border:1px solid #94cbe77a;box-shadow:inset 0 0 3px #c0e8ef88}
.home-money{left:549px;top:36px;width:230px;height:49px;padding:5px 17px 4px 55px;color:white;text-align:center;font:600 31px Arial,sans-serif;white-space:nowrap}
.home-money img{position:absolute;left:-23px;top:-7px;width:55px;height:55px}
.home-money span{display:block;overflow:hidden;text-overflow:ellipsis}
.home-energy{left:550px;top:90px;width:229px;height:46px;padding:8px 26px 8px 29px}
.home-energy>img{position:absolute;left:-22px;top:-1px;width:47px;height:54px}
.energy-cells{display:flex;gap:4px;height:27px}
.energy-cells i{flex:1;min-width:0;border:2px solid #6fa0b7b3;background:linear-gradient(#315b7c,#39768c);border-radius:6px;overflow:hidden;box-shadow:inset 0 2px 3px #184a6c}
.energy-cells i:first-child{border-radius:14px 6px 6px 14px}.energy-cells i:last-child{border-radius:6px 14px 14px 6px}
.energy-cells b{display:block;height:100%;background:linear-gradient(#dfff75,#9edc28);box-shadow:inset 0 0 4px #efffb2}
.home-menu-toggle{width:44px;height:44px;padding:10px;border:2px solid #c3faff;border-radius:13px;background:#175478d6;color:white;display:flex;flex-direction:column;justify-content:center;gap:4px;cursor:pointer;flex-shrink:0}
.home-menu-toggle span{height:3px;width:100%;border-radius:8px;background:#f5fcff}
#app:has(#screen-login.active) .home-menu-toggle{display:none}
#app:has(#screen-home.active) .home-menu-toggle{position:absolute;left:811px;top:25px;width:105px;height:104px;padding:23px;gap:9px;border:3px solid #a4edff;border-radius:29px;background:linear-gradient(135deg,#287b96b9,#20557fd9);box-shadow:inset 0 0 0 5px #ffffff15,0 0 12px #b6eeff9c}
#app:has(#screen-home.active) .home-menu-toggle span{height:9px;min-height:9px}
#screen-home .vitals-row{position:absolute;left:18px;top:198px;width:905px;height:70px;display:flex;align-items:center;gap:0;padding:0 65px 0 20px;margin:0;background:linear-gradient(115deg,#b9eaeed4,#c6f1ffc7);border:3px solid #edffff;border-radius:45px;box-shadow:inset 0 0 0 3px #c6ffff55,0 0 12px #c5ffff95;backdrop-filter:blur(5px)}
#screen-home .vital-card,#screen-home .vitals-row .pill-stress{height:32px;flex:none;display:flex;align-items:center;justify-content:center;gap:7px;padding:0;margin:0;border:0;border-right:2px solid #f7ffffd6;border-radius:0;background:none;box-shadow:none;backdrop-filter:none}
#screen-home .vital-card:first-child{width:188px}
#screen-home .vital-card:first-child{position:relative;justify-content:flex-start;padding-left:9px}
#screen-home .vital-card:first-child .vital-val{margin-left:3px;min-width:39px}
#screen-home .vital-card:first-child .vital-label{text-transform:uppercase}
#screen-home #home-sleep-card{width:216px;cursor:pointer}
#screen-home .vital-ic{display:flex;align-items:center;justify-content:center}
#screen-home .vital-ic img{width:44px;height:42px;object-fit:contain}
#screen-home .vital-val{font-size:26px;font-weight:600;margin:0}
#screen-home .vital-label{font-size:20px;text-transform:none;color:#17445e;font-weight:400;letter-spacing:0}
#screen-home .vital-sub{display:none}
#screen-home #home-sleep-card .vital-label{order:1;font-size:25px}
#screen-home #home-sleep-card .vital-val{order:2}
#screen-home .vitals-row .pill-stress{width:235px;font-size:25px;flex-direction:row}
#screen-home .pill-top{display:flex;gap:9px;align-items:center}
#screen-home .pill-top img{width:39px;height:42px;object-fit:contain}
#screen-home #home-stress-emoji{display:none}
#screen-home .pill-top span:last-child{order:1;width:auto;margin:0;font:25px Arial,sans-serif;color:#17445e}
#screen-home #home-stress{order:2;font-size:25px}
#screen-home .pill-stress .bar{display:none}
.home-connection{height:32px;width:177px;border-right:2px solid #f7ffffd6;display:flex;justify-content:center;gap:9px;align-items:center;font:24px Arial,sans-serif}
.home-connection img{width:32px;height:34px}
.home-connection.offline img{filter:grayscale(1)}
.home-details{position:absolute;left:18px;top:198px;width:905px;z-index:7;pointer-events:none}
.home-details summary{position:absolute;right:5px;top:0;width:65px;height:70px;list-style:none;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto;font:42px Arial,sans-serif;line-height:1;border-radius:35px}
.home-details summary::-webkit-details-marker{display:none}
.home-details summary span{transform:translateY(-7px)}
.home-details[open]{top:278px;background:linear-gradient(#eafffff5,#c9eeeeef);border:2px solid white;border-radius:25px;padding:20px;pointer-events:auto;box-shadow:0 8px 25px #18374a55;backdrop-filter:blur(8px)}
.home-details[open] summary{top:-80px;right:3px}
#screen-home .home-details .status-card{background:none;box-shadow:none;border:0;padding:0;margin:0}
#screen-home .stat-grid{display:flex;gap:10px;margin:0}
#screen-home .stat-chip{flex:1;font-size:19px;background:#ffffff9c;border-radius:15px;padding:10px}
#screen-home .stat-chip b{font-size:27px}
#screen-home .stat-chip .stat-bonus{display:block;margin-top:-2px;font-size:17px;font-weight:700;color:#2f7a4d}
#screen-home .mood-line{font-size:22px;margin-top:15px}
#screen-home .pill-row{margin:15px 0 0}
#screen-home .pill-row .pill-card{font-size:24px;background:#ffffff88;box-shadow:none}
#screen-home .pill-row .pill-card span{font-size:20px;width:auto}
.home-health-meta{font:20px Arial,'Sarabun',sans-serif;line-height:1.7;margin-top:12px}
#screen-home .home-health-meta .vital-sub{display:inline;font:inherit}
#screen-home .pet-spacer{position:absolute;left:0;right:0;top:598px;height:253px}
#screen-home #evolve-btn{right:7%;top:11%;width:270px;height:100px;padding:8px 15px 8px 8px;border:4px solid #fff3ad;border-radius:52px;background:linear-gradient(135deg,#762bd3 0%,#b63df0 48%,#f3a42a 100%);box-shadow:0 8px 18px #52218488,0 0 0 5px #ffffff55,inset 0 3px 9px #ffffff77;display:flex;align-items:center;justify-content:flex-start;gap:11px;animation:home-evolve-pulse 1.7s ease-in-out infinite}
#screen-home #evolve-btn .evolve-art{flex:0 0 78px;width:78px;height:78px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle,#fffbdc 0 34%,#ffd768 36% 55%,#c63add 58% 100%);box-shadow:0 3px 8px #3f155b88,inset 0 0 0 3px #fff}
#screen-home #evolve-btn img{width:74px;height:74px;object-fit:contain;filter:drop-shadow(0 3px 3px #4f126c88)}
#screen-home #evolve-btn .evolve-copy{display:flex;min-width:0;flex-direction:column;align-items:flex-start;color:#fff;text-align:left;text-shadow:0 3px 3px #491462}
#screen-home #evolve-btn .evolve-copy b{font:700 35px/1 "Rajdhani",sans-serif;letter-spacing:1.4px}
#screen-home #evolve-btn .evolve-copy small{margin-top:2px;font:600 20px/1 "Rajdhani",sans-serif;color:#fff5c8;letter-spacing:.5px}
#screen-home #evolve-btn .evolve-arrow{margin-left:auto;color:#fff7c9;font:700 48px/1 Arial,sans-serif;text-shadow:0 2px 3px #4b176c}
@keyframes home-evolve-pulse{0%,100%{transform:scale(1);filter:brightness(1)}50%{transform:scale(1.035);filter:brightness(1.09)}}
@media(prefers-reduced-motion:reduce){#screen-home #evolve-btn{animation:none}}
.evolve-dialog-v2{position:relative;overflow:visible!important;box-sizing:border-box;max-width:470px!important;padding:30px 27px 25px!important;border:3px solid #c4ff;border-radius:36px!important;background:linear-gradient(155deg,#effdffff 0%,#d7f5fcfa 52%,#eee1fffa 100%)!important;box-shadow:0 24px 60px #061a3da8,0 0 0 6px #ffffff35,inset 0 0 32px #62d9f27d!important;color:#102c5b}
.evolve-dialog-v2::before{content:"";position:absolute;inset:8px;border:1px solid #76dced;border-radius:27px;pointer-events:none}
.evolve-dialog-v2 .dlg-title{position:relative;margin:0 0 5px;font:700 30px/1.1 "Rajdhani","Sarabun",sans-serif;color:#17305c;text-shadow:0 1px #fff}
.evolve-dialog-spark{display:inline-grid;place-items:center;width:39px;height:39px;margin-right:8px;border-radius:50%;background:linear-gradient(145deg,#ffdc4d,#ee7f2a);box-shadow:0 4px 9px #9e4c3266;color:#fff;font-size:24px;vertical-align:middle}
.evolve-dialog-v2 .dlg-sub{position:relative;display:flex;flex-direction:column;gap:2px;margin:0 0 12px;color:#596b8b;font:600 14px/1.25 "Rajdhani","Sarabun",sans-serif}
.evolve-dialog-v2 .dlg-sub b{color:#8a3bd0;font-size:15px;letter-spacing:1.5px}.evolve-dialog-v2 .dlg-sub span{font-size:13px}
.evolve-preview-v2{position:relative;height:205px;display:grid;grid-template-columns:1fr 62px 1.15fr;align-items:center;margin:0 2px 12px;border:2px solid #fff;border-radius:28px;background:radial-gradient(circle at 72% 48%,#fff8bf 0 10%,#d694ff66 31%,transparent 55%),linear-gradient(130deg,#ffffffa8,#cdeffff0);box-shadow:inset 0 0 25px #69cde96b;overflow:hidden}
.evolve-preview-v2::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 72% 48%,transparent 0 23%,#ffffff8c 24% 25%,transparent 26% 34%,#ffffff55 35% 36%,transparent 37%);pointer-events:none}
.evolve-form{position:relative;z-index:1;height:100%;display:flex;align-items:center;justify-content:center}.evolve-form span{position:absolute;top:12px;padding:3px 12px;border-radius:14px;background:#577890;color:#fff;font:700 12px "Rajdhani",sans-serif;letter-spacing:1px}.evolve-form.after span{background:linear-gradient(90deg,#9a35d9,#ee8c2a)}
.evolve-form img{width:132px;height:145px;margin-top:23px;object-fit:contain;filter:drop-shadow(0 8px 6px #24465d55)}.evolve-form.after img{width:175px;height:175px;filter:drop-shadow(0 0 12px #f7b93b99) drop-shadow(0 8px 6px #55296a55)}
.evolve-flow{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;color:#a748df}.evolve-flow b{font:700 56px/1 Arial,sans-serif;color:#d66c31;text-shadow:0 0 9px #fff}.evolve-flow i{font-style:normal;color:#ffc52f;animation:evolve-flow-spark 1.15s ease-in-out infinite}.evolve-flow i:last-child{animation-delay:.35s}
.evolve-bonus-v2{position:relative;display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:0 2px 16px}.evolve-bonus-v2 span{padding:8px 2px;border:1px solid #9fdce7;border-radius:15px;background:#ffffffb8;text-align:center;color:#355b79;font:700 13px "Rajdhani",sans-serif}.evolve-bonus-v2 b{display:block;color:#8c35c7;font-size:16px}
.evolve-dialog-actions{position:relative;gap:12px!important;margin-top:0!important}.evolve-dialog-actions button{height:55px;border-radius:18px!important;font:700 19px "Rajdhani","Sarabun",sans-serif!important}.evolve-cancel-v2{border:2px solid #9db7c8!important;background:#edf4f8!important;color:#45647a!important}.evolve-confirm-v2{border:2px solid #fff1a4!important;background:linear-gradient(120deg,#8a42ed,#ca4fdd 52%,#f2a328)!important;box-shadow:0 7px 14px #713ba05c!important;color:#fff!important;text-shadow:0 2px #5e2678}
@keyframes evolve-flow-spark{0%,100%{opacity:.35;transform:scale(.75) rotate(0)}50%{opacity:1;transform:scale(1.2) rotate(45deg)}}
@media(max-width:430px){.evolve-dialog-v2{padding:26px 19px 20px!important}.evolve-preview-v2{height:185px;grid-template-columns:1fr 48px 1.15fr}.evolve-form img{width:112px;height:130px}.evolve-form.after img{width:150px;height:155px}.evolve-flow b{font-size:45px}}
@media(prefers-reduced-motion:reduce){.evolve-flow i{animation:none}}
#app:has(#screen-home.active) #game-pet{width:calc(255px * var(--home-scale));max-width:none}
.home-dock{position:absolute;left:27px;top:1410px;width:733px;height:214px;display:flex;align-items:center;gap:7px;padding:17px 14px 21px;border:3px solid #e5ffff;border-radius:57px;background:linear-gradient(115deg,#b4f5e0aa,#a8d7ffab);box-shadow:inset 0 0 0 5px #fff3,0 0 22px #c0fdffb3;backdrop-filter:blur(6px);z-index:5}
.home-dock-button{position:relative;flex:1;min-width:0;height:170px;padding:0;border:3px solid #fffde1;border-radius:44px;background:linear-gradient(120deg,#e5ffd3ed,#a4e89be0);box-shadow:inset 0 0 0 5px #ffffff45,0 0 9px #dfffffb3;color:#153e48;cursor:pointer;font:600 31px Arial,sans-serif}
.home-dock-button:nth-child(2){background:linear-gradient(115deg,#fff4c5f2,#f7d781ed)}
.home-dock-button:nth-child(3){background:linear-gradient(115deg,#d6efffeb,#9ddbf4e0)}
.home-dock-button:nth-child(4){background:linear-gradient(115deg,#ecddffef,#c5b0eced)}
.home-dock-button::before{content:'';position:absolute;left:14px;top:9px;width:51px;height:13px;border-radius:100%;background:#ffffffa3;transform:rotate(-33deg)}
.home-dock-button .dock-art{position:absolute;left:50%;top:14px;width:110px;height:110px;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 3px 2px #234e4d55)}
.home-dock-button:nth-child(3) .dock-art{width:127px}
.home-dock-button>span{position:absolute;left:0;right:0;bottom:10px;font:inherit;text-align:center}
.home-dock-button:hover{filter:brightness(1.07)}
.home-dock-button:active{filter:brightness(.95)}
.home-menu{position:relative;margin:0 0 0 auto;width:min(570px,62vw);height:100dvh;max-width:none;max-height:none;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;box-sizing:border-box;border:3px solid #d9ffff;border-right:0;border-radius:42px 0 0 42px;padding:40px 28px 54px;background:radial-gradient(circle at 88% 5%,#ffffffb8 0 8%,transparent 27%),radial-gradient(circle at 10% 92%,#80e3c06b,transparent 28%),linear-gradient(150deg,rgba(228,255,252,.97),rgba(178,237,242,.96) 54%,rgba(195,249,229,.97));box-shadow:inset 8px 0 20px #fff9,-13px 0 30px #092f4866;color:#0c2d5c;font-family:Rajdhani,'Sarabun',sans-serif}.home-menu::-webkit-scrollbar{display:none}
.home-menu::before,.home-menu::after{content:'';position:absolute;pointer-events:none;z-index:0;opacity:.22;background:linear-gradient(145deg,#42c89b,#99f3c8);border-radius:100% 0 100% 0}
.home-menu::before{width:130px;height:88px;left:-25px;top:13px;transform:rotate(-18deg)}
.home-menu::after{width:210px;height:145px;right:-70px;bottom:18px;transform:rotate(28deg)}
.home-menu::backdrop{background:rgba(4,24,39,.67);backdrop-filter:brightness(.62) blur(1px)}
.home-menu-heading,.home-menu-group,.home-menu-close,.home-menu-leaf{position:relative;z-index:1}
.home-menu-heading{padding:8px 70px 24px;text-align:center}.home-menu-heading h2{margin:0;color:#0d2e59;font-size:54px;line-height:1;font-weight:800;letter-spacing:2px;text-shadow:0 2px 0 #fff}
.home-menu-flourish{height:28px;display:flex;align-items:center;justify-content:center;gap:11px;color:#34b9bd}.home-menu-flourish i{display:block;width:90px;height:2px;background:linear-gradient(90deg,transparent,#43bfc1)}.home-menu-flourish i:last-child{transform:scaleX(-1)}.home-menu-flourish span{font-size:13px;transform:rotate(45deg)}
.home-menu .home-menu-close{position:absolute;z-index:3;right:20px;top:21px;width:64px;height:64px;margin:0;padding:0;border:3px solid #c8ffff;border-radius:50%;background:linear-gradient(145deg,#2bb4d8,#17698f);box-shadow:inset 0 0 10px #bfffffba,0 4px 10px #07547766;color:#fff;font:700 54px/54px Arial,sans-serif;text-shadow:0 2px 2px #075170}
.home-menu-group{margin-top:6px}.home-menu-group h3{height:32px;margin:0 10px 13px;display:flex;align-items:center;gap:14px;color:#0f3766;font-size:25px;letter-spacing:4px}.home-menu-group h3 i{height:2px;flex:1;background:linear-gradient(90deg,#3cabb5,#3cabb544);position:relative}.home-menu-group h3 i::after{content:'';position:absolute;right:-2px;top:-4px;width:10px;height:10px;border-radius:50%;background:#4bbac3;border:2px solid #e9ffff}
.home-menu .home-menu-card{position:relative;width:100%;min-height:116px;margin:0 0 14px;padding:13px 54px 13px 126px;display:flex;align-items:center;border:2px solid #efffff;border-radius:28px;background:linear-gradient(115deg,rgba(248,255,255,.88),rgba(204,245,249,.76));box-shadow:inset 0 0 17px #fff,0 4px 8px #2788a333;color:#0c2d5c;text-align:left;cursor:pointer}.home-menu .home-menu-card::before{content:'';position:absolute;left:13px;right:13px;top:8px;height:28px;border-radius:18px;background:linear-gradient(#fff8,transparent);pointer-events:none}.home-menu .home-menu-card:hover{filter:brightness(1.05);transform:translateX(-2px)}.home-menu .home-menu-card:active{filter:brightness(.97);transform:translateX(0)}
.home-menu-card>img{position:absolute;left:18px;top:50%;width:96px;height:96px;transform:translateY(-50%);object-fit:contain;filter:drop-shadow(0 4px 3px #17476a35)}.home-menu-card[data-menu="pvp"]>img{width:104px;height:104px;left:14px}.home-menu-card>span{display:block;min-width:0}.home-menu-card b{display:block;font:700 34px/1 Rajdhani,'Sarabun',sans-serif}.home-menu-card small{display:block;margin-top:8px;color:#3a6f98;font:500 23px/1.1 Rajdhani,'Sarabun',sans-serif;white-space:nowrap}.home-menu-card em{position:absolute;right:18px;top:50%;transform:translateY(-54%);color:#f4a313;font:700 67px/1 Arial,sans-serif;text-shadow:0 2px 0 #9b6100}
.home-menu-preferences{margin-top:25px}.home-menu-leaf{position:relative;height:170px;margin-top:10px}.home-menu-leaf::before{content:'';position:absolute;left:50%;top:18px;width:125px;height:165px;transform:translateX(-50%) rotate(28deg);border-radius:100% 0 100% 0;background:linear-gradient(145deg,#27b99b21,#1486a92c);box-shadow:inset -12px -12px 20px #fff2}.home-menu-leaf::after{content:'';position:absolute;left:51%;top:51px;width:3px;height:112px;transform:rotate(28deg);transform-origin:top;background:#168fa329;border-radius:4px}
@media(max-width:620px){.home-menu{width:min(390px,max(270px,64vw));padding:26px 14px 38px;border-radius:30px 0 0 30px}.home-menu-heading{padding:10px 55px 19px}.home-menu-heading h2{font-size:39px}.home-menu .home-menu-close{width:52px;height:52px;right:12px;top:15px;font-size:42px;line-height:42px}.home-menu-group h3{font-size:18px;letter-spacing:3px}.home-menu .home-menu-card{min-height:88px;padding:9px 37px 9px 84px;border-radius:21px}.home-menu-card>img{left:9px;width:69px;height:69px}.home-menu-card[data-menu="pvp"]>img{left:5px;width:77px;height:77px}.home-menu-card b{font-size:25px}.home-menu-card small{margin-top:5px;font-size:15px;white-space:normal}.home-menu-card em{right:9px;font-size:49px}.home-menu-preferences{margin-top:16px}.home-menu-leaf{height:84px}.home-menu-leaf::before{width:80px;height:105px;top:3px}.home-menu-leaf::after{top:23px;height:75px}}
.home-menu-toggle:focus-visible,.home-dock-button:focus-visible,.home-menu button:focus-visible,.exp-wrap:focus-visible,.home-details summary:focus-visible{outline:3px solid #ffb51f;outline-offset:3px}
.home-steps{background:linear-gradient(#e8ffff,#c3eeee);border:2px solid white;color:#164764}
.home-steps .home-step-row{display:grid;grid-template-columns:1fr auto;gap:7px;margin:14px 0}
.home-step-row .bar{grid-column:1/-1;height:12px}
.home-step-row .bar-fill{height:100%;background:linear-gradient(90deg,#ffc947,#ff9f12)}
.home-steps .btn-primary{background:linear-gradient(#ffc947,#ffb11b);color:#563806;box-shadow:none}
@media(prefers-reduced-motion:reduce){#screen-home *,#app:has(#screen-home.active) #game-pet{animation:none!important;transition:none!important}}
/* Home pet tap menu (petmenu.js) — frame art from Desktop/egg/ui/monster-menu-assets. */
.pet-menu{position:fixed;z-index:40;box-sizing:border-box;width:240px;height:145px;padding:19px 22px 22px 34px;background:url('assets/home/petmenu/menu-frame.png') center/100% 100% no-repeat;display:flex;flex-direction:column;color:#104e5e;font-family:Rajdhani,Sarabun,sans-serif;filter:drop-shadow(0 4px 8px #0b3d5a55);animation:pet-menu-in .16s ease-out}
.pet-menu[hidden]{display:none}
.pet-menu button{flex:1;display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:3px 4px;border:0;background:transparent;color:inherit;font:700 15px/1.25 Rajdhani,Sarabun,sans-serif;text-align:left;cursor:pointer;border-radius:8px}
.pet-menu button+button{border-top:1px solid #d8cea3;border-top-left-radius:0;border-top-right-radius:0}
.pet-menu button:hover{background:#d9f1e780}
.pet-menu button:focus-visible{outline:2px solid #198d9e;outline-offset:1px}
.pet-menu img{width:28px;height:28px;flex:none}
@keyframes pet-menu-in{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
.pet-say{position:fixed;z-index:39;max-width:240px;padding:10px 14px;border:2px solid #e9d68c;border-radius:18px;background:linear-gradient(#fffdf2,#e8fbf3);color:#104e5e;font:700 15px/1.35 Rajdhani,Sarabun,sans-serif;text-align:center;box-shadow:0 4px 10px #0b3d5a44;animation:pet-menu-in .16s ease-out}
.pet-say[hidden]{display:none}
.pet-say::after{content:'';position:absolute;left:50%;bottom:-9px;width:14px;height:14px;margin-left:-7px;background:#e8fbf3;border-right:2px solid #e9d68c;border-bottom:2px solid #e9d68c;transform:rotate(45deg)}
.pet-say-heart{position:absolute;right:-18px;top:-30px;width:52px;height:52px;animation:pet-heart 1.6s ease-out forwards}
@keyframes pet-heart{0%{opacity:0;transform:translateY(8px) scale(.6)}20%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:.9;transform:translateY(-10px) scale(1)}}
@media(prefers-reduced-motion:reduce){.pet-menu,.pet-say,.pet-say-heart{animation:none}}
/* Menu on the pet's left: mirror only the frame (tail points right), keep the buttons readable. */
.pet-menu.left{background:none}
.pet-menu.left::before{content:'';position:absolute;inset:0;z-index:-1;background:url('assets/home/petmenu/menu-frame.png') center/100% 100% no-repeat;transform:scaleX(-1)}
.pet-menu.left{padding:19px 34px 22px 22px}
/* Pet contact shadow on Home: the base rule (game.css #pet-layer::before) places and sizes it in
   screen px from the layer's centre, but the pet itself scales with --home-scale, so on a narrow
   phone the shadow dropped below the pet ("floating egg", user 2026-10-09) and on a wide one it
   crept up. Here it hangs from the layer's bottom edge and every length scales with the stage:
   209 x 40 stage px, raised by 10% of the pet's height (25.5 stage px x pet scale; user 2026-10-09)
   so it sits under the body, not under the bottom edge of the art. */
#app:has(#screen-home.active) #pet-layer::before{top:auto;bottom:0;width:calc(209px * var(--home-scale));height:calc(40px * var(--home-scale));
  transform:translate(calc(-50% + var(--pet-x,0px) + var(--shadow-dx,0px) * var(--pet-flip,1) * var(--home-scale)),calc((var(--pet-y,0px) + 8px - 25.5px * var(--pet-scale,1) + var(--shadow-drop,0px)) * var(--home-scale))) scale(calc(var(--pet-scale,1) * var(--shadow-scale,1)))}
/* The pet's own drop shadow was a fixed 12px down / 16px blur in screen px: under a pet drawn at
   stage scale that is a detached dark patch below the art, which reads as the pet hovering.
   Scaled with the stage and pulled in close so the art sits on the ground. */
#app:has(#screen-home.active) #pet-layer:not(.evolving) .pet-img{filter:drop-shadow(0 calc(5px * var(--home-scale)) calc(7px * var(--home-scale)) rgba(0,0,0,.3))}
/* Idle animation on Home, every form (egg, form 2, Form 3): the up/down bob read as the pet
   floating above the grass (user 2026-10-09). The pet stays planted and "breathes" instead:
   bottom-anchored, a little taller and narrower at the top of the cycle. Walking is unchanged. */
#app:has(#screen-home.active) #pet-layer:not(.evolving) .float{animation:home-pet-breathe 3.2s ease-in-out infinite}
@keyframes home-pet-breathe{0%,100%{transform:translateY(calc(var(--pet-y,0px) * var(--home-scale))) scale(var(--pet-scale,1))}50%{transform:translateY(calc(var(--pet-y,0px) * var(--home-scale))) scale(calc(var(--pet-scale,1) * .985),calc(var(--pet-scale,1) * 1.03))}}
#app:has(#screen-home.active) #pet-layer:not(.evolving)::before{animation:none;opacity:.82}
/* Player sitting on the hut bed (user 10-16). Sheet = 2 frames of 256x320 side by side, 700 ms each (gender/outfit sheet set by playerSitAsset());
   the seat anchor (142,216) inside a frame lands on the bed at habitat (SEAT_X,SEAT_Y) = (290,598).
   Lives in .pet-region before #pet-layer, so it scales with the habitat and stays behind the pet. */
.home-player{display:none;position:absolute;left:var(--home-left);top:var(--home-top);width:941px;height:1672px;transform:scale(var(--home-scale));transform-origin:top left;pointer-events:none;z-index:0}
#app:has(#screen-home.active) .home-player{display:block}
.home-player i{position:absolute;left:calc(290px - 142px * .9);top:calc(598px - 216px * .9);width:256px;height:320px;transform:scale(.9);transform-origin:top left;background:url('assets/home/player_male_sit_2frames.png') 0 0/512px 320px no-repeat;animation:home-player-sit 1.4s steps(1) infinite}
@keyframes home-player-sit{0%{background-position:0 0}50%{background-position:-256px 0}}
@media(prefers-reduced-motion:reduce){.home-player i{animation:none}}
