@property --home-top{syntax:'<color>';inherits:true;initial-value:#F3E3CF}
@property --home-bot{syntax:'<color>';inherits:true;initial-value:#F3E3CF}
#home{position:fixed;inset:0;z-index:0;display:flex;flex-direction:column;align-items:center;box-sizing:border-box;
  padding:calc(var(--sat) + var(--head-h) + 14px) max(10px,calc((100% - var(--content-max)) / 2 + 10px)) calc(96px + var(--sab) + 6px);background:linear-gradient(var(--home-top,#F3E3CF) 18%,var(--home-bot,#F3E3CF) 86%);transition:--home-top .42s,--home-bot .42s;pointer-events:auto;color:var(--head-bar);overflow:hidden}
#contacts-container{display:none!important}
#main-menu{transition:background-color .3s}

#home-coins{flex:none;display:flex;align-items:flex-end;gap:0;width:calc(100% + 20px);margin:-18px -10px 0;padding:64px calc(50% - 20px) 0;box-sizing:border-box;
  overflow:hidden;touch-action:pan-y;user-select:none;-webkit-user-select:none}
@media (min-width:768px){
  #home-coins{position:relative;top:-8px;width:calc(100% - 28px);margin-left:0;margin-right:0;padding-left:calc(50% - 34px);padding-right:calc(50% - 34px)}
}
.hcoin{flex:none;width:40px;will-change:transform;display:flex;flex-direction:column;align-items:center;gap:1px;padding:0;border:0;background:none;color:var(--head-bar);font-size:11px;font-weight:800;font-variant-numeric:tabular-nums}
.hcoin img{flex:none;width:56px;height:56px;padding:5px;box-sizing:border-box;object-fit:contain;display:block;filter:drop-shadow(0 2px 2px rgba(67,33,31,.35));margin-bottom:-6px;transform:scale(.85);transform-origin:50% 100%;transition:transform .35s cubic-bezier(.22,.61,.36,1)}
.hcoin.on img{transform:translateY(5px) scale(1.25)}
.hcoin span{display:block;line-height:1;transition:transform .35s cubic-bezier(.22,.61,.36,1)}
.hcoin.on span{transform:scale(1.09)}
.hcoin.off img{filter:grayscale(.8) opacity(.55)}
.hcoin.off span{opacity:.55}

#home-exp{position:relative;top:10px;flex:none;display:flex;align-items:center;width:100%;min-height:46px;margin-top:-6px;padding:0 max(18%, 72px);box-sizing:border-box;gap:0}
@media (min-width:768px){#home-exp{top:0;padding-left:14%;padding-right:14%}}
.hhouse{flex:none;width:46px;height:46px;padding:0;border:0;background:none;cursor:pointer}
.hhouse.has-new::after{content:"";position:absolute;z-index:2;top:-2px;right:-2px;width:10px;height:10px;border:2px solid #f2c56c;border-radius:50%;background:#e74737;box-sizing:content-box}
.hhouse img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 2px rgba(67,33,31,.35))}
.hhouse:active img{transform:scale(.92)}
#home-exp .hhouse{position:absolute;top:50%;transform:translateY(-50%)}
@media (min-width:768px){#home-exp .hhouse{top:calc(50% + 10px)}}
#home-exp .hhouse:first-of-type{left:14px}
#home-exp .hhouse:last-of-type{right:14px}
#home-level{position:relative;z-index:1;flex:none;width:34px;height:34px;border-radius:50%;box-sizing:border-box;border:3px solid transparent;background:linear-gradient(var(--head-bar),var(--head-bar)) padding-box,linear-gradient(#ffe3a3,#f2c56c 60%,#C9913D) border-box;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800}
#home-exp .hbar{flex:1;height:11px;margin-left:-6px;border-radius:0 7px 7px 0;background:#fff;overflow:hidden}
#home-exp-fill{display:block;height:100%;width:0;border-radius:0 6px 6px 0;background:var(--head-bg,#1A1816);transition:width .25s}
#home-exp-text{flex:none;margin-left:6px;font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}

#home-total{flex:none;display:flex;align-items:center;gap:8px;margin-top:14px;font-size:20px;font-weight:800;font-variant-numeric:tabular-nums}
#home-total svg{width:30px;height:30px}
#home-total{position:relative;width:100%;justify-content:center;height:0;margin-top:0}
#home-total>svg,#home-total-value{display:none}
#home-total .harrow{position:absolute;top:50%;transform:translateY(calc(-50% - 37px))}
#home-total .horn{position:absolute;top:-44px;width:74px;height:auto;display:block;pointer-events:none}
#home-total .horn.l{left:18%;transform:scaleX(-1)}
#home-total .horn.r{right:18%}
@media (min-width:768px){
  #home-total .horn{top:-56px}
  #home-total .horn.l{left:16%}#home-total .horn.r{right:16%}
}
#home-total .harrow.l{left:13px}
#home-total .harrow.r{right:13px}

#home-stage{position:relative;flex:1;min-height:0;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;touch-action:none;cursor:pointer;clip-path:inset(-24px -10px)}
#home-doll{transform:translateX(var(--sx,0px));max-width:70%;max-height:100%;min-height:0;object-fit:contain;display:block;pointer-events:none;transform-origin:center bottom;filter:drop-shadow(0 6px 8px rgba(67,33,31,.3))}
#home-doll.tap-reaction{animation:doll-spring 580ms ease-in-out,doll-brighten 760ms ease-out}
@keyframes doll-spring{
  0%,100%{scale:1}
  15%{scale:1.036 .95}
  35%{scale:.988 1.017}
  57%{scale:1.004 .994}
  76%{scale:.999 1.002}
}
@keyframes doll-brighten{
  from{filter:brightness(1.06) drop-shadow(0 6px 8px rgba(67,33,31,.3))}
  to{filter:brightness(1) drop-shadow(0 6px 8px rgba(67,33,31,.3))}
}
@media(prefers-reduced-motion:reduce){#home-doll.tap-reaction{animation:none}}
#home-name{position:relative;z-index:3;flex:none;margin-bottom:8px;padding:0 24px;border:0;border-radius:8px;background:none;color:inherit;transform:translateX(var(--sx,0px));font-size:18px;font-weight:800;line-height:1.2;text-align:center}
@media (min-width:768px){#home-name{top:-5px}}
#home-name::after{content:"";position:absolute;right:7px;top:50%;width:7px;height:7px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-70%) rotate(45deg)}
#game-ui .hghost #home-name{pointer-events:none}
#characters-page{color:var(--head-bar)}
.character-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.character-tile{--tile-bg:linear-gradient(var(--tile-top),var(--tile-bottom));position:relative;display:flex;min-width:0;padding:0;border:0;border-radius:14px;background:none;color:var(--head-bar);text-align:center}
.character-tile-face{box-sizing:border-box;display:flex;width:100%;min-width:0;flex-direction:column;align-items:center;justify-content:space-between;gap:6px;padding:10px 5px;border:2px solid rgba(67,33,31,.14);border-radius:inherit;background:var(--tile-bg)}
@media(prefers-reduced-motion:no-preference){
  .character-tile{transform-style:preserve-3d;animation:character-tile-flip .48s ease-in-out calc(var(--tile-delay) * 50ms) both}
  .character-tile-face,.character-tile::before{backface-visibility:hidden}
  .character-tile::before{content:"";position:absolute;inset:0;border:2px solid rgba(67,33,31,.14);border-radius:inherit;background:var(--tile-bg);transform:rotateY(180deg)}
  @keyframes character-tile-flip{from{transform:perspective(600px) rotateY(180deg)}to{transform:perspective(600px) rotateY(0deg)}}
}
.character-tile[aria-current="true"] .character-tile-face{border-color:#ab722b;box-shadow:inset 0 0 0 1px #fff2c4}
.character-tile:focus-visible,#home-name:focus-visible{outline-color:var(--head-bar)}
.character-tile img{width:100%;height:clamp(74px,24vw,112px);object-fit:contain;filter:drop-shadow(0 3px 4px rgba(67,33,31,.25))}
.character-tile.off img{filter:grayscale(.9) brightness(.82)}
.character-tile-name{font-size:13px;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.character-tile-status{font-size:11px;line-height:1.2}
#home-stage.off #home-doll{filter:grayscale(.8) brightness(.8) drop-shadow(0 6px 8px rgba(67,33,31,.3))}
#home-stage .hslots{position:absolute;top:0;bottom:20px;width:74px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9%;pointer-events:none}
#home-stage .hslots.l{left:max(0px,calc((100% - var(--controls-max) + 20px) / 2))}
#home-stage .hslots.r{right:max(0px,calc((100% - var(--controls-max) + 20px) / 2))}
.hghost .hslots{visibility:hidden}
.hghost.ws .hslots{visibility:visible}
.hghost .hslot{transform:translateX(var(--sx,0px));pointer-events:none}
.hslot{position:relative;display:block;transform:translateX(var(--ix,0px));will-change:transform;pointer-events:auto;cursor:pointer;height:14%;max-height:50px;max-width:50px;aspect-ratio:1;border-radius:50%;background:rgba(255,255,255,.3);box-shadow:inset 0 2px 6px rgba(67,33,31,.15)}
.hslot img{position:absolute;left:50%;top:50%;width:205%;height:205%;max-width:none;transform:translate(-50%,-50%);object-fit:contain;display:block;filter:drop-shadow(0 4px 4px rgba(67,33,31,.3))}

#home-bottom{position:relative;flex:none;display:flex;align-items:center;justify-content:center;width:100%;min-height:36px;margin-top:4px}
#home-exp,#home-bottom{max-width:calc(var(--controls-max) - 20px)}
.hboost{position:absolute;left:37px;bottom:-10px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:7px;padding:0;border:0;background:none;color:var(--head-bar);font-size:13px;font-weight:800;font-variant-numeric:tabular-nums}
.hboost img{width:70px;height:54px;object-fit:contain;display:block;transform:translateY(4px);filter:drop-shadow(0 2px 2px rgba(67,33,31,.35))}
.hboost.right{left:auto;right:37px;transform:translateX(50%)}
@media (min-width:768px){
  #home{--home-side-offset:calc((var(--content-max) - 20px) * .34)}
  #home-exp{max-width:calc(var(--controls-max) - 60px)}
  #home-exp .hhouse:first-of-type{left:calc(50% - var(--home-side-offset))}
  #home-exp .hhouse:last-of-type{right:calc(50% - var(--home-side-offset))}
  #home-stage .hslots.l{left:calc(50% - var(--home-side-offset));align-items:flex-start}
  #home-stage .hslots.r{right:calc(50% - var(--home-side-offset));align-items:flex-end}
  #home-bottom .hboost{left:calc(50% - var(--home-side-offset));transform:none}
  #home-bottom .hboost.right{left:auto;right:calc(50% - var(--home-side-offset));transform:none}
  #home-total .harrow{position:fixed;top:50%;z-index:2;transform:translateY(-50%)}
  #home-total .harrow.l{left:calc((100vw - var(--content-max)) / 2 + 23px)}
  #home-total .harrow.r{right:calc((100vw - var(--content-max)) / 2 + 23px)}
}
.hboost:active img{transform:translateY(4px) scale(.92)}
.hboost.off img{filter:grayscale(.8) opacity(.6)}
.hboost.loading{opacity:.6;pointer-events:none}
.harrow{width:48px;height:46px;padding:0;border:0;background:none}
.harrow img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 2px 2px rgba(67,33,31,.35))}
.harrow:active img{transform:scale(.92)}
#home-energy{position:relative;top:-9px;display:flex;align-items:center;gap:6px;height:26px;font-size:15px;font-weight:800;font-variant-numeric:tabular-nums}
@media (min-width:768px){#home-energy{top:5px}}
#home-energy-icon,.henergyfly{width:18px;height:28px}
#home-energy-icon{position:relative;margin:-1px 0}
#home-energy-icon::after{content:"";position:absolute;inset:0;background:url('../assets/icons/energy-empty.svg') center/100% 100% no-repeat;clip-path:inset(0 0 calc(100% - var(--energy-empty,100%)) 0)}
#home-energy-icon::before{content:"";position:absolute;inset:0;background:url('../assets/icons/energy.png?v=2') center/100% 100% no-repeat;clip-path:inset(var(--energy-empty,100%) 0 0)}
#home-energy.empty{animation:pop .3s}
.hkettle{position:fixed;z-index:4;display:block;max-width:none;pointer-events:none;transform:translate(-50%,-50%);filter:drop-shadow(0 4px 4px rgba(67,33,31,.35))}
.hdrop{position:fixed;z-index:4;width:5px;height:8px;border-radius:50% 50% 50% 50% / 35% 35% 65% 65%;background:var(--aqua);pointer-events:none;box-shadow:0 0 2px rgba(255,255,255,.8) inset}

.hfly{position:fixed;z-index:4;display:flex;align-items:center;gap:3px;color:var(--head-bar);font-size:20px;font-weight:800;pointer-events:none;
  text-shadow:0 1px 0 #fff;transform:translate(-50%,-50%);animation:hfly .8s ease-out forwards}
.hfly svg,.hfly img{width:20px;height:20px}
.hfly.small{font-size:14px}
.hfly.small img{width:16px;height:16px}
.hfly.level{font-size:22px;color:var(--head-bar)}
.henergyfly{position:fixed;z-index:5;pointer-events:none;transform:translate(-50%,-50%);color:var(--head-bar);font-size:22px;font-weight:900;line-height:1;font-variant-numeric:tabular-nums;text-shadow:0 1px 0 rgba(255,255,255,.9),0 0 3px rgba(255,255,255,.7)}
.henergyfly img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 1px 2px rgba(67,33,31,.3))}
.henergyfly b{position:absolute;top:0;left:calc(100% + 2px);display:flex;align-items:center;height:100%;font-weight:900;white-space:nowrap}
.hcoinfly{position:fixed;z-index:4;display:flex;flex-direction:column;align-items:center;gap:2px;pointer-events:none;transform:translateX(-50%);transform-origin:center top;color:var(--head-bar);font-size:17px;font-weight:900;line-height:1;text-shadow:0 1px 0 rgba(255,255,255,.9),0 0 3px rgba(255,255,255,.7)}
.hcoinfly svg,.hcoinfly img{width:34px;height:34px;display:block;object-fit:contain;filter:drop-shadow(0 2px 2px rgba(67,33,31,.35))}
.hcoinfly.character-coin{transform:translate(-50%,-50%);transform-origin:center}
.hcoinfly.character-coin b{position:absolute;top:50%;left:100%;margin-left:4px;transform:translateY(-50%);white-space:nowrap;font-size:14px}
.hitemfly{position:fixed;z-index:61;pointer-events:none;transform-origin:50% 50%;filter:drop-shadow(0 6px 8px rgba(67,33,31,.35))}
.hitemfly img{width:100%;height:100%;display:block;object-fit:contain}
.hslot.hit{animation:pop .2s}
@keyframes hfly{to{transform:translate(-50%,-140%);opacity:0}}

#home-lock{position:absolute;inset:0;z-index:2;transform:translateX(var(--sx,0px));display:flex;align-items:center;justify-content:center;background:radial-gradient(closest-side,rgba(67,33,31,.28),rgba(67,33,31,0))}
#home-lock[hidden]{display:none}
.hopen,.hmbtn{padding:11px 34px;border-radius:14px;border:1px solid #a8782c;background:linear-gradient(#ffe3a3,#f2c56c);color:#3a2b0c;font:700 18px Helvetica,Arial,sans-serif;box-shadow:0 4px 10px rgba(67,33,31,.35);cursor:pointer}
.hopen:active,.hmbtn:active{transform:scale(.96)}
.hmbtn[disabled]{opacity:.6}
#home-modal{position:fixed;inset:0;z-index:60;display:flex;animation:hmFade .2s}
.hmcard{position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%;overflow:auto;box-sizing:border-box;padding:calc(var(--sat) + 56px) 20px calc(var(--sab) + 24px);background:#F3E3CF;color:var(--head-bar);
  text-align:center;font-family:Helvetica,Arial,sans-serif;box-shadow:0 10px 30px rgba(0,0,0,.35);animation:hpIn .25s}
.hmclose{position:absolute;top:calc(var(--sat) + 12px);right:14px;width:36px;height:36px;border-radius:50%;border:0;background:rgba(67,33,31,.12);color:var(--head-bar);font-size:22px;line-height:1;cursor:pointer}
.hmdoll{display:block;flex:1;min-height:180px;max-height:52vh;max-width:100%;margin:0 auto 14px;object-fit:contain;filter:drop-shadow(0 6px 8px rgba(67,33,31,.3))}
.hmcard h3{margin:0 0 8px;font-size:24px}
.hmcard p{max-width:380px;margin:0 0 16px;font-size:15px;line-height:1.4;color:#6b4e48}
.hmprice{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 14px;margin-bottom:18px;font-size:18px;color:#8A6E68}
.hmprice span{flex-basis:100%}
.hmprice b{display:inline-flex;align-items:center;gap:5px;font-size:20px;color:var(--head-bar)}
.hmprice svg,.hmprice img{width:22px;height:22px;object-fit:contain}
.hmbtn{width:auto;min-width:200px;flex:none}
.hmerr{margin:-6px 0 10px;font-size:13.5px;color:#C0392B}
.hmerr[hidden]{display:none}
@keyframes hmFade{from{opacity:0}}

/* The same logo palette follows all floral controls, including flying boosts. */
#home-total .horn{filter:url(#character-ink)}
.harrow img,.hhouse img,.hboost img{filter:url(#character-ink) drop-shadow(0 2px 2px rgba(67,33,31,.35))}
.hboost.off img{filter:url(#character-ink) grayscale(.8) opacity(.6)}
#home-energy-icon::before{filter:url(#character-ink)}
.hkettle{filter:url(#character-ink) drop-shadow(0 4px 4px rgba(67,33,31,.35))}
.henergyfly img{filter:url(#character-ink) drop-shadow(0 1px 2px rgba(67,33,31,.3))}
