/* ============================================================
   Fatherless to Fearless — lembar gaya
   ------------------------------------------------------------
   Identitas: "jam senja, saat Papa pulang."
   Langit plum hangat, cahaya lampu teras dari atas,
   kunang-kunang, dan kertas bercahaya sebagai satu-satunya
   permukaan terang di kegelapan.
   ============================================================ */

:root {
  color-scheme: dark;

  /* langit & permukaan */
  --langit-0: #191125;
  --langit:   #261d35;
  --senja:    #4d2b45;
  --mega:     #342847;
  --mega-2:   #3d3054;
  --garis:    rgba(255, 205, 150, .16);

  /* cahaya */
  --lampu:    #ffb964;
  --lampu-2:  #f0925c;
  --rona:     #e2907e;

  /* kertas di bawah lampu */
  --kertas:   #f9edd8;
  --kertas-2: #f3e2c4;
  --tinta:    #4a3629;
  --tinta-2:  #7d6350;

  /* teks di atas langit */
  --teks:   #f4e9dc;
  --teks-2: #c9b3c4;
  --teks-3: #9a83a3;

  --font-cerita: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-tangan: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
}

/* ---------- dasar ---------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--teks);
  background: var(--langit);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button { font-family: inherit; }

::selection { background: rgba(255, 185, 100, .35); color: #fff6e8; }

:focus-visible { outline: 2px solid var(--lampu); outline-offset: 3px; border-radius: 6px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #453757; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- langit malam (lapisan tetap di belakang) ---------- */

.langit-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(95% 46% at 50% -6%, rgba(255, 185, 100, .17), transparent 62%),
    linear-gradient(180deg, var(--langit-0) 0%, var(--langit) 42%, #37243f 74%, var(--senja) 100%);
}

/* butiran kertas halus di seluruh layar */
.langit-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.cahaya-lampu {
  position: absolute;
  top: -170px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  height: 460px;
  background: radial-gradient(closest-side, rgba(255, 196, 120, .22), rgba(255, 170, 90, .08) 55%, transparent 72%);
  filter: blur(6px);
  animation: pulseLembut 7s ease-in-out infinite;
}

.bintang {
  position: absolute;
  border-radius: 50%;
  background: #fff2d9;
  opacity: var(--op, .5);
  box-shadow: 0 0 6px rgba(255, 242, 217, .7);
  animation: kelip 4.5s ease-in-out infinite alternate;
}

.kunang {
  position: absolute;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #ffcf82;
  box-shadow: 0 0 9px 2.5px rgba(255, 185, 100, .7);
  opacity: 0;
  animation: kunangTerbang 14s ease-in-out infinite;
}

/* ---------- kolom aplikasi ---------- */

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  min-height: 100dvh;
}

.view { animation: masuk .55s cubic-bezier(.22, .8, .32, 1) both; }

.layar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

/* ---------- bar atas ---------- */

.bar-atas {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 18px;
}

.bar-judul { flex: 1; min-width: 0; }

.bar-judul h2 {
  font-family: var(--font-cerita);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .2px;
}

.bar-sub {
  font-size: 12.5px;
  color: var(--teks-3);
  margin-top: 2px;
  font-style: italic;
  font-family: var(--font-cerita);
}

.bar-spacer { width: 42px; flex: none; }

.tombol-ikon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: rgba(249, 237, 216, .06);
  border: 1px solid var(--garis);
  color: var(--teks-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.tombol-ikon:hover { background: rgba(249, 237, 216, .13); }
.tombol-ikon:active { transform: scale(.9); }
.tombol-ikon:disabled { opacity: .3; cursor: default; }
.tombol-ikon.kecil { width: 37px; height: 37px; }

.ikon { width: 22px; height: 22px; display: block; }

/* ---------- tombol ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  padding: 13px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn .ikon { width: 18px; height: 18px; }

.btn-utama {
  background: linear-gradient(160deg, #ffc27a, var(--lampu-2));
  color: #46281c;
  box-shadow: 0 6px 24px rgba(240, 150, 90, .35), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn-utama:hover { box-shadow: 0 8px 30px rgba(240, 150, 90, .5), inset 0 1px 0 rgba(255, 255, 255, .4); }

.btn-halus {
  background: rgba(249, 237, 216, .07);
  color: var(--teks);
  border: 1px solid var(--garis);
}
.btn-halus:hover { background: rgba(249, 237, 216, .13); }

.btn-bahaya { background: #b04a4a; color: #ffe9e0; }

.btn-bahaya-halus {
  background: transparent;
  color: #e89b8b;
  border: 1px solid rgba(226, 144, 126, .35);
}

.btn-lebar { width: 100%; }

.tautan {
  background: none;
  border: none;
  color: var(--teks-2);
  text-decoration: underline dotted;
  font-size: 14px;
  padding: 8px;
  cursor: pointer;
}

/* ---------- avatar & gelembung ---------- */

.avatar {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 205, 150, .28), 0 4px 14px rgba(0, 0, 0, .3);
}
.avatar.besar { width: 72px; height: 72px; }
.papa-wajah { width: 100%; height: 100%; display: block; }

.gelembung {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.gelembung-papa {
  background: var(--kertas);
  color: var(--tinta);
  border-radius: 4px 18px 18px 18px;
  font-family: var(--font-cerita);
  font-size: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
}

.aksi { font-style: italic; opacity: .7; }

.gelembung-aku {
  background: linear-gradient(160deg, #ffc27a, var(--lampu-2));
  color: #46281c;
  border-radius: 18px 4px 18px 18px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(240, 150, 90, .25);
}

.sapaan {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 6px 0 22px;
}
.sapaan .gelembung-papa { animation: pop .5s .18s cubic-bezier(.34, 1.4, .44, 1) both; }

/* ---------- toast ---------- */

#toast-holder {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}

.toast {
  background: var(--kertas);
  color: var(--tinta);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  max-width: 88%;
  text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
  animation: toastMasuk .35s cubic-bezier(.34, 1.3, .5, 1) both;
}
.toast.pergi { animation: toastPergi .45s ease-in both; }

/* ---------- selubung & dialog ---------- */

.selubung {
  position: fixed;
  inset: 0;
  background: rgba(18, 11, 26, .74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 22px;
  overflow-y: auto;
  animation: fadeIn .3s both;
}

.kartu-dialog {
  background: var(--kertas);
  color: var(--tinta);
  border-radius: 22px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.kartu-dialog h3 { font-family: var(--font-cerita); font-size: 19px; margin-bottom: 8px; }
.kartu-dialog p { font-size: 14.5px; line-height: 1.6; color: #6b5142; }

.dialog-aksi {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
.dialog-aksi .btn { padding: 11px 18px; font-size: 14.5px; }

/* ============================================================
   ONBOARDING — tiba di depan rumah
   ============================================================ */

.layar-sambut {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 0;
}

.sambut-lampu .lampu-svg { width: 132px; height: 143px; }

.merek {
  font-family: var(--font-cerita);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: .5px;
  color: var(--teks);
  text-shadow: 0 0 30px rgba(255, 185, 100, .3);
  margin-top: 4px;
}
.merek span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--lampu);
  margin: 8px 0;
}

.tagline {
  color: var(--teks-2);
  font-size: 15.5px;
  margin-top: 14px;
  font-style: italic;
  font-family: var(--font-cerita);
}

.sambut-bawah {
  margin-top: 48px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catatan-privasi {
  font-size: 12.5px;
  color: var(--teks-3);
  line-height: 1.55;
}

.layar-sambut > * { animation: masuk .7s both; }
.layar-sambut > :nth-child(1) { animation-delay: .05s; }
.layar-sambut > :nth-child(2) { animation-delay: .25s; }
.layar-sambut > :nth-child(3) { animation-delay: .45s; }
.layar-sambut > :nth-child(4) { animation-delay: .7s; }

.layar-tanya { justify-content: center; gap: 34px; }

.tanya-atas { display: flex; gap: 14px; align-items: flex-start; }
.tanya-atas .gelembung-papa { animation: pop .5s .15s cubic-bezier(.34, 1.4, .44, 1) both; }

.tanya-isi {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: masuk .6s .35s both;
}

.input-nama {
  background: rgba(249, 237, 216, .08);
  border: 1.5px solid var(--garis);
  border-radius: 16px;
  color: var(--teks);
  font-size: 18px;
  font-family: var(--font-cerita);
  padding: 14px 18px;
  text-align: center;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.input-nama::placeholder { color: var(--teks-3); font-style: italic; }
.input-nama:focus { border-color: var(--lampu); box-shadow: 0 0 0 4px rgba(255, 185, 100, .14); }
.input-nama.kecil { font-size: 16px; text-align: left; padding: 11px 14px; border-radius: 12px; }

.pilih-tgl {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1.15fr;
  gap: 10px;
}
.pilih-tgl select {
  background: rgba(249, 237, 216, .08);
  border: 1.5px solid var(--garis);
  border-radius: 12px;
  color: var(--teks);
  padding: 12px 8px;
  font-size: 15px;
  font-family: var(--font-ui);
  outline: none;
  width: 100%;
}
.pilih-tgl select:focus { border-color: var(--lampu); }

/* ============================================================
   BERANDA — lampu teras & tiga pintu
   ============================================================ */

.layar-beranda { padding-top: 0; }

.lampu-gantung {
  display: flex;
  justify-content: center;
  margin-bottom: -10px;
}
.lampu-gantung .lampu-svg { width: 92px; height: 100px; }

.lampu-svg .halo { transform-origin: 60px 60px; animation: haloDenyut 4.5s ease-in-out infinite alternate; }
.lampu-svg .halo-2 { animation-delay: .6s; }

.beranda-atas {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 2px 0 20px;
}

.eyebrow {
  font-size: 15px;
  color: var(--teks-2);
  font-family: var(--font-cerita);
  font-style: italic;
}

.judul-nama {
  font-family: var(--font-cerita);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.05;
  margin-top: 2px;
  text-shadow: 0 0 26px rgba(255, 185, 100, .28);
}

.menu-utama {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.pintu {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  padding: 17px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #3b2d50, #322645);
  border: 1px solid var(--garis);
  border-top-color: rgba(255, 205, 150, .34);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  color: var(--teks);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  animation: masuk .6s both;
}
.menu-utama .pintu:nth-child(1) { animation-delay: .08s; }
.menu-utama .pintu:nth-child(2) { animation-delay: .16s; }
.menu-utama .pintu:nth-child(3) { animation-delay: .24s; }

.pintu:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .32), 0 0 24px rgba(255, 185, 100, .1);
}
.pintu:active { transform: scale(.98); }

.pintu-ikon {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  flex: none;
  color: #46281c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(0, 0, 0, .25);
}
.pintu-ikon .ikon { width: 27px; height: 27px; }

.pintu-diary   .pintu-ikon { background: linear-gradient(150deg, #ffc27a, #f0925c); }
.pintu-talk    .pintu-ikon { background: linear-gradient(150deg, #f2a08b, #d3705e); color: #4b2018; }
.pintu-memories .pintu-ikon { background: linear-gradient(150deg, #c9a1e0, #9a77c2); color: #33204a; }

.pintu-teks { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pintu-teks strong { font-family: var(--font-cerita); font-size: 18.5px; font-weight: 600; letter-spacing: .2px; }
.pintu-teks small { font-size: 13px; color: var(--teks-2); line-height: 1.4; }

.pintu-panah { color: var(--teks-3); flex: none; }
.pintu-panah .ikon { width: 20px; height: 20px; }

.beranda-bawah { margin-top: auto; padding-top: 28px; text-align: center; }
.beranda-bawah p { font-size: 12.5px; color: var(--teks-3); }

.pita-ultah {
  margin-bottom: 16px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 205, 150, .5);
  background: rgba(255, 185, 100, .1);
  color: var(--lampu);
  font-size: 14.5px;
  cursor: pointer;
  animation: pulseLembut 2.6s ease-in-out infinite;
}

/* ---------- surat ulang tahun & lampion ---------- */

.ultah { background: rgba(20, 11, 26, .86); }

.lampion-holder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.lampion {
  position: absolute;
  bottom: -90px;
  animation: naikLampion linear infinite;
}
.lampion i {
  display: block;
  width: 26px;
  height: 34px;
  border-radius: 9px 9px 12px 12px;
  background: linear-gradient(180deg, #ffd98e, #f0925c);
  box-shadow: 0 0 26px 7px rgba(255, 185, 100, .4);
  animation: goyangLampion 3.4s ease-in-out infinite alternate;
}
.lampion i::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 8px;
  height: 7px;
  background: #c97b48;
  border-radius: 2px;
}

.kartu-surat {
  position: relative;
  background: var(--kertas);
  color: var(--tinta);
  border-radius: 22px;
  padding: 30px 26px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  max-height: 86dvh;
  overflow-y: auto;
  animation: pop .5s .1s cubic-bezier(.34, 1.3, .5, 1) both;
}
.kartu-surat p {
  font-family: var(--font-cerita);
  font-size: 15px;
  line-height: 1.66;
  margin-bottom: 12px;
  color: #54402f;
}
.kartu-surat .surat-eyebrow {
  font-family: var(--font-tangan);
  font-size: 13.5px;
  color: #a3765a;
  margin-bottom: 16px;
}
.kartu-surat .ttd { margin: 6px 0 16px; }

.ttd {
  font-family: var(--font-tangan);
  font-size: 16px;
  text-align: right;
  color: #a3765a;
}

/* ============================================================
   DIARY — buku terkunci, PIN, halaman kertas
   ============================================================ */

.buku-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding-bottom: 7vh;
}

.buku {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: min(60vw, 225px);
  transition: transform .2s;
}
.buku:hover { transform: scale(1.03); }
.buku .buku-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .45));
}

.gembok-shackle {
  transform-origin: 112px 112px;
  transition: transform .55s cubic-bezier(.34, 1.5, .5, 1);
}
.buku.terbuka .gembok-shackle { transform: rotate(-42deg) translate(-4px, -7px); }
.buku.terbuka { animation: bukaBuku .8s .3s cubic-bezier(.5, 0, .65, .4) both; }

.petunjuk {
  color: var(--teks-2);
  font-size: 14.5px;
  font-style: italic;
  font-family: var(--font-cerita);
  text-align: center;
  max-width: 270px;
  line-height: 1.65;
  animation: pulseLembut 3.4s ease-in-out infinite;
}

/* --- PIN --- */

.pin-holder {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px 0 10vh;
}

.pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
}

.pin-judul { font-family: var(--font-cerita); font-size: 22px; }

.pin-sub {
  font-size: 14px;
  color: var(--teks-2);
  text-align: center;
  min-height: 22px;
  max-width: 270px;
  line-height: 1.5;
  margin-top: 8px;
}

.pin-dots { display: flex; gap: 16px; margin: 20px 0 26px; }
.pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--garis);
  background: rgba(249, 237, 216, .05);
  transition: background .2s, box-shadow .2s;
}
.pin-dots span.isi {
  background: var(--lampu);
  border-color: var(--lampu);
  box-shadow: 0 0 12px rgba(255, 185, 100, .6);
}
.pin-dots.goyang { animation: goyang .45s; }

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 66px);
  gap: 13px;
  justify-content: center;
}

.pin-key {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(249, 237, 216, .06);
  border: 1px solid var(--garis);
  color: var(--teks);
  font-size: 24px;
  font-family: var(--font-cerita);
  cursor: pointer;
  transition: transform .12s, background .12s;
}
.pin-key:active { transform: scale(.88); background: rgba(255, 185, 100, .22); }
.pin-hapus { font-size: 19px; }
.pin-kosong { width: 66px; height: 66px; }

.pin-bawah { display: flex; gap: 18px; margin-top: 16px; }

/* pin pad di atas kartu kertas (pengaturan) */
.kartu-pin { max-width: 340px; }
.kartu-pin .pin-judul { color: var(--tinta); }
.kartu-pin .pin-sub { color: var(--tinta-2); }
.kartu-pin .pin-key {
  background: rgba(74, 54, 41, .06);
  border-color: rgba(74, 54, 41, .22);
  color: var(--tinta);
}
.kartu-pin .pin-dots span { border-color: rgba(74, 54, 41, .32); background: rgba(74, 54, 41, .05); }
.kartu-pin .tautan { color: var(--tinta-2); }

/* --- tawaran PIN --- */

.kartu-tawaran {
  background: var(--mega);
  border: 1px solid var(--garis);
  border-radius: 22px;
  padding: 28px 22px;
  text-align: center;
  margin-top: 7vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tawaran-ikon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 185, 100, .15);
  display: grid;
  place-items: center;
  color: var(--lampu);
  margin-bottom: 4px;
}
.kartu-tawaran h3 { font-family: var(--font-cerita); font-size: 20px; }
.kartu-tawaran p { font-size: 14.5px; color: var(--teks-2); line-height: 1.65; }

.baris-tombol { display: flex; gap: 10px; flex-wrap: wrap; }
.baris-tombol.tengah { justify-content: center; margin-top: 10px; }

/* --- halaman menulis --- */

.nav-tgl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tgl-tengah { text-align: center; }
.tgl-tengah strong { display: block; font-family: var(--font-cerita); font-size: 18px; }
.tgl-tengah span { font-size: 12.5px; color: var(--teks-3); }

.kertas-tulis {
  background: var(--kertas);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .4), 0 0 50px rgba(255, 185, 100, .09);
  overflow: hidden;
  flex: 1;
  display: flex;
  padding-top: 14px;
}

.kertas-tulis textarea {
  flex: 1;
  width: 100%;
  min-height: 52dvh;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  background-image: repeating-linear-gradient(
    transparent, transparent 35px,
    rgba(150, 100, 80, .22) 35px, rgba(150, 100, 80, .22) 36px);
  background-attachment: local;
  padding: 0 20px 30px;
  line-height: 36px;
  font-family: var(--font-cerita);
  font-size: 16.5px;
  color: var(--tinta);
  caret-color: #c96a58;
}
.kertas-tulis textarea::placeholder { color: rgba(122, 95, 76, .55); font-style: italic; }

.savebar { display: flex; justify-content: flex-end; padding: 10px 4px 0; min-height: 32px; }
.savebar span { font-size: 12.5px; color: var(--teks-3); font-style: italic; }

/* --- daftar halaman --- */

.daftar-halaman {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.baris-halaman {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--mega);
  border: 1px solid var(--garis);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--teks);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.baris-halaman:hover { transform: translateX(3px); background: var(--mega-2); }
.baris-halaman strong { font-family: var(--font-cerita); font-size: 15.5px; }
.baris-halaman span {
  font-size: 13px;
  color: var(--teks-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-cerita);
  font-style: italic;
}

.kosong {
  text-align: center;
  padding: 46px 20px;
  color: var(--teks-2);
  font-size: 14.5px;
  line-height: 1.8;
  font-style: italic;
  font-family: var(--font-cerita);
}

/* ============================================================
   NGOBROL SAMA PAPA
   ============================================================ */

.layar-obrolan { padding-bottom: 0; }

.bar-obrolan {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: linear-gradient(180deg, rgba(25, 17, 37, .97) 40%, rgba(25, 17, 37, .8) 72%, rgba(25, 17, 37, .4) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bar-obrolan .avatar { width: 42px; height: 42px; }

.obrolan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 16px;
  flex: 1;
}

.baris { display: flex; gap: 9px; align-items: flex-end; }
.baris-papa { justify-content: flex-start; }
.baris-aku { justify-content: flex-end; }

.avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
}
.avatar-mini.kosongkan { visibility: hidden; }
.avatar-mini .papa-wajah { width: 100%; height: 100%; }

.mengetik {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 16px;
}
.mengetik span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b39074;
  animation: ketik 1.1s ease-in-out infinite;
}
.mengetik span:nth-child(2) { animation-delay: .18s; }
.mengetik span:nth-child(3) { animation-delay: .36s; }

.muncul { animation: pop .34s cubic-bezier(.34, 1.4, .44, 1) both; }

.dok-chip {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  padding: 16px 0 calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--langit) 38%);
}

.chip {
  background: rgba(37, 28, 53, .88);
  border: 1.5px solid rgba(255, 185, 100, .45);
  color: var(--teks);
  border-radius: 999px;
  padding: 11px 17px;
  font-size: 14.5px;
  cursor: pointer;
  animation: pop .4s both;
  transition: background .15s, transform .12s, border-color .15s;
}
.chip:hover { background: rgba(255, 185, 100, .18); border-color: var(--lampu); }
.chip:active { transform: scale(.95); }

.peluk-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(24, 14, 30, .87);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: fadeIn .4s both;
}

.peluk-teks {
  font-family: var(--font-cerita);
  font-style: italic;
  font-size: 19px;
  color: var(--kertas);
  text-align: center;
  padding: 0 30px;
  animation: pop .6s .25s cubic-bezier(.34, 1.3, .5, 1) both;
}

.hati-terbang {
  position: absolute;
  bottom: -50px;
  font-size: calc(22px * var(--s, 1));
  animation: hatiNaik ease-in infinite;
  opacity: 0;
}

/* ============================================================
   KENANGAN BERSAMA PAPA
   ============================================================ */

.sapaan-album { margin-bottom: 24px; }

.mem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
  padding: 4px 2px 30px;
}

.cetakan {
  background: #f6e8cd;
  border: none;
  border-radius: 6px;
  padding: 9px 9px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  transform: rotate(var(--rot, 0deg));
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}
.cetakan:hover, .cetakan:focus-visible {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 30px rgba(255, 185, 100, .16);
  position: relative;
  z-index: 2;
}

.cetakan-art {
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  overflow: hidden;
  background: #3a2b4c;
}
.cetakan-art .ilustrasi, .cetakan-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cetakan figcaption {
  font-family: var(--font-tangan);
  font-size: 12.5px;
  color: #6b4c3a;
  text-align: center;
  margin-top: 9px;
  line-height: 1.35;
}

/* --- lihat satu kenangan --- */

.album-lihat { padding: 18px; }

.lihat-kartu {
  position: relative;
  background: var(--kertas);
  border-radius: 20px;
  padding: 16px 16px 14px;
  max-width: 430px;
  width: 100%;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  max-height: 92dvh;
  overflow-y: auto;
  animation: pop .35s cubic-bezier(.34, 1.3, .5, 1) both;
}

.lihat-tutup {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(249, 237, 216, .85);
  color: var(--tinta);
  border-color: rgba(74, 54, 41, .2);
}

.lihat-art {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #3a2b4c;
}
.lihat-art .ilustrasi, .lihat-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.lihat-judul {
  font-family: var(--font-tangan);
  font-size: 16px;
  font-weight: 400;
  color: #7a5a40;
  text-align: center;
  margin: 15px 0 9px;
}

.lihat-caption {
  font-family: var(--font-cerita);
  font-size: 15.5px;
  line-height: 1.7;
  color: #54402f;
  text-align: center;
  padding: 0 8px;
}

.lihat-kartu .ttd { font-size: 14px; margin-top: 12px; }

.lihat-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.lihat-nav .tombol-ikon {
  background: rgba(74, 54, 41, .07);
  color: var(--tinta);
  border-color: rgba(74, 54, 41, .18);
}
.lihat-hitung { font-size: 12.5px; color: #a3765a; }

/* ============================================================
   PENGATURAN
   ============================================================ */

.kartu-setelan {
  background: var(--mega);
  border: 1px solid var(--garis);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kartu-setelan h3 { font-family: var(--font-cerita); font-size: 18px; }
.kartu-setelan .btn { align-self: flex-start; }
.kartu-setelan .btn-lebar, .kartu-setelan .btn-bahaya-halus { align-self: stretch; justify-content: center; }

.label-kecil {
  font-size: 12.5px;
  color: var(--teks-3);
  letter-spacing: .05em;
  margin-bottom: -6px;
}

.setelan-ket { font-size: 13.5px; color: var(--teks-2); line-height: 1.6; }

.ver {
  text-align: center;
  font-size: 12px;
  color: var(--teks-3);
  padding: 8px 0 26px;
  line-height: 1.6;
}

/* ============================================================
   ANIMASI
   ============================================================ */

@keyframes masuk {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(9px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes kelip {
  from { opacity: calc(var(--op, .5) * .35); }
  to   { opacity: var(--op, .5); }
}

@keyframes kunangTerbang {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: .95; }
  45%  { transform: translate(28px, -34px); opacity: .25; }
  62%  { opacity: .85; }
  100% { transform: translate(-20px, 16px); opacity: 0; }
}

@keyframes ketik {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes goyang {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

@keyframes pulseLembut {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

@keyframes haloDenyut {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

@keyframes naikLampion {
  from { transform: translateY(0); }
  to   { transform: translateY(-118vh); }
}

@keyframes goyangLampion {
  from { transform: translateX(-9px) rotate(-4deg); }
  to   { transform: translateX(9px) rotate(4deg); }
}

@keyframes hatiNaik {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: .95; }
  100% { transform: translateY(-108vh); opacity: 0; }
}

@keyframes bukaBuku {
  to { transform: scale(1.14); opacity: 0; filter: blur(3px); }
}

@keyframes toastMasuk {
  from { opacity: 0; transform: translateY(14px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastPergi {
  to { opacity: 0; transform: translateY(8px); }
}

/* ============================================================
   RESPONSIF & PREFERENSI
   ============================================================ */

@media (max-width: 360px) {
  #app { padding: 0 14px; }
  .pin-grid { grid-template-columns: repeat(3, 58px); gap: 11px; }
  .pin-key, .pin-kosong { width: 58px; height: 58px; }
  .judul-nama { font-size: 29px; }
  .merek { font-size: 31px; }
}

@media (min-width: 720px) {
  .layar { padding-top: calc(28px + env(safe-area-inset-top)); }
  .layar-beranda { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .kunang, .bintang { animation: none !important; opacity: .4; }
  .lampion { display: none; }
}
