:root {
  /* Susun atur: HUD melekat di atas, satu lajur telefon, empat tab di bawah (Rumah, Peta, Beg, Profil). Tempat seperti Perpustakaan dan Kebun hidup di dalam Peta. */
  --bg: #edf0f6;
  --surface: #ffffff;
  --ink: #1c2333;
  --ink-2: #566074;
  --line: #d8dde8;
  --track: #e3e7ef;
  --aksen: #2b7a68;
  --on-aksen: #ffffff;
  --amaran: #b86a14;
  --lampu: #f2b84b;
  --tirai: rgba(14, 18, 30, 0.55);
  --kayu: #a8744f;
  --kain: #6fa8a0;
  --kain2: #c98a6a;
  --daun: #58a367;
  --daun-gelap: #2f7a43;
  --tanah: #8a6a4e;
  --tanah-gelap: #6a4f39;
  --merah: #d9374f;
  --tomato: #d9452f;
  --layu: #a68a5b;
  --display: 'Young Serif', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141d;
    --surface: #1a1f2e;
    --ink: #e8ebf3;
    --ink-2: #9aa3b8;
    --line: #2a3148;
    --track: #262d42;
    --aksen: #5cc0a6;
    --on-aksen: #0b1f19;
    --amaran: #e2a455;
    --tirai: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11141d;
  --surface: #1a1f2e;
  --ink: #e8ebf3;
  --ink-2: #9aa3b8;
  --line: #2a3148;
  --track: #262d42;
  --aksen: #5cc0a6;
  --on-aksen: #0b1f19;
  --amaran: #e2a455;
  --tirai: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--aksen); outline-offset: 2px; }

.hud { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 16px; }
.hud-dalam { max-width: 520px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px; }
.pil {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pil .titik { width: 8px; height: 8px; border-radius: 50%; background: var(--aksen); }
.pil .titik.biasa { background: var(--ink-2); }
.pil .titik.penat { background: var(--amaran); }

main { max-width: 520px; margin: 0 auto; padding: 8px 16px 140px; display: flex; flex-direction: column; gap: 16px; }
.view { display: flex; flex-direction: column; gap: 16px; }

.kepala { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.salam { color: var(--ink-2); font-size: 14px; }
h1 { font-size: 30px; line-height: 1.1; }
.lencana {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  background: var(--surface); white-space: nowrap; font-variant-numeric: tabular-nums;
}

.scene {
  --langit: #bcdcf2; --benda: #f6d65a; --bumbung: #8c5a3c;
  --dinding: #f3e6cf; --teks-bilik: #3a2c20; --tanah: #7fae78;
  position: relative; overflow: hidden; border-radius: 20px;
  background: var(--langit); aspect-ratio: 1 / 1;
}
.scene[data-masa="petang"] {
  --langit: #f0b98a; --benda: #f08a3c; --bumbung: #7a4a36;
  --dinding: #f0d3ae; --teks-bilik: #3a2418; --tanah: #6d9a63;
}
.scene[data-masa="malam"] {
  --langit: #1d2342; --benda: #e9edf7; --bumbung: #3b2b2f;
  --dinding: #f3e6cf; --teks-bilik: #3a2c20; --tanah: #2f4a3d;
}
.benda { position: absolute; top: 18px; right: 22px; width: 34px; height: 34px; border-radius: 50%; background: var(--benda); }
.scene[data-cuaca="mendung"] .benda, .scene[data-cuaca="hujan"] .benda { opacity: 0.35; }
.lapis { position: absolute; inset: 0; pointer-events: none; }
.scene[data-cuaca="mendung"] .lapis { background: rgba(92, 104, 120, 0.38); }
.scene[data-cuaca="hujan"] .lapis { background: rgba(66, 82, 104, 0.5); }
.scene[data-cuaca="hujan"] .lapis::after {
  content: ""; position: absolute; inset: 0; background-size: 60px 60px;
  background-image: repeating-linear-gradient(100deg, transparent 0 10px, rgba(255, 255, 255, 0.4) 10px 11px);
}
@keyframes hujan { to { background-position: -20px 60px; } }
@media (prefers-reduced-motion: no-preference) {
  .scene[data-cuaca="hujan"] .lapis::after { animation: hujan 0.8s linear infinite; }
}
.rumah-svg { position: absolute; inset: 0; }
.rumah-svg svg { display: block; width: 100%; height: 100%; }
.bilik { position: absolute; border: 0; padding: 0; background: transparent; border-radius: 6px; text-align: left; cursor: pointer; }
.bilik .etiket { position: absolute; top: 3px; left: 6px; font-size: 12px; font-weight: 600; line-height: 1.35; padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: #3a2c20; }
.bilik[aria-pressed="true"] { outline: 3px solid var(--lampu); outline-offset: -3px; }
.bilik[aria-pressed="true"] .etiket { background: var(--lampu); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.watak { position: absolute; transform: translate(-50%, -100%); pointer-events: none; transition: left 0.9s ease, top 0.9s ease; }
.watak-awak { width: 24px; }
.watak-kucing { width: 32px; }
.watak svg { display: block; width: 100%; height: auto; }
.bayang { fill: #000; opacity: 0.18; } .kaki { fill: #4a5568; } .baju { fill: var(--aksen); }
.kulit { fill: #f0c9a0; } .rambut { fill: #3a2c20; } .mata-w { fill: #2a2118; }
.senyum { fill: none; stroke: #2a2118; stroke-width: 1; stroke-linecap: round; }
.rm-bukit { fill: #8fc07a; } .rm-bukit2 { fill: #82b66f; } .rm-tanah { fill: var(--tanah); }
.rm-bumbung { fill: var(--bumbung); } .rm-gelap { fill: #000; opacity: 0.18; } .rm-siling { fill: #000; opacity: 0.1; }
.dinding-k { fill: var(--dinding); } .lantai-k { fill: #c9a074; } .lantai-dapur { fill: #dfe6df; }
.kain-g { fill: #4f8a82; } .kain2b { fill: #b27456; } .kayu-g { fill: #8f5f3e; }
.kulkas { fill: #e9eef2; stroke: #b8c2cc; stroke-width: 1.5; } .tali-k { fill: #8f9aa8; }
.rm-garis { stroke: #000; stroke-opacity: 0.2; stroke-width: 1.5; fill: none; }
.sinar { fill: #fff; opacity: 0.2; } .malam-lapis { fill: #10142b; opacity: 0.55; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-size: 20px; }
.panel p { color: var(--ink-2); }
.utama {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--aksen); color: var(--on-aksen); font-weight: 600; cursor: pointer;
}
.utama:active { transform: scale(0.98); }
.kedua {
  min-height: 44px; padding: 0 20px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--ink); font-weight: 500; cursor: pointer;
}
.kecil { min-height: 36px; padding: 0 12px; font-size: 14px; }
.baris-btn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.balik {
  align-self: flex-start; min-height: 40px; padding: 0 12px 0 4px; border: 0; background: transparent;
  color: var(--aksen); font-weight: 600; cursor: pointer;
}
.status { min-height: 1.55em; font-size: 14px; color: var(--ink); }

.baris { display: flex; justify-content: space-between; align-items: baseline; font-weight: 500; }
.baris strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--aksen); border-radius: 999px; transition: width 0.4s ease; }
.bar.rendah { background: var(--amaran); }
.ket { font-size: 13px; color: var(--ink-2); }
.penanda { font-size: 12px; font-weight: 600; color: var(--aksen); }
.amaran { color: var(--amaran); font-weight: 600; }

.kepala-bahagian { display: flex; flex-direction: column; gap: 2px; }
.kepala-bahagian h2 { font-size: 24px; }

.tiada ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tiada li { color: var(--ink); font-size: 15px; }

.peta-bingkai { position: relative; aspect-ratio: 360 / 560; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #a8d38a; }
.peta-svg, .peta-svg svg { display: block; width: 100%; height: 100%; }
.pin {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center;
  min-height: 44px; padding: 4px 12px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.pin .pn { font-size: 13px; font-weight: 600; line-height: 1.25; }
.pin .ps { font-size: 11px; font-weight: 500; color: var(--ink-2); line-height: 1.25; }
.pin .baru { position: absolute; top: -16px; right: 8px; font-size: 11px; font-weight: 600; color: var(--on-aksen); background: var(--aksen); border-radius: 999px; padding: 1px 8px; }
.pin.kunci { border-style: dashed; color: var(--ink-2); }
.pin.kunci .pn { display: flex; align-items: center; gap: 5px; }
.pin .gembok { width: 11px; height: 11px; }
.pm-rumput { fill: #a8d38a; } .pm-rumput2 { fill: #9ccb7e; } .pm-laman { fill: #b6dc9a; }
.pm-pagar { fill: none; stroke: #b08a5e; stroke-width: 3; stroke-dasharray: 2 5; stroke-linecap: round; }
.pm-pasir { fill: #f0dfb0; } .pm-laut { fill: #7fc4d8; }
.pm-ombak { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: 0.8; }
.pm-payung { fill: #e0583a; } .pm-payung-t { stroke: #8c5a3c; stroke-width: 2; }
.pm-tepi { fill: #d8c8a2; } .pm-jalan { fill: #eadfc4; }
.pm-garis { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 7 7; opacity: 0.9; }
.pm-dinding { fill: #8c5a3c; } .pm-lantai1 { fill: #ecd3ae; } .pm-lantai2 { fill: #e6c79c; } .pm-lantai3 { fill: #dfe6df; }
.pm-kain { fill: #6fa8a0; } .pm-bantal { fill: #f6efe2; } .pm-kayu { fill: #a8744f; }
.pm-kain2 { fill: #c98a6a; } .pm-kain2b { fill: #b27456; } .pm-cerek { fill: #8f9aa8; }
.pm-meja { fill: #c9a074; } .pm-cawan { fill: #f6efe2; } .pm-tingkap { fill: #bfe3f2; }
.pm-sorot { fill: none; stroke: #f2b84b; stroke-width: 3; }
.pm-awak { fill: #2b7a68; stroke: #fff; stroke-width: 2.5; } .pm-kucing { fill: #d99a5b; }
.pm-tanah { fill: #8a6a4e; } .pm-biji { fill: #c9a36a; } .pm-daun { fill: #58a367; } .pm-daun2 { fill: #3f8f55; }
.pm-bunga { fill: #d9374f; } .pm-kuning { fill: #f2b84b; } .pm-tomato { fill: #d9452f; } .pm-layu { fill: #a68a5b; }
.pm-bumbung-p { fill: #3d7f7a; } .pm-rabung { stroke: #2c635f; stroke-width: 3; fill: none; } .pm-cahaya-p { fill: #9fd6cf; }
.pm-bumbung-j { fill: #6b86a8; } .pm-aw1 { fill: #d9564a; } .pm-aw2 { fill: #f6efe2; }
.pm-pk { fill: #5fae6a; } .pm-pk2 { fill: #3f8f55; } .pm-pk3 { fill: #86c98f; }
.pm-peti { fill: #d9564a; } .pm-lampu { fill: #f2b84b; } .pm-cahaya { fill: #f2b84b; opacity: 0.35; }
.pm-kabus { fill: #eef3f0; opacity: 0.72; stroke: #8fa39c; stroke-width: 2; stroke-dasharray: 6 5; }
.pm-malam { fill: #1d2342; opacity: 0.42; } .pm-petang { fill: #f08a3c; opacity: 0.14; }
.pm-mendung { fill: #5c6878; opacity: 0.22; } .pm-hujan { fill: #425268; opacity: 0.32; }

#n-senarai { display: flex; flex-direction: column; gap: 8px; }
.bab-baris {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  min-height: 56px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); cursor: pointer;
}
.bab-baris .tajuk-bab { display: flex; flex-direction: column; min-width: 0; }
.bab-baris .no { font-size: 12px; color: var(--ink-2); }
.bab-baris .nama-bab { font-weight: 500; }
.bab-baris .lencana-bab { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.bab-baris.baru-bab .lencana-bab { color: var(--aksen); }
.bab-baris.kunci { border-style: dashed; background: transparent; color: var(--ink-2); }

.kertas { gap: 14px; }
.kertas h2 { font-size: 26px; }
.kertas .isi { display: flex; flex-direction: column; gap: 14px; }
.kertas .isi p { color: var(--ink); font-size: 17px; line-height: 1.8; }

.senarai-kad { display: flex; flex-direction: column; gap: 12px; }
.senarai-kad h2 { font-size: 19px; }
.pangkat { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pangkat .jumlah { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dipasang { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.dipasang li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dipasang li:first-child { border-top: 0; }
.dipasang .tempat { color: var(--ink-2); }

.stat { margin: 0; display: flex; flex-direction: column; }
.stat div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.stat div:first-child { border-top: 0; }
.stat dt { color: var(--ink-2); font-size: 14px; }
.stat dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

#sejarah { display: flex; flex-direction: column; gap: 12px; }
.rekod { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.rekod .atas { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rekod .versi { font-weight: 600; color: var(--aksen); }
.rekod h3 { font-size: 17px; }
.rekod ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.rekod .migrasi { font-size: 12px; color: var(--ink-2); }
.kosong { color: var(--ink-2); font-size: 14px; border: 1px dashed var(--line); border-radius: 16px; padding: 14px 16px; }
footer p { font-size: 12px; color: var(--ink-2); text-align: center; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px 10px; }
.nav-dalam { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 6px 2px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer;
}
.tab svg.ikon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--aksen); background: var(--track); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 80px; z-index: 7; max-width: 400px; margin: 0 auto;
  padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.toast.tampak { opacity: 1; }

.tirai { position: fixed; inset: 0; z-index: 20; background: var(--tirai); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal {
  position: relative; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.tutup {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal .label { font-size: 12px; font-weight: 600; color: var(--aksen); padding-right: 48px; }
.ilus { background: var(--track); border-radius: 16px; padding: 8px; }
.ilus svg { display: block; width: 100%; height: 110px; }
.g1 { fill: var(--ink-2); } .g2 { fill: var(--aksen); } .g3 { fill: var(--lampu); } .gs { fill: var(--surface); }
.t1 { stroke: var(--ink-2); } .t2 { stroke: var(--aksen); }
.modal h2 { font-size: 24px; }
.modal .cerita { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.modal .cta {
  min-height: 52px; border: 0; border-radius: 16px; background: var(--aksen); color: var(--on-aksen);
  font-weight: 600; font-size: 17px; cursor: pointer;
}
.modal .nanti { align-self: center; min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: var(--ink-2); font-weight: 500; cursor: pointer; }

.mood { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--track); color: var(--ink-2); }
.tenaga-blok { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg); border-radius: 12px; }
.hari-ini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hari-ini li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line); }
.hari-ini li:first-child { border-top: 0; }
.hari-ini .teks { flex: 1; font-size: 15px; line-height: 1.4; }
.hari-ini li.siap .teks { color: var(--ink-2); }
.semak { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; }
.semak.siap { background: var(--aksen); border-color: var(--aksen); color: var(--on-aksen); }
.semak svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.petak-ilus { background: var(--track); border-radius: 12px; overflow: hidden; }
.petak-ilus svg { display: block; width: 100%; height: 150px; }
.petak-isi { display: flex; flex-direction: column; gap: 10px; }
.pangkat { align-items: center; }
.nama-item { display: flex; align-items: center; gap: 10px; }
.ikon-item svg { display: block; width: 44px; height: 44px; }

.lantai { stroke: var(--teks-bilik); stroke-opacity: 0.3; stroke-width: 2; fill: none; }
.kayu { fill: var(--kayu); } .kain { fill: var(--kain); } .kain2 { fill: var(--kain2); }
.bantal { fill: #f6efe2; } .lampu-s { fill: var(--lampu); } .cahaya { fill: var(--lampu); opacity: 0.28; }
.tingkap { fill: var(--kayu); } .langit-s { fill: var(--langit); } .benda-s { fill: var(--benda); } .awan { fill: #dfe4ec; }
.bingkai-t { stroke: var(--kayu); stroke-width: 3; fill: none; }
.cerek { fill: #8f9aa8; } .cerek-l { stroke: #8f9aa8; stroke-width: 3; fill: none; stroke-linecap: round; } .cawan { fill: #f6efe2; }
.wap { stroke: var(--teks-bilik); stroke-opacity: 0.4; stroke-width: 2; fill: none; stroke-linecap: round; }
.tn1 { fill: var(--tanah-gelap); } .tn2 { fill: var(--tanah); }
.dn { fill: var(--daun); } .dn.lyu2 { fill: var(--layu); }
.btg { fill: none; stroke: var(--daun-gelap); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.btg.lyu { stroke: var(--layu); }
.biji { fill: #c9a36a; } .pt { fill: var(--merah); } .kn { fill: var(--lampu); }
.bt { stroke: var(--lampu); stroke-width: 2; stroke-linecap: round; fill: none; }
.tm { fill: var(--tomato); } .tg { fill: var(--daun); } .kilat { fill: #fff; opacity: 0.6; }
.kayu-t { stroke: var(--kayu); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.lyu3 { fill: #8a5a4a; }
.tumbuh.haus { filter: saturate(0.55); }
.titis line { stroke: #6aa6d8; stroke-width: 2; stroke-linecap: round; }
.siram-g circle { fill: #6aa6d8; }
.kb { fill: #d99a5b; } .ekor { fill: none; stroke: #d99a5b; stroke-width: 5; stroke-linecap: round; }
.ks { fill: none; stroke: #8a5a34; stroke-width: 1.8; stroke-linecap: round; }
.mata { fill: #2a2118; } .mk { fill: none; stroke: #2a2118; stroke-width: 1.5; stroke-linecap: round; }
.hd { fill: #d9707f; } .kp { fill: #f1cf9f; }
.pasu { fill: #b5673f; } .tgl { fill: #e0583a; } .kayu-r { fill: var(--kayu); }
.tali { stroke: #6b3b2a; stroke-width: 1.5; fill: none; stroke-linecap: round; }
.bingkai { fill: var(--kayu); } .kertas-s { fill: #f6efe2; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes goyang { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
@keyframes muncul { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ekor { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes kelip { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes jatuh { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes naik { 0% { transform: translateY(4px); opacity: 0; } 40% { opacity: 0.7; } 100% { transform: translateY(-6px); opacity: 0; } }
@keyframes titik { 0% { transform: translateY(-12px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .watak-awak svg { animation: bob 2.4s ease-in-out infinite; }
  .tumbuh { animation: goyang 5s ease-in-out infinite; transform-origin: 60px 96px; }
  .muncul { animation: muncul 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transform-origin: 60px 96px; }
  .ekor { animation: ekor 2.6s ease-in-out infinite; transform-origin: 34px 36px; }
  .mata { animation: kelip 5s infinite; transform-box: fill-box; transform-origin: center; }
  .titis line { animation: jatuh 0.9s linear infinite; }
  .wap { animation: naik 2.6s ease-in infinite; }
  .wap.w2 { animation-delay: 0.9s; }
  .siram-g circle { animation: titik 1s ease-in forwards; }
}

@media (prefers-reduced-motion: reduce) {
  .watak { transition: none; }
  .bar, .toast { transition: none; }
  .utama:active { transform: none; }
}

/* ---- Skrin log masuk (Teratak) ---- */
[hidden] { display: none !important; }
.masuk { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.masuk-kad { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.masuk-kad h1 { font-size: 30px; text-align: center; }
.masuk-kad .ket { text-align: center; margin: 0; }
.masuk-logo { display: flex; justify-content: center; }
.masuk-logo svg { width: 72px; height: 63px; }
.masuk-logo .bm1 { fill: var(--kain2); }
.masuk-logo .bm2 { fill: var(--surface); stroke: var(--kayu); stroke-width: 2; }
.masuk-logo .bm3 { fill: var(--kayu); }
.masuk-logo .bm4 { fill: var(--lampu); }
.tab-masuk { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--track); border-radius: 12px; padding: 4px; }
.tab-masuk button { border: 0; background: transparent; color: var(--ink-2); padding: 9px 8px; border-radius: 9px; cursor: pointer; font-weight: 500; }
.tab-masuk button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
#borang-masuk { display: flex; flex-direction: column; gap: 12px; }
#borang-masuk label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
#borang-masuk input { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
#borang-masuk input:focus-visible { outline: 2px solid var(--aksen); outline-offset: 1px; }
.ralat { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--merah); }
.butang-pasif { opacity: 0.6; pointer-events: none; }
