/* ======================================================================
   🎃 TEMA HALLOWEEN — semua aturan di sini WAJIB diawali html.hw.
   Class itu cuma dipasang js/halloween.js selama musimnya; di luar itu
   berkas ini gak ngefek apa-apa. Isi kartu sengaja tetap terang: ratusan
   warna teks gelap ditulis langsung di JS, kalau kartunya digelapin
   tulisannya hilang.
   ====================================================================== */
html.hw{
  --hw-bg:#21152F; --hw-bg2:#30203F; --hw-card:#3B294B;
  --hw-oranye:#FF8733; --hw-oranye2:#FFB347; --hw-emas:#FFD28A; --hw-ungu:#8754A5;
  --hw-teks:#FFF4E8; --hw-teks2:#C7B5D5;
  --hw-kertas:linear-gradient(170deg,#FFF6EA,#F8E4CC);
  --hw-jaring:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%238754A5' stroke-width='.9' opacity='.5'%3E%3Cpath d='M40 0L0 40M40 0L14 40M40 0L0 14M40 0L28 40M40 0L0 28'/%3E%3Cpath d='M40 9q-5-2-9-9M40 19q-11-3-19-19M40 30q-17-4-30-30'/%3E%3C/svg%3E");
  --hw-labu:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7c.6-2 2-3.6 4-4' stroke='%234e7a35' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='8' cy='14.5' rx='5.6' ry='7' fill='%23e06d1c'/%3E%3Cellipse cx='16' cy='14.5' rx='5.6' ry='7' fill='%23e06d1c'/%3E%3Cellipse cx='12' cy='14.5' rx='5' ry='7.4' fill='%23ff8733'/%3E%3Cpath d='M7.6 13l1.8-2.4 1.8 2.4zM12.8 13l1.8-2.4 1.8 2.4zM8 16.2q4 3.4 8 0l-1.3 1-1.3-.8-1.4 1-1.4-1-1.3.8z' fill='%234a1f05'/%3E%3C/svg%3E");
  --hw-hantu:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 36'%3E%3Cpath d='M16 2C8.5 2 4 7.5 4 15v17l4-3 4 3 4-3 4 3 4-3 4 3V15C28 7.5 23.5 2 16 2z' fill='%23fff8f0' stroke='%23c7b5d5' stroke-width='1.5'/%3E%3Cellipse cx='11.5' cy='15' rx='2' ry='2.6' fill='%233b294b'/%3E%3Cellipse cx='20.5' cy='15' rx='2' ry='2.6' fill='%233b294b'/%3E%3C/svg%3E");
  background:linear-gradient(180deg,#21152F 0%,#30203F 60%,#3a2240 100%);
}

/* ---------- latar & suasana ---------- */
html.hw body{background:
  radial-gradient(70% 40% at 85% 0%, rgba(255,210,138,.16), transparent 70%),
  radial-gradient(90% 50% at 50% 105%, rgba(255,135,51,.18), transparent 70%),
  linear-gradient(180deg,#21152F 0%,#30203F 60%,#3a2240 100%) fixed}
html.hw .blob1{background:#8754A5}
html.hw .blob2{background:#FF8733;opacity:.22}
html.hw .blob3{background:#FFB347;opacity:.14}
html.hw #screen-menu{background:#21152F}
html.hw #screen-profile,html.hw #screen-house{background:transparent}

html.hw .hw{position:fixed;inset:0;pointer-events:none;overflow:hidden}
html.hw .hw *{pointer-events:none}
html.hw .hw-bg{z-index:0}
html.hw .hw-fx{z-index:95}
html.hw .hw-bulan{position:absolute;top:56px;right:18px;width:46px;height:46px;border-radius:50%;
  background:radial-gradient(circle at 36% 36%,#FFF4D8,#FFD28A 70%);
  box-shadow:0 0 30px 10px rgba(255,210,138,.28),0 0 80px 30px rgba(255,210,138,.10);
  -webkit-mask:radial-gradient(circle at 76% 30%,transparent 15px,#000 16px);
          mask:radial-gradient(circle at 76% 30%,transparent 15px,#000 16px);
  animation:hwCahaya 6s ease-in-out infinite}
html.hw .hw-kabut{position:absolute;left:-30%;right:-30%;bottom:0;height:32vh;
  background:radial-gradient(50% 60% at 30% 100%,rgba(199,181,213,.16),transparent 70%),
             radial-gradient(45% 55% at 75% 100%,rgba(199,181,213,.12),transparent 70%);
  animation:hwKabut 22s ease-in-out infinite alternate}
html.hw .hw-siluet{position:absolute;left:0;right:0;bottom:0;height:70px;opacity:.55}
html.hw .hw-siluet svg{width:100%;height:100%}
html.hw .hw-partikel{position:absolute;bottom:-10px;width:4px;height:4px;border-radius:50%;
  background:#FFB347;box-shadow:0 0 6px 2px rgba(255,179,71,.6);opacity:0;
  animation:hwNaik 14s linear infinite}
html.hw .hw-partikel:nth-child(3n){background:#c39be0;box-shadow:0 0 6px 2px rgba(135,84,165,.7);width:3px;height:3px}
html.hw .hw-partikel:nth-child(4n){background:#FFD28A;box-shadow:0 0 7px 2px rgba(255,210,138,.7)}
html.hw .hw-daun{position:absolute;top:-24px;width:12px;height:12px;border-radius:0 80% 0 80%;
  background:linear-gradient(135deg,#FFB347,#d9601a);opacity:.55;animation:hwDaun 16s linear infinite}

/* kelelawar: terbang lewat bagian atas aja, jauh dari tombol */
html.hw .hw-kelelawar{position:absolute;left:0;top:12%;width:34px;opacity:0;
  animation:hwTerbang 18s linear infinite}
html.hw .hw-kelelawar.k1{top:24%;width:26px;animation-duration:23s;animation-direction:reverse}
html.hw .hw-kelelawar.k2{top:7%;width:22px;animation-duration:27s}
html.hw .hw-kelelawar i{display:block;animation:hwKepak .22s ease-in-out infinite alternate}
html.hw .hw-kelelawar.k1 i{transform:scaleX(-1);animation-name:hwKepakBalik}
html.hw .hw-kelelawar svg{display:block;width:100%}
html.hw .hw-hantu{position:absolute;width:28px;opacity:.8;animation:hwMelayang 5s ease-in-out infinite}
html.hw .hw-hantu svg{display:block;width:100%;filter:drop-shadow(0 0 6px rgba(255,244,232,.45))}
html.hw .hw-fx .hw-hantu.h0{left:-4px;top:58%;animation-duration:5.6s}
html.hw .hw-fx .hw-hantu.h1{right:-6px;top:38%;width:22px;opacity:.6;animation-duration:7s;animation-delay:-2s}
html.hw .hw-laba{position:absolute;right:26px;top:0;width:16px;animation:hwTurun 9s ease-in-out infinite}
html.hw .hw-laba::before{content:'';position:absolute;left:50%;bottom:100%;width:1px;height:120px;background:rgba(199,181,213,.55)}
html.hw .hw-laba svg{display:block;width:100%}

/* ---------- beranda: siang jadi malam ---------- */
html.hw .hw-malam{position:absolute;z-index:1;
  background:linear-gradient(180deg,rgba(33,21,47,.78) 0%,rgba(48,32,63,.5) 45%,rgba(40,22,46,.42) 100%)}
html.hw .hw-malam .hw-bulan{top:78px;right:28px}
html.hw .hw-malam .hw-hantu.h2{left:12%;top:24%;width:30px}
html.hw .hw-labu,html.hw .hw-lilin,html.hw .hw-topi,html.hw .hw-permen{position:absolute}
html.hw .hw-labu svg,html.hw .hw-lilin svg,html.hw .hw-topi svg,html.hw .hw-permen svg{display:block;width:100%}
html.hw .hw-labu{width:34px;filter:drop-shadow(0 0 8px rgba(255,135,51,.75));animation:hwLabu 2.8s ease-in-out infinite}
html.hw .hw-malam .hw-labu.l0{left:6%;bottom:9%}
html.hw .hw-malam .hw-labu.l1{right:7%;bottom:12%;width:26px;animation-delay:-1.3s}
html.hw .hw-lilin{width:11px}
html.hw .hw-lilin .api{transform-origin:50% 100%;animation:hwApi .5s ease-in-out infinite alternate}
html.hw .hw-malam .hw-lilin.c0{left:calc(6% + 36px);bottom:9%}
html.hw .hw-malam .hw-lilin.c1{right:calc(7% + 28px);bottom:12%;width:9px}
html.hw .hw-malam .hw-lilin.c1 .api{animation-duration:.43s}
html.hw .hw-malam .hw-topi{left:4%;top:44%;width:30px;transform:rotate(-14deg);opacity:.9}
html.hw .hw-permen{width:12px;transform:rotate(18deg)}
html.hw .hw-malam .hw-permen.p0{left:24%;bottom:6%}
html.hw .hw-malam .hw-permen.p1{right:26%;bottom:5%;transform:rotate(-24deg)}
html.hw .hb-adegan::before{background:radial-gradient(70% 45% at 82% 6%, rgba(255,210,138,.22), transparent 62%),
  radial-gradient(120% 40% at 50% 108%, rgba(255,135,51,.22), transparent 60%)}
html.hw .hb-adegan::after{box-shadow:inset 0 -52px 64px -38px rgba(33,21,47,.6),inset 0 34px 54px -34px rgba(33,21,47,.5),
  inset 26px 0 44px -36px rgba(33,21,47,.5),inset -26px 0 44px -36px rgba(33,21,47,.5)}

/* ---------- header & navigasi ---------- */
html.hw .header{background:linear-gradient(180deg,#30203F,#2a1c38);border-bottom:3px solid #FF8733;
  box-shadow:0 4px 18px rgba(255,135,51,.18)}
html.hw .header::before{content:'';position:absolute;left:0;top:0;width:36px;height:36px;pointer-events:none;
  background:var(--hw-jaring) no-repeat;transform:scaleX(-1);opacity:.9}
html.hw .header-title{color:#FFF4E8;text-shadow:0 2px 0 rgba(0,0,0,.35)}
html.hw .header-title span{color:#FFB347}
html.hw #side-menu-btn{background:rgba(48,32,63,.96)!important;border-color:#FF8733!important;
  box-shadow:0 0 14px rgba(255,135,51,.35)}
html.hw #side-menu-panel{border-color:#5a3a73!important;box-shadow:0 0 0 2px rgba(255,135,51,.4),0 14px 30px rgba(0,0,0,.4)!important}
html.hw .side-menu-item.active{background:#FFE6CC!important;border-color:#FF8733!important;box-shadow:0 3px 0 rgba(200,90,20,.35)}
html.hw .hb-kartu{background:var(--hw-labu) no-repeat right 8px bottom 8px/18px,linear-gradient(178deg,#FFE7CC,#F6C994);
  border-color:#D9853B;box-shadow:0 4px 0 #B8652A,inset 0 2px 0 rgba(255,255,255,.55),0 0 18px rgba(255,135,51,.28)}
html.hw .hb-kartu.paws{background:var(--hw-hantu) no-repeat right 10px center/16px,linear-gradient(178deg,#EBDDF5,#D3BCE6);
  border-color:#9C74BA;box-shadow:0 4px 0 #7E5A9C,inset 0 2px 0 rgba(255,255,255,.6),0 0 18px rgba(135,84,165,.3)}
html.hw .hb-kartu.paws b{color:#4B2D63}
html.hw .hb-kartu.paws small{color:#6E5287}
html.hw .hb-menu{background:linear-gradient(180deg,#8754A5,#6c3f89);border-color:#B48AD0;color:#FFF4E8;
  box-shadow:0 3px 0 #4f2c66,inset 0 2px 0 rgba(255,255,255,.2)}
html.hw .hb-menu svg *{fill:#FFD28A}

/* ---------- kartu, panel, modal ---------- */
html.hw .card{background:var(--hw-jaring) no-repeat right top/44px,var(--hw-kertas)!important;
  border-color:#5a3a73!important;box-shadow:0 5px 0 rgba(59,41,75,.45),0 0 22px rgba(255,135,51,.16)!important}
html.hw .pnl{background:var(--hw-jaring) no-repeat right top/44px,var(--hw-kertas);border-color:#FFD28A}
html.hw .shop-item{background:#FFF6EA!important;border-color:#E9B98A!important}
html.hw .inv-item{background:var(--hw-kertas)!important;border-color:#E9B98A!important}
html.hw .modal-box{background:var(--hw-jaring) no-repeat left top/52px,var(--hw-kertas);
  box-shadow:0 -6px 30px rgba(255,135,51,.25)}
html.hw .modal-box::before{background:#FF8733}
html.hw .card-title::before,html.hw .section-label::before{content:'';display:inline-block;width:15px;height:15px;
  margin-right:5px;vertical-align:-2px;background:var(--hw-labu) no-repeat center/contain}
html.hw .toast{background:rgba(48,32,63,.95);border:1.5px solid #FF8733;color:#FFF4E8}

/* teks yang nempel langsung di latar (bukan di dalam kartu) */
html.hw .pg-h,html.hw .screen>.section-label,html.hw .empty-state-title,html.hw .loading-text{color:#FFF4E8;text-shadow:0 2px 0 rgba(0,0,0,.35)}
html.hw .pg-s,html.hw .empty-state{color:#C7B5D5}

/* ---------- tombol & indikator ---------- */
html.hw .btn-pink{background:linear-gradient(135deg,#FFB347,#FF8733);color:#3a1500}
html.hw .btn-lavender{background:linear-gradient(135deg,#a676c4,#8754A5);color:#FFF4E8}
html.hw .btn-pink,html.hw .btn-lavender,html.hw .btn-peach{box-shadow:0 0 14px rgba(255,135,51,.3)}
html.hw .btn:active{filter:brightness(1.08)}
html.hw .bar-hunger{background:linear-gradient(90deg,#FFB347,#FF8733)}
html.hw .bar-happy{background:linear-gradient(90deg,#b98ad6,#8754A5)}
html.hw .bar-health{background:linear-gradient(90deg,#FFE3AE,#FFD28A)}

/* ---------- layar loading ---------- */
html.hw #cozy-splash{background:
  radial-gradient(circle at 80% 14%, rgba(255,210,138,.28), transparent 30%),
  radial-gradient(circle at 20% 90%, rgba(255,135,51,.22), transparent 40%),
  linear-gradient(165deg,#21152F 0%,#30203F 60%,#3a2240 100%)}
html.hw #cozy-splash h1{color:#FFF4E8;text-shadow:0 2px 0 #1a0f24}
html.hw #cozy-splash h1 span{color:#FF8733}
html.hw #cozy-splash p,html.hw #cozy-splash .sp-load{color:#C7B5D5}
html.hw #cozy-splash .sp-load b{color:#FFB347}
html.hw #cozy-splash .sp-badge{background:linear-gradient(165deg,#FFB347,#e06d1c);border-color:#a8480f;box-shadow:0 7px 0 #7a340a,0 0 30px rgba(255,135,51,.5)}
html.hw #cozy-splash .sp-bfly svg{filter:brightness(.12) saturate(0)}
html.hw .hw-splash-labu{position:absolute;right:16%;bottom:14%;width:44px}

/* ---------- gerak ---------- */
@keyframes hwCahaya{0%,100%{opacity:.85}50%{opacity:1}}
@keyframes hwKabut{from{transform:translateX(-6%)}to{transform:translateX(6%)}}
@keyframes hwNaik{0%{transform:translate(0,0);opacity:0}10%{opacity:.8}50%{transform:translate(14px,-50vh)}90%{opacity:.6}100%{transform:translate(-8px,-100vh);opacity:0}}
@keyframes hwDaun{0%{transform:translate(0,0) rotate(0)}50%{transform:translate(30px,55vh) rotate(200deg)}100%{transform:translate(-10px,110vh) rotate(400deg)}}
@keyframes hwTerbang{0%{transform:translate(-50px,0);opacity:0}3%{opacity:.85}25%{transform:translate(30vw,-18px)}50%{transform:translate(60vw,10px)}72%{transform:translate(105vw,-10px);opacity:.85}73%,100%{transform:translate(110vw,0);opacity:0}}
@keyframes hwKepak{from{transform:scaleY(1)}to{transform:scaleY(.45)}}
@keyframes hwKepakBalik{from{transform:scale(-1,1)}to{transform:scale(-1,.45)}}
@keyframes hwMelayang{0%,100%{transform:translate(0,0) rotate(-4deg)}50%{transform:translate(6px,-12px) rotate(4deg)}}
@keyframes hwTurun{0%,100%{transform:translateY(-40px)}45%,60%{transform:translateY(18px)}}
@keyframes hwLabu{0%,100%{filter:drop-shadow(0 0 4px rgba(255,135,51,.5))}50%{filter:drop-shadow(0 0 11px rgba(255,135,51,.95))}}
@keyframes hwApi{from{transform:scale(1,1) rotate(-3deg);opacity:.85}to{transform:scale(.88,1.1) rotate(3deg);opacity:1}}

@media (prefers-reduced-motion:reduce){
  html.hw .hw *,html.hw .hw,html.hw .hw-splash-labu{animation:none!important}
  html.hw .hw-kelelawar,html.hw .hw-partikel,html.hw .hw-daun{display:none}
}

/* ---------- peta & ruangan: malam Halloween ----------
   faseWaktuRumah() dipaksa 'malam' selama musim (js/05), jadi jendela rumah
   & lampu udah nyala sendiri; di sini tinggal warnanya dibikin ungu-oranye. */
html.hw #peta-overlay{background:#2a2038}
html.hw #peta-langit{background:
  radial-gradient(60% 40% at 80% 0%, rgba(255,210,138,.18), transparent 70%),
  linear-gradient(180deg,rgba(26,14,40,.66),rgba(48,22,62,.52) 70%,rgba(120,50,40,.4))!important}
html.hw #peta-overlay .hw-fx{position:absolute;z-index:8}
html.hw #peta-overlay .hw-fx .hw-bulan{top:calc(70px + env(safe-area-inset-top))}
html.hw #peta-top{background:linear-gradient(180deg,rgba(33,21,47,.9),rgba(33,21,47,0))}
html.hw .rm-waktu{background:linear-gradient(180deg,rgba(33,21,47,.42),rgba(70,35,80,.22) 70%,rgba(255,135,51,.12))!important}
