/*
  CATATAN:
  1. Username / password biasa: const CREDENTIALS
  2. Developer access: disimpan sebagai hash (DEV_HASH_U / DEV_HASH_P), bukan plain text
  3. Tanggal kunci: TARGET_DATE. DISABLE_LOCK_FOR_TESTING = false = countdown aktif.
*/
:root{
  --cream:#fff8f0;
  --blush:#ffe3ea;
  --coral:#ff6f91;
  --coral-dark:#e14c72;
  --plum:#4a1f34;
  --muted:#7a4a5c;
  --mint:#bfe3d0;
  --gold:#f0b23a;
  --shadow: 0 20px 50px rgba(74,31,52,0.18);
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  min-height:100vh;
  font-family:'Quicksand', sans-serif;
  background: var(--user-page-bg, radial-gradient(circle at 15% 0%, #fff2e8 0%, var(--blush) 45%, #ffd6e0 100%));
  transition: background 0.6s ease;
  color: var(--plum);
  overflow-x:hidden;
  position:relative;
}
#ambient{position:fixed;inset:0;pointer-events:none;z-index:1;overflow:hidden;}
.amb{ position:absolute; bottom:-10%; opacity:0.45; animation: floatUp linear infinite; filter: drop-shadow(0 2px 6px rgba(74,31,52,0.12)); }
@keyframes floatUp{
  0%{transform:translateY(0) translateX(0) rotate(0deg); opacity:0;}
  10%{opacity:0.6;} 90%{opacity:0.4;}
  100%{transform:translateY(-115vh) translateX(24px) rotate(20deg); opacity:0;}
}
.wrap{ position:relative; z-index:2; min-height:100vh; display:flex; align-items:center; justify-content:center; padding:36px 16px; }
.card{
  width:100%; max-width:680px; background: var(--cream); border-radius:28px;
  box-shadow: var(--shadow); padding:42px 32px; text-align:center; position:relative;
  border: 1px solid var(--blush); animation: cardIn 0.6s cubic-bezier(.2,.9,.25,1);
}
@keyframes cardIn{ from{opacity:0; transform: translateY(20px) scale(0.97);} to{opacity:1; transform: translateY(0) scale(1);} }
.eyebrow{ font-size:12px; letter-spacing:3px; text-transform:uppercase; color: var(--coral-dark); font-weight:700; margin-bottom:10px; }
h1,h2{ font-family:'Fraunces', serif; font-weight:600; color: var(--plum); margin:0 0 12px; line-height:1.25;}
h1{ font-size:clamp(24px,5vw,34px); }
h2{ font-size:clamp(20px,4vw,26px); text-align:left; }
p.lead{ font-size:15px; line-height:1.65; color:var(--muted); margin:0 0 24px; }
.btn{
  appearance:none; border:none; cursor:pointer; font-family:'Quicksand',sans-serif; font-weight:700;
  font-size:15px; color:#fff; background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  padding:13px 28px; border-radius:999px; box-shadow: 0 10px 24px rgba(255,111,145,0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,111,145,0.48); }
.btn:active{ transform: translateY(0) scale(0.98); }
.btn:disabled{ opacity:0.4; cursor:not-allowed; transform:none; }
.btn.gold{ background: linear-gradient(135deg,var(--gold),#d99420); box-shadow:0 10px 24px rgba(240,178,58,0.4);}
.btn.ghost{ background: transparent; color: var(--coral-dark); box-shadow:none; border:2px solid #f3c3d1; }
.btn.ghost:hover{ background: var(--mint); box-shadow:none; }
input[type=text],input[type=password]{
  width:100%; padding:13px 16px; border-radius:14px; border:2px solid var(--blush); background:var(--cream);
  font-family:'Quicksand',sans-serif; font-size:16px; margin-bottom:14px; color:var(--plum); /* 16px: di bawah itu iOS Safari otomatis zoom pas kolom difokus */
}
input[type=text]:focus,input[type=password]:focus{ outline:none; border-color: var(--coral); }
.pass-field{ position:relative; }
.pass-field input[type=text],.pass-field input[type=password]{ padding-right:44px; margin-bottom:0; }
.pass-field{ margin-bottom:14px; }
.pass-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:16px; line-height:1;
  padding:8px; opacity:0.55; transition:opacity .15s ease;
}
.pass-toggle:hover{ opacity:1; }
.errmsg{ color:var(--coral-dark); font-size:13px; font-weight:700; margin:-6px 0 14px; min-height:16px; }
.hidden{ display:none !important; }

#progressDots{ position:fixed; top:16px; left:50%; transform:translateX(-50%); display:flex; gap:7px; z-index:20; }
#progressDots .dot{ width:8px; height:8px; border-radius:50%; background:var(--blush); transition:all .3s; }
#progressDots .dot.active{ background: var(--coral-dark); width:22px; border-radius:6px; }
#progressDots .dot.done{ background: var(--gold); }
#progressDots.explorable .dot{ cursor:pointer; }
#progressDots.explorable .dot:hover{ transform:scale(1.4); }

.countdown-grid{ display:flex; gap:12px; justify-content:center; margin: 22px 0 28px; flex-wrap:wrap; }
.cd-box{ background:var(--mint); border:1px solid var(--blush); border-radius:16px; padding:14px 16px; min-width:70px; }
.cd-num{ font-family:'Fraunces',serif; font-weight:700; font-size:28px; color:var(--coral-dark); }
.cd-label{ font-size:10.5px; letter-spacing:1px; text-transform:uppercase; color:#a8768a; font-weight:700; margin-top:2px; }

/* progress bar countdown */
.cd-progress-wrap{ margin: 4px 0 24px; }
.cd-progress-track{
  position:relative; height:16px; border-radius:999px; background:var(--blush);
  box-shadow: inset 0 2px 5px rgba(74,31,52,0.14);
  overflow:visible; border:1px solid var(--blush);
}
.cd-progress-fill{
  position:relative; height:100%; width:0%; min-width:16px; border-radius:999px;
  background: linear-gradient(90deg,#ffb3c6,var(--coral),var(--gold),var(--coral));
  background-size:250% 100%;
  animation: cdShimmer 2.4s linear infinite;
  transition: width 1s ease;
  box-shadow: 0 0 10px rgba(255,111,145,0.5);
}
@keyframes cdShimmer{ 0%{ background-position:0% 0; } 100%{ background-position:250% 0; } }
.cd-progress-icon{
  position:absolute; right:-2px; top:50%;
  transform: translate(50%,-50%);
  font-size:20px;
  animation: cdBob 1.3s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(74,31,52,0.25));
}
@keyframes cdBob{
  0%,100%{ transform: translate(50%,-50%) translateY(0) rotate(-4deg); }
  50%{ transform: translate(50%,-50%) translateY(-5px) rotate(4deg); }
}
.cd-progress-label{ text-align:center; font-size:12px; color:#a8768a; font-weight:700; margin-top:10px; letter-spacing:0.3px; }
@media (prefers-reduced-motion: reduce){
  .cd-progress-fill{ animation:none; }
  .cd-progress-icon{ animation:none; }
}

/* ch11: flappy heart - retro arcade */
#flappyWrap{
  position:relative; width:100%; max-width:340px; height:420px; margin:0 auto;
  border-radius:16px; overflow:hidden;
  border:4px solid var(--plum); box-shadow: 0 16px 34px rgba(74,31,52,0.28), inset 0 0 0 3px #ffd0dd;
  background:#fff3e0; touch-action:none;
}
.flappy-photo-bg{
  /* foto Salma diam (nggak geser) supaya nggak bikin pusing pas main */
  position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index:0;
  display:grid; grid-template-columns:repeat(4,1fr); grid-template-rows:repeat(5,1fr);
  gap:3px; padding:4px; background:#fbe8d3; box-sizing:border-box; overflow:hidden;
}
.flappy-photo-frame{
  position:relative; min-width:0; min-height:0; overflow:hidden; border-radius:3px; background:#fff;
}
.flappy-photo-frame img{
  width:100%; height:100%; object-fit:cover; object-position:50% 28%; display:block;
  filter:saturate(0.92) brightness(1.03);
}
/* tampilan normal: 20 foto (4 x 5); layar penuh: 28 foto, kolom/baris ngikutin orientasi layar */
.flappy-photo-frame:nth-child(n+21){ display:none; }
#flappyStage.is-fs .flappy-photo-frame:nth-child(n+21){ display:block; }
#flappyStage.is-fs .flappy-photo-bg{ grid-template-columns:repeat(4,1fr); grid-template-rows:repeat(7,1fr); }
@media (orientation:landscape){
  #flappyStage.is-fs .flappy-photo-bg{ grid-template-columns:repeat(7,1fr); grid-template-rows:repeat(4,1fr); }
}
#flappyCanvas{ position:relative; z-index:1; display:block; width:100%; height:100%; }
#flappyScore, #dinoScore{
  font-family:'Press Start 2P', monospace; font-size:11px; letter-spacing:0.5px;
  color: var(--coral-dark); background:#fff0f4; border:2px solid #ffd0dd; border-radius:10px;
  padding:8px 12px; display:inline-block; margin:0 auto 12px; text-align:center;
}
.flappy-overlay{
  position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center;
  background: rgba(74,31,52,0.55); backdrop-filter: blur(1px);
}
.flappy-overlay.hidden{ display:none !important; }
.flappy-overlay-inner{
  text-align:center; padding:22px 20px; background:#fff8f0; border-radius:14px;
  border:3px solid var(--gold); box-shadow:0 12px 26px rgba(0,0,0,0.25); max-width:260px;
}
.flappy-overlay-title{
  font-family:'Press Start 2P', monospace; font-size:14px; color:var(--coral-dark);
  margin-bottom:10px; line-height:1.6;
}
.flappy-overlay-sub{ font-size:13px; color:var(--plum); margin-bottom:16px; min-height:18px; }
.flappy-overlay-inner.flappy-intro{ width:236px; box-sizing:border-box; }
.flappy-replay-link{ display:block; margin:10px auto 0; padding:8px 14px; font-size:13px; }
.flappy-morph-canvas{ display:block; width:118px; height:188px; margin:0 auto 8px; }
.flappy-overlay-inner.morphing .flappy-overlay-sub{ min-height:36px; font-weight:700; color:var(--coral-dark); }
.flappy-overlay-inner.morphing .flappy-overlay-title,
.flappy-overlay-inner.morphing .btn{ visibility:hidden; }


/* modal karakter Salma (foto -> kartun) versi ringkas, dipakai Nangkap Love & Dino Run */
.flappy-overlay-inner.char-modal,
#dinoWrap .flappy-overlay-inner.char-modal,
#catchArea .flappy-overlay-inner.char-modal{
  display:flex; align-items:center; gap:14px; text-align:left;
  padding:14px 16px; width:auto; max-width:min(94%, 320px); box-sizing:border-box; line-height:1.4;
}
.char-modal .flappy-morph-canvas{ width:84px; height:134px; margin:0; flex:0 0 auto; }
.char-modal .cm-text{ flex:1 1 auto; min-width:0; }
.char-modal .flappy-overlay-title{ font-size:11px; margin-bottom:6px; line-height:1.5; }
.char-modal .flappy-overlay-sub{ font-size:12px; margin-bottom:10px; min-height:0; }
.char-modal .btn{ padding:10px 18px; font-size:14px; }
.flappy-overlay-inner.char-modal.morphing .flappy-overlay-sub{ min-height:48px; }

/* baris tombol di pojok kanan atas game: [Lewati] [Layar penuh/Keluar] dalam SATU wadah flex,
   jadi nggak mungkin saling numpuk apa pun ukuran layarnya. */
.game-topbar{
  position:absolute; top:8px; right:8px; z-index:9;
  display:flex; align-items:center; justify-content:flex-end; gap:6px;
  max-width:calc(100% - 16px); pointer-events:none;
}
.game-topbar > *{ pointer-events:auto; }
.game-skip-btn{
  height:32px; padding:0 12px !important; font-size:12px !important; white-space:nowrap; border-radius:16px;
  background:rgba(255,248,240,0.94) !important; box-shadow:0 3px 8px rgba(74,31,52,0.2) !important;
  display:flex; align-items:center; -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
.game-skip-btn.hidden{ display:none !important; }
/* layar sempit: label tombol Lewati dipersingkat biar tetap muat di sebelah tombol Keluar */
@media (max-width:420px){
  .game-skip-btn .skip-long{ display:none; }
}
/* layar SANGAT sempit (mis. 320px): cuma ikon ⏭️ supaya nggak nabrak skor di kiri */
@media (max-width:360px){
  .game-skip-btn .skip-txt{ display:none; }
  .game-skip-btn{ padding:0 10px !important; }
}

/* tombol layar penuh (Flappy Heart & Dino Run) */
.fs-btn{
  position:relative; flex:none; z-index:9; display:flex; align-items:center; gap:6px;
  height:32px; padding:0 11px 0 9px; border-radius:16px; border:2px solid #ffd0dd;
  background:rgba(255,248,240,0.94); color:var(--coral-dark); cursor:pointer;
  font:700 12px/1 'Quicksand', sans-serif; line-height:1; box-shadow:0 3px 8px rgba(74,31,52,0.2);
  -webkit-tap-highlight-color:transparent; touch-action:manipulation; appearance:none; -webkit-appearance:none;
}
.fs-btn svg{ width:15px; height:15px; flex:none; display:block; }
.fs-btn .ico-exit{ display:none; }
.fs-btn.on .ico-enter{ display:none; }
.fs-btn.on .ico-exit{ display:block; }
.fs-btn:active{ transform:scale(0.96); }

html.game-fs-lock, html.game-fs-lock body{ overflow:hidden !important; overscroll-behavior:none; }
.game-stage.is-fs{
  position:fixed; top:0; left:0; right:0; bottom:0; width:100vw; height:100vh; height:100dvh; z-index:10000;
  background:#2a1020; display:flex; align-items:center; justify-content:center;
  touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
/* kursor hati custom nggak kelihatan di mode layar penuh -> balikin kursor biasa */
.game-stage.is-fs, .game-stage.is-fs *{ cursor:auto !important; }
.game-stage.is-fs button, .game-stage.is-fs .fs-btn{ cursor:pointer !important; }

/* flappy heart - layar penuh */
#flappyStage.is-fs{ display:block; }
#flappyStage.is-fs #flappyWrap{
  position:absolute; top:0; left:0; right:0; bottom:0; width:100%; max-width:none; height:100%;
  margin:0; border:0; border-radius:0; box-shadow:none;
}
#flappyStage.is-fs #flappyScore{
  position:absolute; top:10px; left:10px; z-index:8; margin:0; font-size:10px; padding:7px 10px; white-space:nowrap; pointer-events:none;
}

/* dino run (mario) - layar penuh: kanvas 4:3 di tengah, kontrol nempel di atas layar */
#dinoStage.is-fs #dinoWrap{
  width:min(100vw, calc(100vh * 4 / 3)); width:min(100vw, calc(100dvh * 4 / 3));
  max-width:none; margin:0; border:0; border-radius:0; box-shadow:none;
}
#dinoStage.is-fs #dinoScore{
  position:absolute; top:8px; left:8px; z-index:8; margin:0; font-size:10px; padding:6px 10px; pointer-events:none;
}
#dinoStage.is-fs .dino-msg{
  position:absolute; top:46px; left:50%; transform:translateX(-50%); z-index:8; margin:0; min-height:0;
  width:max-content; max-width:88%; padding:5px 12px; border-radius:12px; background:rgba(255,248,240,0.92);
  pointer-events:none;
}
#dinoStage.is-fs .dino-msg:empty{ display:none; }
#dinoStage.is-fs .dino-controls{
  position:absolute; left:0; right:0; bottom:0; max-width:none; margin:0; padding:0 18px 16px; z-index:8; pointer-events:none;
}
#dinoStage.is-fs .dino-btn{ pointer-events:auto; opacity:0.85; }
/* layar HP posisi tegak: kasih tahu kalau landscape lebih luas */
@media (orientation:portrait) and (max-width:700px){
  #dinoStage.is-fs::after{
    content:'↻ Putar HP ke landscape biar layarnya lebih luas';
    position:absolute; top:74px; left:16px; right:16px; text-align:center; z-index:8;
    color:rgba(255,255,255,0.75); font:600 12px/1.4 'Quicksand', sans-serif; pointer-events:none;
  }
}
@media (max-height:480px){
  #dinoStage.is-fs .dino-controls{ padding:0 14px 10px; }
  #dinoStage.is-fs .dino-btn{ width:54px; height:54px; font-size:22px; }
  #dinoStage.is-fs .dino-btn-jump{ width:64px; height:64px; font-size:26px; }
}

/* petualangan dino (platformer ala Mario) */
#dinoWrap{
  position:relative; width:100%; max-width:380px; margin:0 auto; border-radius:16px; overflow:hidden;
  border:4px solid var(--plum); box-shadow: 0 16px 34px rgba(74,31,52,0.28), inset 0 0 0 3px #ffd0dd;
  background:#8fd3ff; touch-action:none; line-height:0;
}
#dinoCanvas{ display:block; width:100%; height:auto; }
#dinoWrap .flappy-overlay-inner{ line-height:1.4; max-width:250px; padding:14px 16px; }
#dinoWrap .flappy-overlay-title{ font-size:13px; margin-bottom:6px; }
#dinoWrap .flappy-overlay-sub{ margin-bottom:10px; }
.dino-msg{ min-height:20px; text-align:center; font-size:13px; font-weight:700; color:var(--coral-dark); margin:8px 0 0; }
.dino-controls{
  display:flex; justify-content:space-between; align-items:center; max-width:380px; margin:6px auto 12px; gap:10px;
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:none;
}
.dino-pad{ display:flex; gap:12px; }
.dino-btn{
  width:66px; height:66px; border-radius:50%; font-size:26px; line-height:1; cursor:pointer;
  color:var(--coral-dark); background:#fff0f4; border:3px solid #ffd0dd; box-shadow:0 5px 0 #f3b3c6;
  display:flex; align-items:center; justify-content:center; padding:0; touch-action:none;
  -webkit-tap-highlight-color:transparent;
}
.dino-btn.down, .dino-btn:active{ transform:translateY(4px); box-shadow:0 1px 0 #f3b3c6; background:#ffe0ea; }
.dino-btn-jump{ width:78px; height:78px; font-size:30px; background:var(--coral); color:#fff; border-color:#ff9db5; box-shadow:0 5px 0 #d6587a; }
.dino-btn-jump.down, .dino-btn-jump:active{ background:var(--coral-dark); box-shadow:0 1px 0 #d6587a; }

.chapter{ text-align:left; }
.chapter .center{ text-align:center; }
.chapter-nav{ display:flex; justify-content:flex-end; margin-top:26px; gap:10px; }
.chapter-nav-arrows .btn{
  padding:12px 20px; min-width:54px; font-size:19px; line-height:1; text-align:center;
}

/* transisi antar chapter */
.chapter.ch-leave{ animation: chLeave .26s ease forwards; }
.chapter.ch-leave-back{ animation: chLeaveBack .26s ease forwards; }
@keyframes chLeave{ to{ opacity:0; transform:translateX(-28px) scale(0.98); } }
@keyframes chLeaveBack{ to{ opacity:0; transform:translateX(28px) scale(0.98); } }
.chapter.ch-enter{ opacity:0; transform:translateX(28px) scale(0.98); }
.chapter.ch-enter-back{ opacity:0; transform:translateX(-28px) scale(0.98); }
.chapter.ch-enter-active{ animation: chEnter .4s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes chEnter{ to{ opacity:1; transform:translateX(0) scale(1); } }
@media (prefers-reduced-motion: reduce){
  .chapter.ch-leave, .chapter.ch-leave-back, .chapter.ch-enter-active{ animation:none !important; }
}

/* timeline */
.tl-item{ margin-bottom:30px; opacity:0; transform:translateY(16px); transition: all .6s ease; }
.tl-item.show{ opacity:1; transform:translateY(0); }
.tl-date{ font-size:11.5px; font-weight:700; color:var(--coral-dark); letter-spacing:0.5px; text-transform:uppercase; }
.tl-item h3{ font-family:'Fraunces',serif; margin:4px 0 6px; font-size:18px; }
.tl-item p{ font-size:13.5px; color:var(--muted); margin:0 0 12px; line-height:1.6; }
.tl-photostrip{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px 8px; }
.tl-photostrip img{
  width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:14px;
  box-shadow:0 6px 14px rgba(74,31,52,0.15); cursor:pointer;
  opacity:0; transform: translateY(16px) scale(0.9) rotate(var(--tlrot,0deg));
  transition: opacity .5s ease, transform .5s cubic-bezier(.34,1.4,.64,1), box-shadow .2s ease;
}
.tl-photostrip img.show{ opacity:1; transform: translateY(0) scale(1) rotate(0deg); }
.tl-photostrip img:hover{ transform: scale(1.06) rotate(0deg); box-shadow:0 12px 22px rgba(74,31,52,0.25); }
.tl-photostrip img:nth-child(3n+1){ --tlrot:-4deg; }
.tl-photostrip img:nth-child(3n+2){ --tlrot:3deg; }
.tl-photostrip img:nth-child(3n+3){ --tlrot:-3deg; }
@media (max-width:480px){ .tl-photostrip{ grid-template-columns:repeat(2,1fr); } }

/* gallery grid — gaya polaroid */
.gallery-grid{ margin: 18px 0 6px; }
.gallery-page{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px 10px; }
.gallery-page.hidden{ display:none; }
@media (max-width:480px){ .gallery-page{ grid-template-columns:repeat(3,1fr); gap:12px 8px; } }
.gallery-page-nav{ margin-top:16px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.gallery-page-indicator{ font-size:13px; color:var(--muted); letter-spacing:.02em; }
.polaroid{
  --rot:0deg;
  background:#fff; padding:7px 7px 20px 7px; border-radius:5px;
  box-shadow:0 8px 16px rgba(74,31,52,0.18);
  opacity:0; transform: translateY(-30px) rotate(var(--rot)) scale(0.7);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, opacity .4s ease;
  cursor:pointer; position:relative;
}
.polaroid::before{
  content:''; position:absolute; top:-9px; left:50%; transform:translateX(-50%) rotate(-5deg);
  width:34px; height:14px; background:rgba(255,182,199,0.9); border-radius:2px;
  box-shadow:0 2px 4px rgba(74,31,52,0.2);
}
.polaroid img{ width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:2px; display:block; }
.polaroid.show{ opacity:1; transform: translateY(0) rotate(var(--rot)) scale(1); animation: pzwiggle 4.6s ease-in-out infinite; animation-delay:.5s; }
.polaroid:hover{ animation:none; transform: translateY(-6px) rotate(0deg) scale(1.08); box-shadow:0 16px 28px rgba(74,31,52,0.3); z-index:5; }
@keyframes pzwiggle{
  0%,100%{ transform: translateY(0) rotate(var(--rot)) scale(1); }
  50%{ transform: translateY(-3px) rotate(calc(var(--rot) - 1.4deg)) scale(1); }
}
.polaroid:nth-child(8n+1){ --rot:-6deg; }
.polaroid:nth-child(8n+2){ --rot:4deg; }
.polaroid:nth-child(8n+3){ --rot:-3deg; }
.polaroid:nth-child(8n+4){ --rot:6deg; }
.polaroid:nth-child(8n+5){ --rot:-5deg; }
.polaroid:nth-child(8n+6){ --rot:3deg; }
.polaroid:nth-child(8n+7){ --rot:-4deg; }
.polaroid:nth-child(8n+8){ --rot:5deg; }
@media (prefers-reduced-motion: reduce){ .polaroid.show{ animation:none; } }

/* lightbox */
#lightbox{
  position:fixed; inset:0; background:rgba(40,15,28,0.88); z-index:200;
  display:none; align-items:center; justify-content:center; padding:20px;
  opacity:0; transition: opacity .25s ease;
  flex-direction:column;
}
#lightbox.open{ display:flex; opacity:1; }
#lightbox .lb-stage{
  max-width:min(92vw, 520px); max-height:78vh;
  display:flex; align-items:center; justify-content:center;
  touch-action: pan-y;
  user-select:none;
}
#lightbox img, #lightbox .lb-stage img{
  max-width:min(92vw, 520px); max-height:78vh; object-fit:contain;
  border-radius:16px; box-shadow:0 20px 50px rgba(0,0,0,0.4);
  transform: scale(0.92); transition: transform .28s cubic-bezier(.2,.9,.25,1), opacity .2s ease;
  pointer-events:none;
}
#lightbox.open img{ transform: scale(1); }
#lightbox .lb-close{
  position:absolute; top:18px; right:22px; width:44px; height:44px; border-radius:50%;
  background:rgba(255,255,255,0.25); border:none; color:#fff; font-size:22px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  z-index:30; pointer-events:auto;
}
#lightbox .lb-close:hover{ background:rgba(255,255,255,0.4); }
#lightbox .lb-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  width:48px; height:48px; border-radius:50%;
  background:rgba(255,255,255,0.28); border:none; color:#fff;
  font-size:30px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background .15s;
  z-index:30; pointer-events:auto;
}
#lightbox .lb-nav:hover{ background:rgba(255,255,255,0.45); }
#lightbox .lb-prev{ left:10px; }
#lightbox .lb-next{ right:10px; }
#lightbox .lb-counter{
  margin-top:12px; color:rgba(255,255,255,0.85);
  font-size:13px; font-weight:600; letter-spacing:0.3px;
}
#lightbox .lb-hint{
  margin:6px 0 0; color:rgba(255,255,255,0.45);
  font-size:11.5px; font-weight:600;
}
@media (max-width:520px){
  #lightbox .lb-prev{ left:6px; }
  #lightbox .lb-next{ right:6px; }
  #lightbox .lb-nav{ width:38px; height:38px; font-size:24px; }
}

/* quiz reflection */
.q-block{ margin-bottom:22px; padding-bottom:18px; border-bottom:1px dashed var(--blush); }
.q-block:last-child{ border-bottom:none; }
.q-block p.qtext{ font-weight:700; font-size:14.5px; margin:0 0 10px; color:var(--plum); }
.q-opts{ display:flex; flex-wrap:wrap; gap:8px; }
.q-opt{ border:2px solid var(--blush); background:var(--cream); border-radius:999px; padding:8px 16px; font-size:13px; font-weight:600; cursor:pointer; transition:.15s; }
.q-opt:hover{ border-color:var(--coral); }
.q-opt.picked{ background: linear-gradient(135deg,var(--coral),var(--coral-dark)); color:#fff; border-color:transparent; }
.q-note{ font-size:12.5px; color:#a8768a; margin-top:8px; font-style:italic; min-height:14px; }

/* tebak kado */
.gift-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin: 6px 0 8px; }
.gift-box{
  aspect-ratio:1; border-radius:16px; background: linear-gradient(135deg,var(--mint),#9ecdb2);
  display:flex; align-items:center; justify-content:center; font-size:30px; cursor:pointer;
  transition: transform .18s ease; box-shadow: 0 8px 18px rgba(74,31,52,0.12); user-select:none;
  position:relative; text-align:center; padding:6px;
}
.gift-box:hover{ transform: translateY(-3px) scale(1.03); }
.gift-box.opened{
  aspect-ratio:auto; min-height:100%;
  background:var(--mint); font-size:11px; font-weight:700; color:var(--coral-dark); cursor:default; transform:none;
}
.gift-box.main.opened{ background: linear-gradient(135deg,var(--gold),#e0a12e); color:var(--plum); }

/* puzzle */
/* fotonya potret (3:4): rasio kotak puzzle disesuaikan dari ukuran foto asli lewat JS, biar potongannya nggak gepeng */
#puzzleGrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:5px; width:min(300px,88%); margin:10px auto 18px; aspect-ratio:3 / 4; }
.pz-tile{
  position:relative; border-radius:10px; background-size:300% 300%; cursor:pointer;
  transition: transform .12s ease; user-select:none; overflow:hidden;
}
.pz-tile.blank{ background:transparent; cursor:default; }
.pz-tile .badge{
  position:absolute; top:5px; left:5px; background:rgba(74,31,52,0.65); color:#fff;
  font-size:11px; font-weight:700; width:19px; height:19px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}
.pz-status{ text-align:center; font-size:13px; font-weight:700; color: var(--coral-dark); min-height:18px; margin-bottom:6px;}
.pz-timer{
  width:fit-content; margin:0 auto 6px; padding:4px 14px; border-radius:999px; background:var(--mint);
  border:2px solid var(--blush); color:var(--coral-dark); font-size:13px; font-weight:700; font-variant-numeric:tabular-nums;
}
.pz-timer.urgent{ animation:pzPulse 1s ease-in-out infinite; border-color:var(--coral); }
.pz-timer.done{ opacity:0.75; }
@keyframes pzPulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.08); } }
.pz-tile.moved{ animation:pzPop .28s ease; }
@keyframes pzPop{ 0%{ transform:scale(0.9); } 100%{ transform:scale(1); } }
.pz-tile.reveal{ animation:pzReveal .7s ease both; cursor:default; }
@keyframes pzReveal{ from{ opacity:0; transform:scale(0.85); } to{ opacity:1; transform:scale(1); } }
@media (prefers-reduced-motion: reduce){ .pz-timer.urgent, .pz-tile.moved, .pz-tile.reveal{ animation:none; } }

/* envelopes */
.env-row{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin:10px 0 20px; }
.envelope{
  width:150px; min-height:110px; border-radius:14px; background: linear-gradient(160deg,var(--mint),var(--blush));
  border:2px solid #ffcada; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; cursor:pointer; padding:14px 10px; text-align:center; transition: transform .18s ease;
}
.envelope:hover{ transform: translateY(-3px); }
.envelope .icon{ font-size:26px; }
.envelope .lbl{ font-size:12px; font-weight:700; color:var(--coral-dark); }
.envelope.opened{ background:#fff; border-style:solid; }
.envelope .msg{ font-size:12px; color:var(--muted); line-height:1.5; display:none; }
.envelope.opened .msg{ display:block; }
.envelope.opened .lbl, .envelope.opened .icon{ display:none; }

/* candi build (ch13) */
.candi-wrap{ display:flex; flex-direction:column; align-items:center; margin:10px 0 4px; }
.candi-stage{
  position:relative; width:100%; max-width:400px; height:300px; margin:0 auto;
  background: linear-gradient(180deg, #fff6e8 0%, #ffe1c4 55%, #ffcfa3 100%);
  border-radius:18px; border:2px solid var(--blush); overflow:hidden;
  box-shadow: inset 0 0 30px rgba(255,255,255,0.4);
}
.candi-sun{
  position:absolute; top:14px; right:18px; width:46px; height:46px; border-radius:50%;
  background: radial-gradient(circle, #fff2b8 0%, #ffd97a 55%, rgba(255,217,122,0) 75%);
  box-shadow: 0 0 24px 10px rgba(255,217,122,0.35);
  animation: candiSunPulse 3.5s ease-in-out infinite;
}
@keyframes candiSunPulse{ 0%,100%{ opacity:0.85; transform:scale(1);} 50%{ opacity:1; transform:scale(1.08);} }
.candi-cloud{
  position:absolute; background:#fff; opacity:0.75; border-radius:50px;
  filter:drop-shadow(0 2px 0 rgba(255,255,255,0.4));
  animation: candiDrift 22s linear infinite;
}
.candi-cloud::before, .candi-cloud::after{
  content:''; position:absolute; background:#fff; border-radius:50%;
}
.candi-cloud-1{ top:20px; left:-60px; width:54px; height:18px; animation-duration:26s; }
.candi-cloud-1::before{ width:26px; height:26px; top:-12px; left:8px; }
.candi-cloud-1::after{ width:20px; height:20px; top:-8px; left:28px; }
.candi-cloud-2{ top:44px; left:-100px; width:40px; height:14px; animation-duration:19s; animation-delay:-8s; opacity:0.6; }
.candi-cloud-2::before{ width:20px; height:20px; top:-9px; left:6px; }
.candi-cloud-2::after{ width:14px; height:14px; top:-6px; left:20px; }
@keyframes candiDrift{ 0%{ transform:translateX(0); } 100%{ transform:translateX(480px); } }
.candi-birds{
  position:absolute; top:36px; left:55%; font-size:11px; opacity:0.8;
  animation: candiBirdFly 16s ease-in-out infinite;
}
@keyframes candiBirdFly{ 0%,100%{ transform:translate(0,0);} 50%{ transform:translate(30px,-10px);} }
.candi-ground{
  position:absolute; left:0; right:0; bottom:0; height:28px;
  background: linear-gradient(180deg,#c9a06a,#996b3b);
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.25);
}
.candi-ground::before{
  content:''; position:absolute; left:0; right:0; top:-6px; height:6px;
  background: repeating-linear-gradient(90deg, rgba(122,84,42,0.4) 0 3px, transparent 3px 14px);
}
.candi-build{
  position:absolute; left:50%; bottom:28px; transform:translateX(-50%);
  display:flex; flex-direction:column-reverse; align-items:center;
}
.candi-tier{
  height:22px; border-radius:4px 4px 0 0; margin-top:-3px; position:relative;
  background: repeating-linear-gradient(90deg, #d3a973 0 22px, #b6864f 22px 24px);
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.3), inset 0 -4px 0 rgba(74,31,52,0.18), 0 3px 6px rgba(74,31,52,0.12);
  opacity:0; transform: translateY(18px) scale(0.85);
}
.candi-relief{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:70%; height:8px; border-radius:3px;
  background: repeating-linear-gradient(90deg, rgba(255,217,122,0.55) 0 6px, transparent 6px 12px);
}
.candi-tier.show{ animation: candiPop .45s cubic-bezier(.3,1.6,.4,1) forwards; }
.candi-tier[data-tier="1"]{ width:220px; height:26px; }
.candi-tier[data-tier="2"]{ width:196px; filter:brightness(1.03); }
.candi-tier[data-tier="3"]{ width:170px; filter:brightness(1.05); }
.candi-tier[data-tier="4"]{ width:142px; filter:brightness(1.07); }
.candi-tier[data-tier="5"]{ width:112px; filter:brightness(1.1); }
.candi-tier[data-tier="6"]{ width:82px; filter:brightness(1.13); }
.candi-stupa{
  width:34px; height:36px; margin-top:-2px; position:relative;
  border-radius:50% 50% 6px 6px; background: linear-gradient(180deg,#ffe9a8,var(--gold));
  opacity:0; transform: translateY(16px) scale(0.7);
  box-shadow: 0 2px 6px rgba(74,31,52,0.2);
}
.candi-stupa.show{ animation: candiPop .5s cubic-bezier(.3,1.6,.4,1) forwards; }
.candi-glow{
  position:absolute; top:-6px; left:50%; transform:translateX(-50%);
  width:60px; height:60px; border-radius:50%;
  background: radial-gradient(circle, rgba(255,233,168,0.55) 0%, rgba(255,233,168,0) 70%);
  animation: candiGlowPulse 2.2s ease-in-out infinite; pointer-events:none;
}
@keyframes candiGlowPulse{ 0%,100%{ opacity:0.5; transform:translateX(-50%) scale(0.9);} 50%{ opacity:0.9; transform:translateX(-50%) scale(1.15);} }
.candi-flag{
  position:absolute; top:-20px; left:50%; transform:translateX(-50%) rotate(-8deg);
  font-size:16px; display:inline-block; animation: candiFlagSway 2.4s ease-in-out infinite; z-index:1;
}
@keyframes candiFlagSway{ 0%,100%{ transform:translateX(-50%) rotate(-8deg);} 50%{ transform:translateX(-50%) rotate(8deg);} }
@keyframes candiPop{
  0%{ opacity:0; transform:translateY(18px) scale(0.8); }
  60%{ opacity:1; transform:translateY(-4px) scale(1.06); }
  100%{ opacity:1; transform:translateY(0) scale(1); }
}
.candi-dino{
  position:absolute; right:10px; bottom:24px; width:80px;
  display:flex; align-items:flex-end; justify-content:center;
}
.candi-dino img{ width:100%; display:block; filter:drop-shadow(0 6px 8px rgba(74,31,52,0.2)); }
.candi-hammer{
  position:absolute; top:6px; left:-6px; font-size:22px; transform-origin:80% 90%; display:inline-block; z-index:2;
}
.candi-dino.hammering .candi-hammer{ animation: candiHammer .38s ease-in-out; }
.candi-dino.hammering img{ animation: candiDinoBob .38s ease-in-out; }
@keyframes candiHammer{
  0%{ transform:rotate(0deg); } 35%{ transform:rotate(-55deg); } 70%{ transform:rotate(10deg); } 100%{ transform:rotate(0deg); }
}
@keyframes candiDinoBob{ 0%,100%{ transform:translateY(0); } 40%{ transform:translateY(-5px); } }
.candi-think{
  position:absolute; top:-24px; right:-2px; font-size:18px; opacity:0; z-index:3;
  transform: translateY(6px) scale(0.6);
}
.candi-think.show{ animation: candiThinkPop .52s cubic-bezier(.3,1.6,.4,1) forwards; }
@keyframes candiThinkPop{
  0%{ opacity:0; transform: translateY(6px) scale(0.5); }
  40%{ opacity:1; transform: translateY(-4px) scale(1.15); }
  75%{ opacity:1; transform: translateY(-8px) scale(1); }
  100%{ opacity:0; transform: translateY(-14px) scale(0.9); }
}
.candi-msg{ text-align:center; font-size:12.5px; color:#a8768a; margin-top:10px; min-height:16px; }

/* cake */
.cake-wrap{ display:flex; flex-direction:column; align-items:center; margin: 10px 0 16px; }
.cake-wrap.shake{ animation: cakeShake .6s ease; }
@keyframes cakeShake{
  0%,100%{ transform: translateX(0) rotate(0deg); }
  10%{ transform: translateX(-7px) rotate(-2deg); }
  20%{ transform: translateX(7px) rotate(2deg); }
  30%{ transform: translateX(-7px) rotate(-2deg); }
  40%{ transform: translateX(7px) rotate(2deg); }
  50%{ transform: translateX(-5px) rotate(-1deg); }
  60%{ transform: translateX(5px) rotate(1deg); }
  70%{ transform: translateX(-3px); }
  80%{ transform: translateX(3px); }
  90%{ transform: translateX(-1px); }
}
.candles{ display:flex; gap:14px; margin-bottom:-6px; z-index:2; }
.candle{ font-size:26px; cursor:pointer; transition: transform .15s, opacity .3s; }
.candle.blown{ opacity:0.25; transform: translateY(4px) rotate(8deg); cursor:default; }
.cake{ width:220px; }
.cake-layer{ border-radius:14px; }
.cake-top{ height:34px; background: linear-gradient(180deg,#ffd6e2,#ffb8cc); border-radius:14px 14px 4px 4px; position:relative; }
.cake-mid{ height:44px; background: linear-gradient(180deg,var(--mint),var(--blush)); margin-top:-4px; border-radius:6px; box-shadow: inset 0 -6px 0 rgba(255,182,199,0.5);}
.cake-base{ height:50px; background: linear-gradient(180deg,#ffe8ee,var(--blush)); margin-top:-4px; border-radius:4px 4px 16px 16px; box-shadow: inset 0 -8px 0 rgba(255,182,199,0.5);}
.cake-hint{ text-align:center; font-size:12.5px; color:#a8768a; margin-top:10px; }

/* catch love game */
#catchArea{
  position:relative; width:100%; height:320px; background:var(--mint); border-radius:18px;
  border:2px solid var(--blush); overflow:hidden; margin:10px 0 12px; touch-action:none;
  contain: layout paint;
}
.catch-photo-bg{
  position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index:0;
  display:grid; grid-template-columns:repeat(9,1fr); grid-template-rows:repeat(4,1fr);
  gap:3px; padding:4px; background:#fbe8d3; box-sizing:border-box;
}
.catch-photo-frame{
  position:relative; overflow:hidden; border-radius:3px; background:#fff;
}
.catch-photo-frame img{
  width:100%; height:100%; object-fit:cover; display:block;
  filter:saturate(0.9) brightness(1.03);
}
.catch-photo-wash{
  position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index:1;
  background: linear-gradient(180deg, rgba(255,240,244,0.6), rgba(255,247,235,0.6));
  pointer-events:none;
}
#catchBasket{
  position:absolute; bottom:0; left:0; top:auto;   /* bottom harus sama dengan CATCH_DINO_BOTTOM di script.js (0 = nempel di dasar) */
  width:60px; height:120px; user-select:none; z-index:3;
  will-change: transform;
  line-height:1;
  pointer-events:none;
}
#catchBasket img{ display:block; width:100%; height:100%; transform-origin:50% 100%; -webkit-user-drag:none; }
#catchBasket img.catch-pop{ animation: catchPop .3s ease-out; }
@keyframes catchPop{
  0%{ transform:scale(1,1); }
  35%{ transform:scale(1.09,.92); }
  70%{ transform:scale(.97,1.05); }
  100%{ transform:scale(1,1); }
}
.catch-heart{
  position:absolute; left:0; top:0; font-size:28px; pointer-events:none; z-index:2;
  will-change: transform;
  line-height:1;
}
.catch-score{ text-align:center; font-weight:700; font-size:15px; color:var(--coral-dark); margin-bottom:8px; }
.catch-score.bad{ color:#d62839; animation:catchScoreBad .7s ease; }
@keyframes catchScoreBad{ 0%,100%{ transform:scale(1); } 30%{ transform:scale(1.18); } }
/* bom */
.catch-bomb .bomb-face{ display:inline-block; transform-origin:50% 60%; animation:bombWobble .7s ease-in-out infinite; filter:drop-shadow(0 0 5px rgba(255,80,60,0.6)); }
@keyframes bombWobble{ 0%,100%{ transform:rotate(-14deg); } 50%{ transform:rotate(14deg); } }
.catch-boom{ position:absolute; z-index:4; font-size:56px; line-height:1; pointer-events:none; animation:catchBoom .55s ease-out forwards; }
@keyframes catchBoom{
  0%{ opacity:1; transform:translate(-50%,-50%) scale(0.4); }
  60%{ opacity:1; transform:translate(-50%,-50%) scale(1.25); }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(1.5); }
}
.catch-pen{ position:absolute; z-index:4; font-weight:800; font-size:20px; color:#d62839; pointer-events:none;
  text-shadow:0 1px 0 #fff, 0 0 6px #fff; white-space:nowrap; animation:catchPen .9s ease-out forwards; }
@keyframes catchPen{
  from{ opacity:1; transform:translate(-50%,0); }
  to{ opacity:0; transform:translate(-50%,-46px); }
}
#catchArea.catch-hit{ animation:catchShake .4s ease; box-shadow:inset 0 0 44px rgba(230,50,60,0.55); }
@keyframes catchShake{
  0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-6px); } 40%{ transform:translateX(5px); }
  60%{ transform:translateX(-4px); } 80%{ transform:translateX(3px); }
}
#catchBasket img.catch-hurt{ animation:catchHurt .5s ease-out; }
@keyframes catchHurt{
  0%,100%{ transform:rotate(0); } 20%{ transform:rotate(-10deg); } 40%{ transform:rotate(9deg); }
  60%{ transform:rotate(-6deg); } 80%{ transform:rotate(4deg); }
}
@media (prefers-reduced-motion: reduce){
  .catch-bomb .bomb-face, #catchArea.catch-hit, #catchBasket img.catch-hurt{ animation:none; }
}
.catch-hint{ text-align:center; font-size:12.5px; color:#a8768a; margin-bottom:6px; }

/* hide & seek love */
#hideArea{
  position:relative; width:100%; height:300px; background:
    radial-gradient(circle at 20% 30%, var(--blush) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, var(--mint) 0%, transparent 45%),
    linear-gradient(160deg, var(--cream), #ffe3ea);
  border-radius:18px; border:2px solid var(--blush); overflow:hidden; margin:10px 0 12px;
  cursor:crosshair;
}
.hide-heart{
  position:absolute; font-size:22px; opacity:0.12; cursor:pointer;
  transition: opacity .2s, transform .25s; user-select:none;
  filter: blur(0.5px);
}
.hide-heart:hover{ opacity:0.35; transform: scale(1.15); }
.hide-heart.found{
  opacity:1; filter:none; transform: scale(1.4);
  animation: popFound .45s ease; pointer-events:none;
}
@keyframes popFound{
  0%{ transform: scale(0.6); }
  60%{ transform: scale(1.55); }
  100%{ transform: scale(1.4); }
}
.hide-decoy{
  position:absolute; font-size:18px; opacity:0.08; pointer-events:none;
}

/* memory match */
#memGrid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px;
  max-width:360px; margin:10px auto 14px;
}
.mem-card{
  aspect-ratio:3/4; border-radius:12px; cursor:pointer;
  position:relative; perspective:600px; user-select:none;
}
.mem-inner{
  width:100%; height:100%; position:relative;
  transition: transform .35s; transform-style:preserve-3d;
}
.mem-card.flipped .mem-inner, .mem-card.matched .mem-inner{ transform: rotateY(180deg); }
.mem-face{
  position:absolute; inset:0; border-radius:12px; backface-visibility:hidden;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 12px rgba(74,31,52,0.12);
}
.mem-back{
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color:#fff; font-size:28px;
}
.mem-front{
  background:var(--mint); transform: rotateY(180deg); overflow:hidden;
}
.mem-front img{ width:100%; height:100%; object-fit:cover; }
.mem-card.matched{ pointer-events:none; opacity:0.92; }

/* maze */
#mazeWrap{ display:flex; justify-content:center; margin:10px 0 8px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
#mazeGrid{
  display:grid; gap:1.5px; background:var(--blush); padding:4px; border-radius:12px;
  box-shadow:0 6px 16px rgba(74,31,52,0.1);
}
.maze-cell{
  width:19px; height:19px; border-radius:4px;
  display:flex; align-items:center; justify-content:center; font-size:11px;
  background:var(--cream);
}
.maze-cell.wall{ background:var(--coral-dark); opacity:0.85; }
.maze-cell.path{ background:var(--mint); }
.maze-cell.player{ background:#ffe3ea; position:relative; z-index:2; }
.maze-cell.player::after{
  content:''; position:absolute; left:50%; bottom:-1px; width:17px; height:28px; transform:translateX(-50%);
  background:url(assets/dino-sprite.webp) center bottom / contain no-repeat; pointer-events:none;
}
.maze-cell.goal{ background:#fff3c4; font-size:13px; }
.maze-cell.ghost{ background:#e9d9ff; font-size:13px; animation: mazeGhostPulse 0.7s ease-in-out infinite; }
@keyframes mazeGhostPulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.15); } }
.maze-controls{ display:flex; flex-direction:column; align-items:center; gap:6px; margin:8px 0 4px; }
.maze-row{ display:flex; gap:8px; }
.maze-btn{
  width:48px; height:40px; border-radius:12px; border:2px solid var(--blush);
  background:var(--cream); font-size:18px; cursor:pointer; color:var(--plum); font-weight:700;
}
.maze-btn:active{ background:var(--coral); color:#fff; border-color:transparent; }

/* undangan special */
.invite-card{
  background: linear-gradient(165deg, var(--cream) 0%, var(--mint) 50%, #ffe8ee 100%);
  border: 2px solid var(--blush); border-radius: 22px; padding: 26px 22px;
  margin: 8px 0 6px; text-align: center; position: relative;
  box-shadow: 0 12px 32px rgba(225,76,114,0.12);
}
.invite-badge{
  display:inline-block; background: linear-gradient(135deg, var(--gold), #d99420);
  color:var(--plum); font-size:11px; font-weight:700; letter-spacing:1.5px;
  text-transform:uppercase; padding:6px 14px; border-radius:999px; margin-bottom:12px;
}
.invite-title{
  font-family:'Fraunces',serif; font-size:clamp(22px,4.5vw,28px);
  color:var(--plum); margin:0 0 10px; text-align:center;
}
.invite-lead{
  font-size:14px; line-height:1.65; color:var(--muted); margin:0 0 18px; text-align:center;
}
.invite-details{
  background:#fff; border-radius:16px; padding:14px 16px; margin:0 0 16px;
  border:1px solid var(--blush); text-align:left;
}
.invite-row{
  display:flex; align-items:flex-start; gap:12px; padding:10px 0;
  border-bottom:1px dashed var(--blush);
}
.invite-row:last-child{ border-bottom:none; padding-bottom:2px; }
.invite-row:first-child{ padding-top:2px; }
.invite-icon{ font-size:20px; line-height:1.2; flex-shrink:0; }
.invite-label{ font-size:11px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase; color:var(--coral-dark); }
.invite-value{ font-size:14.5px; font-weight:600; color:var(--plum); margin-top:2px; }
.invite-link{ color:var(--coral-dark); text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1.5px; }
.invite-place{
  display:block; margin:0 0 16px; border-radius:16px; overflow:hidden;
  border:1px solid var(--blush); background:#fff; text-decoration:none;
  box-shadow:0 6px 18px rgba(0,0,0,0.06);
}
.invite-place img{ display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; background:var(--mint); }
.invite-place-cap{
  display:block; padding:10px 12px; font-size:13px; font-weight:700;
  color:var(--coral-dark); text-align:center;
}
.invite-note{
  font-size:13.5px; line-height:1.7; color:var(--plum); margin:0 0 14px; text-align:left;
  background:var(--cream); border-radius:14px; padding:14px 16px; border:1px solid var(--blush);
}
.invite-from{
  font-size:13.5px; color:var(--muted); line-height:1.6; text-align:right;
}
.invite-from b{ font-family:'Fraunces',serif; font-size:17px; color:var(--coral-dark); font-style:italic; }

/* final letter */
.final-msg{ font-size:14px; line-height:1.6; color:var(--plum); background:var(--mint); border-radius:16px; padding:14px 14px; border:1px solid var(--blush); margin:10px 0 4px; text-align:left;}
.final-msg b{ color: var(--coral-dark); }
.sig{ text-align:right; font-family:'Fraunces',serif; font-style:italic; margin-top:8px; color: var(--coral-dark); font-size:17px;}

/* kartu penutup, didesain biar enak buat discreenshot */
.share-card{
  position:relative; background: linear-gradient(160deg,var(--cream),var(--mint));
  border-radius:24px; padding:24px 18px 18px; margin-top:6px;
  border:1.5px solid var(--blush); box-shadow:0 14px 34px rgba(74,31,52,0.16);
}

/* pita bunting "HAPPY BIRTHDAY" bergoyang di atas kartu penutup */
.bunting{
  display:flex; flex-direction:column; align-items:center; gap:2px; margin:2px 0 12px; padding:0;
}
.bunting-row{ display:flex; justify-content:center; gap:3px; flex-wrap:nowrap; }
.bunting .flag{
  --fc: var(--coral);
  width:clamp(24px,7.6vw,30px); height:clamp(30px,9.4vw,38px);
  background: var(--fc);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  display:flex; align-items:flex-start; justify-content:center;
  padding-top:6px;
  font-family:'Fraunces',serif; font-weight:700; font-size:15px; color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,0.2);
  transform-origin: top center;
  animation: buntingSway 2.6s ease-in-out infinite;
  box-shadow:0 4px 8px rgba(74,31,52,0.15);
}
.bunting .flag:nth-child(odd){ --fc: var(--coral); animation-delay:0s; }
.bunting .flag:nth-child(3n){ --fc: var(--gold); animation-delay:.15s; }
.bunting .flag:nth-child(4n){ --fc: #e14c72; animation-delay:.3s; }
.bunting .flag:nth-child(5n){ --fc: #9c7bd6; animation-delay:.45s; }
@keyframes buntingSway{
  0%,100%{ transform: rotate(-4deg); }
  50%{ transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce){ .bunting .flag{ animation:none; } }
@media (max-width:380px){ .bunting .flag{ font-size:12px; padding-top:4px; } }
.share-card-corner{ position:absolute; width:22px; height:22px; opacity:0.55; }
.share-card-corner.tl{ top:12px; left:12px; border-top:2px solid var(--coral); border-left:2px solid var(--coral); border-radius:6px 0 0 0; }
.share-card-corner.tr{ top:12px; right:12px; border-top:2px solid var(--coral); border-right:2px solid var(--coral); border-radius:0 6px 0 0; }
.share-card-corner.bl{ bottom:12px; left:12px; border-bottom:2px solid var(--coral); border-left:2px solid var(--coral); border-radius:0 0 0 6px; }
.share-card-corner.br{ bottom:12px; right:12px; border-bottom:2px solid var(--coral); border-right:2px solid var(--coral); border-radius:0 0 6px 0; }
.share-card-label{ text-align:center; font-size:12px; letter-spacing:2px; text-transform:uppercase; color:var(--coral-dark); font-weight:700; margin-bottom:4px; }
.share-card-title{ text-align:center; font-family:'Fraunces',serif; font-weight:600; font-size:clamp(24px,5vw,32px); margin:0 0 2px; color:var(--plum); line-height:1.2; }
.share-card-footer{ text-align:center; font-size:12px; letter-spacing:1px; color:#c48ca0; margin-top:10px; font-weight:600; }
#saveImgBtn:disabled{ opacity:0.5; }

#typewriter{ font-size:15px; line-height:1.8; color:var(--plum); text-align:left; min-height:140px; }
.cursor{ display:inline-block; width:2px; background:var(--coral-dark); animation: blink 0.8s infinite; margin-left:1px; }
@keyframes blink{ 50%{opacity:0;} }

#confettiCanvas{ position:fixed; inset:0; pointer-events:none; z-index:60; }

/* custom cursor */
#cursorHeart{
  position:fixed; top:0; left:0; font-size:20px; pointer-events:none; z-index:9999;
  transform:translate(-50%,-50%); transition: transform .05s linear, scale .12s ease, opacity .2s ease;
  opacity:0; will-change:transform;
}
body.custom-cursor-on{ cursor:none; }
body.custom-cursor-on a, body.custom-cursor-on button, body.custom-cursor-on [onclick],
body.custom-cursor-on input, body.custom-cursor-on .candle, body.custom-cursor-on .gift-box,
body.custom-cursor-on .envelope, body.custom-cursor-on .pz-tile, body.custom-cursor-on .polaroid,
body.custom-cursor-on .q-opt{ cursor:none; }
body.custom-cursor-on #cursorHeart{ opacity:1; }
#cursorHeart.pressed{ transform:translate(-50%,-50%) scale(0.7); }
.cursor-pulse{
  position:fixed; width:12px; height:12px; border-radius:50%;
  background: rgba(255,111,145,0.45); pointer-events:none; z-index:9998;
  transform: translate(-50%,-50%) scale(1); animation: cursorPulse .5s ease-out forwards;
}
@keyframes cursorPulse{ to{ transform:translate(-50%,-50%) scale(4); opacity:0; } }
@media (hover:none), (pointer:coarse){ #cursorHeart{ display:none; } }
footer.note{ font-size:11px; color:#c48ca0; margin-top:20px; letter-spacing:0.3px; }

/* developer skip bar */
#devBar{
  position:fixed; bottom:16px; left:50%; transform:translateX(-50%);
  background:rgba(74,31,52,0.92); color:#fff; padding:10px 16px; border-radius:999px;
  display:none; align-items:center; gap:10px; z-index:100; font-size:13px; font-weight:600;
  box-shadow:0 8px 24px rgba(0,0,0,0.25);
  max-width:94vw; flex-wrap:wrap; justify-content:center;
}
#devBar button{
  appearance:none; border:none; cursor:pointer; font-family:'Quicksand',sans-serif;
  font-weight:700; font-size:12px; color:var(--plum); background:#fff; padding:7px 14px;
  border-radius:999px;
}
#devBar button:hover{ background:var(--gold); }
.dev-bar-sep{ width:1px; height:18px; background:rgba(255,255,255,0.25); }
.dev-bar-theme-label{
  font-size:11px; font-weight:700; min-width:66px; text-align:center;
  background:rgba(255,255,255,0.15); padding:5px 9px; border-radius:999px;
  white-space:nowrap;
}

/* dev-only: panel ganti tema & lagu manual (di kartu countdown) */
.dev-theme-panel{
  margin-top:18px; padding:14px 16px; border-radius:16px;
  background:rgba(74,31,52,0.92); color:#fff; text-align:left;
  box-shadow:0 8px 24px rgba(0,0,0,0.2);
}
.dev-theme-panel.hidden{ display:none; }
.dev-theme-title{ font-size:12px; font-weight:700; letter-spacing:0.5px; margin-bottom:10px; opacity:0.85; }
.dev-carousel-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.dev-carousel-row + .dev-carousel-row{ margin-top:10px; }
.dev-carousel-label{ font-size:12.5px; font-weight:600; opacity:0.9; }
.dev-carousel{ display:flex; align-items:center; gap:8px; }
.dev-carousel-btn{
  appearance:none; border:none; cursor:pointer; font-family:'Quicksand',sans-serif;
  font-weight:700; font-size:15px; line-height:1; color:var(--plum); background:#fff;
  width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  transition: transform 0.15s ease;
}
.dev-carousel-btn:hover{ background:var(--gold); }
.dev-carousel-btn:active{ transform: scale(0.9); }
.dev-carousel-current{
  font-size:12px; font-weight:700; min-width:88px; text-align:center; background:rgba(255,255,255,0.15);
  padding:5px 10px; border-radius:999px;
}
.dev-carousel-hint{ font-size:11px; opacity:0.75; margin:10px 0 0; line-height:1.5; }

@media (prefers-reduced-motion: reduce){ .amb, .card{ animation:none !important; } }

/* ========== COUNTDOWN WAIT FUN ========== */
.wait-fun{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--blush);
}
.music-row{
  display:flex;
  justify-content:center;
  margin-bottom:16px;
}
.music-btn{
  appearance:none; border:none; cursor:pointer;
  font-family:'Quicksand',sans-serif; font-weight:700; font-size:14px;
  color:var(--plum); background:var(--mint);
  border:1.5px solid var(--blush); border-radius:999px;
  padding:10px 18px; display:inline-flex; align-items:center; gap:8px;
  box-shadow:0 4px 14px rgba(255,111,145,0.15);
  transition: transform .15s ease, background .2s;
}
.music-btn:hover{ background:#ffe3ea; transform:scale(1.03); }
.music-btn.playing{
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color:#fff; border-color:transparent;
}
.wait-section{ text-align:center; }
.wait-title{
  font-family:'Fraunces',serif; font-size:17px; color:var(--plum);
  margin:0 0 4px; font-weight:600;
}
.wait-hint{ font-size:13px; color:#a8768a; margin:0 0 12px; }
.heart-arena{
  position:relative;
  height:160px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--mint) 100%);
  border-radius:18px;
  border:1px solid var(--blush);
  overflow:hidden;
  margin-bottom:12px;
}
.heart-score{
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  font-size:12.5px; font-weight:700; color:var(--coral-dark);
  background:rgba(255,255,255,0.85); padding:4px 12px; border-radius:999px;
  z-index:2; pointer-events:none;
}
.floating-heart{
  position:absolute;
  font-size:28px;
  cursor:pointer;
  user-select:none;
  animation: heartFloat linear forwards;
  transition: transform .15s ease;
  z-index:1;
  filter: drop-shadow(0 2px 4px rgba(225,76,114,0.25));
}
.floating-heart:hover{ transform:scale(1.25); }
.floating-heart.pop{
  animation: heartPop .4s ease forwards;
  pointer-events:none;
}
@keyframes heartFloat{
  0%{ transform:translateY(0) scale(0.6); opacity:0; }
  12%{ opacity:1; transform:translateY(-8px) scale(1); }
  100%{ transform:translateY(-170px) scale(0.9); opacity:0.15; }
}
@keyframes heartPop{
  0%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.6); opacity:0.8; }
  100%{ transform:scale(0.2); opacity:0; }
}
.wait-actions{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-bottom:10px;
}
.btn.soft{
  background:var(--mint); color:var(--coral-dark);
  border:1.5px solid var(--blush); box-shadow:none;
  padding:10px 16px; font-size:13.5px;
}
.btn.soft:hover{
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color:#fff; border-color:transparent;
  transform:translateY(-1px);
}
.hug-message{
  font-size:14px; line-height:1.55; color:var(--plum);
  background:var(--mint); border-radius:14px; padding:12px 16px;
  border:1px solid var(--blush); margin-top:8px;
  animation: hugIn .45s cubic-bezier(.2,.9,.25,1);
}
@keyframes hugIn{
  from{ opacity:0; transform:translateY(10px) scale(0.96); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
.hug-message.big-heart{
  font-size:42px; text-align:center; padding:18px;
}

/* daily message + streak */
.daily-msg{
  margin: 16px 0 8px;
  font-size:14px; line-height:1.55; color:var(--plum);
  background: linear-gradient(135deg, var(--mint), var(--mint));
  border-radius:14px; padding:12px 16px;
  border:1px solid var(--blush);
  text-align:center;
  font-weight:500;
}
.visit-streak{
  font-size:12.5px; color:#a8768a; text-align:center;
  margin-bottom:4px; font-weight:600;
}

/* bunny character */
.bunny-wrap{
  display:flex; flex-direction:column; align-items:center;
  margin: 14px 0 18px;
}
.bunny-btn{
  appearance:none; border:none; background:transparent; cursor:pointer;
  padding:0; line-height:1;
  transition: transform .15s ease;
}
.bunny-btn:active{ transform:scale(0.92); }
.bunny-face{
  font-size:64px;
  display:inline-block;
  filter: drop-shadow(0 4px 10px rgba(225,76,114,0.2));
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.bunny-face.bounce{
  animation: bunnyBounce .5s ease;
}
.bunny-face.happy{
  animation: bunnyHappy .6s ease;
}
@keyframes bunnyBounce{
  0%,100%{ transform:translateY(0) rotate(0); }
  30%{ transform:translateY(-14px) rotate(-6deg); }
  60%{ transform:translateY(-4px) rotate(4deg); }
}
@keyframes bunnyHappy{
  0%,100%{ transform:scale(1); }
  25%{ transform:scale(1.25) rotate(-8deg); }
  50%{ transform:scale(1.15) rotate(8deg); }
  75%{ transform:scale(1.2) rotate(-4deg); }
}
.bunny-hint{
  font-size:12.5px; color:#a8768a; margin:6px 0 0; font-weight:600;
  min-height:18px; transition: opacity .3s;
}

/* spoiler polaroid blur */
.spoiler-polaroid{
  display:flex; flex-direction:column; align-items:center;
  margin: 0 0 18px;
}
.spoiler-frame{
  position:relative;
  background:#fff;
  padding:8px 8px 22px 8px;
  border-radius:6px;
  box-shadow:0 8px 20px rgba(74,31,52,0.18);
  width:120px;
  transform: rotate(-3deg);
  transition: transform .25s ease;
  cursor:pointer;
  z-index:5;
  pointer-events:auto;
  -webkit-tap-highlight-color: transparent;
}
.spoiler-frame:hover{ transform: rotate(0deg) scale(1.03); }
.spoiler-frame.shake{
  animation: spoilerShake .45s ease;
}
@keyframes spoilerShake{
  0%,100%{ transform: rotate(-3deg) translateX(0); }
  20%{ transform: rotate(-5deg) translateX(-6px); }
  40%{ transform: rotate(2deg) translateX(6px); }
  60%{ transform: rotate(-4deg) translateX(-4px); }
  80%{ transform: rotate(1deg) translateX(3px); }
}
.spoiler-img{
  width:100%; height:140px; object-fit:cover;
  border-radius:3px;
  filter: blur(7px) brightness(0.95);
  display:block;
  user-select:none; pointer-events:none;
  transition: opacity .28s ease;
}
.spoiler-overlay{
  position:absolute; inset:8px 8px 22px 8px;
  display:flex; align-items:center; justify-content:center;
  font-size:28px;
  background: rgba(255,248,240,0.25);
  border-radius:3px;
  pointer-events:none;
}

/* spoiler modal popup */
.spoiler-modal{
  position:fixed; inset:0; z-index:80;
  background: rgba(74,31,52,0.45);
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  animation: spoilerModalIn .25s ease;
}
.spoiler-modal.hidden{ display:none !important; }
@keyframes spoilerModalIn{
  from{ opacity:0; }
  to{ opacity:1; }
}
.spoiler-modal-card{
  background: var(--cream);
  border-radius:22px;
  padding:22px 20px 18px;
  text-align:center;
  box-shadow: 0 20px 50px rgba(74,31,52,0.25);
  border:1px solid var(--blush);
  max-width:280px; width:100%;
  animation: spoilerCardIn .35s cubic-bezier(.2,.9,.25,1);
}
@keyframes spoilerCardIn{
  from{ opacity:0; transform: scale(0.9) translateY(12px); }
  to{ opacity:1; transform: scale(1) translateY(0); }
}
.spoiler-modal-frame{
  position:relative;
  background:#fff;
  padding:10px 10px 28px 10px;
  border-radius:8px;
  box-shadow:0 8px 20px rgba(74,31,52,0.15);
  margin:0 auto 14px;
  width:160px;
}
.spoiler-modal-img{
  width:100%; height:190px; object-fit:cover;
  border-radius:4px;
  filter: blur(10px) brightness(0.95);
  display:block;
  user-select:none; pointer-events:none;
}
.spoiler-modal-lock{
  position:absolute; inset:10px 10px 28px 10px;
  display:flex; align-items:center; justify-content:center;
  font-size:36px;
  background: rgba(255,248,240,0.2);
  border-radius:4px;
  pointer-events:none;
}
.spoiler-modal-text{
  font-size:14.5px; font-weight:700; color:var(--plum);
  margin:0 0 14px; line-height:1.4;
}

/* ========== EDGE MASCOT (keliling tepi layar) ========== */
.edge-mascot{
  position:fixed;
  z-index:90;
  pointer-events:none;
  width:56px; height:56px;
  display:flex; flex-direction:column; align-items:center;
  left:0; top:0;
  contain: layout style;
  backface-visibility: hidden;
  overflow: visible;
}
.edge-mascot.hidden{ display:none !important; }
.edge-char{
  font-size:36px;
  line-height:1;
  filter: drop-shadow(0 3px 8px rgba(74,31,52,0.25));
  animation: edgeBob 1.2s ease-in-out infinite;
  transform-origin: center bottom;
  will-change: transform;
}
.edge-mascot.flip .edge-char{
  animation-name: edgeBobFlip;
}
@keyframes edgeBob{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}
@keyframes edgeBobFlip{
  0%,100%{ transform: scaleX(-1) translateY(0); }
  50%{ transform: scaleX(-1) translateY(-3px); }
}
.edge-bubble{
  position:absolute;
  background:#fff;
  color:var(--plum);
  font-size:11.5px;
  font-weight:600;
  font-family:'Quicksand',sans-serif;
  line-height:1.35;
  padding:8px 11px;
  border-radius:14px;
  border:1.5px solid var(--blush);
  box-shadow:0 6px 16px rgba(74,31,52,0.12);
  max-width:min(190px, 70vw);
  white-space:normal;
  text-align:center;
  min-width:90px;
  width:max-content;
  pointer-events:none;
  animation: bubblePop .3s cubic-bezier(.2,.9,.25,1);
  z-index:2;
  /* default: di atas, tengah */
  bottom: calc(100% + 8px);
  left:50%;
  right:auto;
  top:auto;
  transform: translateX(-50%);
}
.edge-bubble.hidden{ display:none !important; }
.edge-bubble::after{
  content:'';
  position:absolute;
  border:6px solid transparent;
}
/* atas karakter (default) */
.edge-bubble.pos-above{
  bottom: calc(100% + 8px); top:auto; left:50%; right:auto;
  transform: translateX(-50%);
}
.edge-bubble.pos-above::after{
  top:100%; left:50%; bottom:auto; right:auto;
  transform:translateX(-50%);
  border-top-color:#fff;
  border-bottom-color:transparent; border-left-color:transparent; border-right-color:transparent;
}
/* bawah karakter */
.edge-bubble.pos-below{
  top: calc(100% + 8px); bottom:auto; left:50%; right:auto;
  transform: translateX(-50%);
}
.edge-bubble.pos-below::after{
  bottom:100%; top:auto; left:50%; right:auto;
  transform:translateX(-50%);
  border-bottom-color:#fff;
  border-top-color:transparent; border-left-color:transparent; border-right-color:transparent;
}
/* kanan karakter (saat maskot di tepi kiri) */
.edge-bubble.pos-right{
  left: calc(100% + 8px); right:auto; top:50%; bottom:auto;
  transform: translateY(-50%);
}
.edge-bubble.pos-right::after{
  right:100%; left:auto; top:50%; bottom:auto;
  transform:translateY(-50%);
  border-right-color:#fff;
  border-left-color:transparent; border-top-color:transparent; border-bottom-color:transparent;
}
/* kiri karakter (saat maskot di tepi kanan) */
.edge-bubble.pos-left{
  right: calc(100% + 8px); left:auto; top:50%; bottom:auto;
  transform: translateY(-50%);
}
.edge-bubble.pos-left::after{
  left:100%; right:auto; top:50%; bottom:auto;
  transform:translateY(-50%);
  border-left-color:#fff;
  border-right-color:transparent; border-top-color:transparent; border-bottom-color:transparent;
}
@keyframes bubblePop{
  from{ opacity:0; transform: scale(0.85); }
  to{ opacity:1; transform: scale(1); }
}
.edge-bubble.pos-above{ animation-name: bubblePopX; }
.edge-bubble.pos-below{ animation-name: bubblePopX; }
.edge-bubble.pos-left{ animation-name: bubblePopY; }
.edge-bubble.pos-right{ animation-name: bubblePopY; }
@keyframes bubblePopX{
  from{ opacity:0; transform: translateX(-50%) scale(0.88); }
  to{ opacity:1; transform: translateX(-50%) scale(1); }
}
@keyframes bubblePopY{
  from{ opacity:0; transform: translateY(-50%) scale(0.88); }
  to{ opacity:1; transform: translateY(-50%) scale(1); }
}


/* ========== LOGIN PAGE ========== */
#gate-login{ position:relative; overflow:hidden; }

/* amplop pembuka */
.envelope-intro{
  position:absolute; inset:0; z-index:8; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(160deg,#ffd6e2,#ffb8cc);
  border-radius:28px; perspective:700px;
  transition: opacity .5s ease, visibility .5s;
}
.envelope-intro.opened{ opacity:0; visibility:hidden; pointer-events:none; }
.envelope-back{
  position:absolute; width:64%; max-width:230px; height:44%; max-height:150px;
  background:var(--mint); border-radius:10px; box-shadow:0 12px 26px rgba(74,31,52,0.28);
}
.envelope-flap{
  position:absolute; width:64%; max-width:230px; height:44%; max-height:150px;
  top:50%; left:50%; transform-origin:top center;
  transform: translate(-50%,-100%) rotateX(0deg);
  background: linear-gradient(160deg,#ff8fab,var(--coral));
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  border-radius:10px 10px 0 0;
  animation: flapOpen .7s ease forwards;
  animation-delay: .5s;
  transform-style: preserve-3d;
  box-shadow: 0 6px 14px rgba(74,31,52,0.2);
}
@keyframes flapOpen{ to{ transform: translate(-50%,-100%) rotateX(-150deg); } }
.envelope-seal-anim{
  position:relative; font-size:34px; z-index:2; opacity:0;
  animation: sealPop .5s ease forwards; animation-delay:.95s;
  filter: drop-shadow(0 4px 8px rgba(74,31,52,0.3));
}
@keyframes sealPop{ from{ opacity:0; transform:scale(0.5); } to{ opacity:1; transform:scale(1.1); } }

/* konten form muncul setelah amplop kebuka */
.login-content{ opacity:0; transform:translateY(10px); animation: loginReveal .6s ease forwards; animation-delay:1.2s; }
@keyframes loginReveal{ to{ opacity:1; transform:translateY(0); } }

/* overlay sukses (gembok kebuka) */
.login-success-overlay{
  position:absolute; inset:0; z-index:9; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(160deg,var(--cream),var(--mint));
  border-radius:28px; opacity:0; pointer-events:none;
  transition: opacity .25s ease;
}
.login-success-overlay.show{ opacity:1; pointer-events:auto; }
.lock-icon{ font-size:54px; animation: lockPop .5s cubic-bezier(.3,1.4,.5,1); filter: drop-shadow(0 6px 12px rgba(74,31,52,0.3)); }
@keyframes lockPop{ 0%{ transform:scale(0.5) rotate(-8deg); opacity:0; } 60%{ transform:scale(1.2) rotate(6deg); opacity:1; } 100%{ transform:scale(1) rotate(0deg); } }
.lock-icon.unlocked{ animation: lockShine .5s ease; }
@keyframes lockShine{ 0%{ transform:scale(1) rotate(0deg); } 40%{ transform:scale(1.3) rotate(-10deg); } 100%{ transform:scale(1) rotate(0deg); } }

/* shake + kedip merah pas salah login */
#gate-login.login-shake .login-content{ animation: loginShake .5s ease, loginReveal 0s; }
@keyframes loginShake{
  0%,100%{ transform: translateX(0); }
  15%{ transform: translateX(-9px); }
  30%{ transform: translateX(8px); }
  45%{ transform: translateX(-7px); }
  60%{ transform: translateX(6px); }
  75%{ transform: translateX(-4px); }
  90%{ transform: translateX(3px); }
}
#gate-login.login-shake{ animation: loginFlash .5s ease; }
@keyframes loginFlash{
  0%,100%{ box-shadow: var(--shadow); }
  30%{ box-shadow: 0 0 0 4px rgba(255,80,110,0.35), var(--shadow); }
}

.login-seal{
  font-size:48px; line-height:1; margin:0 auto 8px;
  filter: drop-shadow(0 6px 14px rgba(255,111,145,0.35));
  animation: sealBob 2.4s ease-in-out infinite;
}
@keyframes sealBob{
  0%,100%{ transform: translateY(0) rotate(-4deg); }
  50%{ transform: translateY(-6px) rotate(4deg); }
}
.login-lead{ margin-bottom:18px; }
.login-carousel{
  position:relative; width:112px; height:140px; margin:0 auto 18px;
  border-radius:14px; overflow:hidden; box-shadow:0 10px 20px rgba(74,31,52,0.22);
  border:3px solid #fff;
}
.login-carousel-img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  opacity:0; transition: opacity 1s ease;
}
.login-carousel-img.active{ opacity:1; }
@media (prefers-reduced-motion: reduce){ .login-carousel-img{ transition:none; } }
.remember-me{
  display:flex; align-items:center; gap:8px; justify-content:center;
  font-size:13px; color:var(--muted); font-weight:600;
  margin:-4px 0 14px; cursor:pointer; user-select:none;
}
.remember-me input[type="checkbox"]{
  width:16px; height:16px; accent-color:var(--coral-dark); cursor:pointer;
}
.login-hint{
  margin:16px 0 0; font-size:12px; color:#c48ca0; font-weight:600;
  letter-spacing:0.2px;
}
.login-deco{ position:absolute; inset:0; pointer-events:none; overflow:hidden; transition: transform 0.15s ease-out; }
.login-float{
  position:absolute; font-size:20px; opacity:0.45;
  animation: loginFloat 5s ease-in-out infinite;
  pointer-events:auto; cursor:pointer;
}
.login-float.f1{ top:8%; left:5%; animation-delay:0s; }
.login-float.f2{ top:10%; right:6%; animation-delay:1.1s; font-size:16px; }
.login-float.f3{ bottom:4%; left:6%; animation-delay:2s; font-size:18px; }
.login-float.f4{ bottom:2%; right:4%; animation-delay:0.6s; font-size:22px; }
@keyframes loginFloat{
  0%,100%{ transform: translateY(0) rotate(0deg); opacity:0.4; }
  50%{ transform: translateY(-6px) rotate(5deg); opacity:0.7; }
}
.login-float.popping{
  animation: loginPop .45s ease forwards !important;
  pointer-events:none;
}
.login-float.pause-float{
  animation-play-state: paused;
}
@keyframes loginPop{
  0%{ transform: scale(1) rotate(0deg); opacity:0.7; }
  40%{ transform: scale(1.6) rotate(-10deg); opacity:1; }
  100%{ transform: scale(0) rotate(20deg); opacity:0; }
}
.pop-particle{
  position:absolute; pointer-events:none; font-size:12px;
  animation: popParticle .6s ease-out forwards;
}
@keyframes popParticle{
  0%{ transform: translate(0,0) scale(1); opacity:1; }
  100%{ transform: translate(var(--px), var(--py)) scale(0.3); opacity:0; }
}

/* ---------- ch14: scratch card ---------- */
.scratch-wrap{ position:relative; margin:6px 0 8px; border-radius:20px; }
.scratch-message{
  position:relative; background:var(--cream); border-radius:20px; padding:28px 24px;
  border:1px solid var(--blush); box-shadow: var(--shadow);
  font-family:'Fraunces', serif; font-size:15.5px; line-height:1.8; color:var(--plum);
  text-align:left;
}
.scratch-message p{ margin:0; }
.scratch-canvas{
  position:absolute; inset:0; width:100%; height:100%;
  border-radius:20px; cursor:grab; touch-action:none;
  box-shadow: var(--shadow);
}
.scratch-canvas:active{ cursor:grabbing; }
.scratch-hint{
  margin:14px 0 0; font-size:13px; text-align:center; color:#a9647c; font-weight:600;
}

/* ---------- ch3: per-item timeline nav ---------- */
.tl-item-nav{ margin-top:16px; display:flex; justify-content:space-between; gap:10px; }
.tl-item-nav.nav-end{ justify-content:flex-end; }
.tl-item-nav.nav-start{ justify-content:flex-start; }
.btn.soft.tl-next-btn,
.btn.soft.tl-prev-btn{
  background:var(--mint); color:var(--coral-dark); box-shadow:none; border:2px solid #f3c3d1;
  padding:10px 20px; font-size:17px; line-height:1; min-width:48px;
}
.btn.soft.tl-next-btn:hover,
.btn.soft.tl-prev-btn:hover{ background:#ffe3ea; }

/* ---------- countdown: dynamic daily color theme ---------- */
#gate-countdown{
  --cdt-card:#fff8f0; --cdt-border:#ffe0ea; --cdt-accent:#ff6f91; --cdt-accent-dark:#e14c72;
  --cdt-text:#4a1f34; --cdt-muted:#7a4a5c; --cdt-box:#fff0f4; --cdt-box-border:#ffd7e2;
  --cdt-label:#a8768a; --cdt-gold:#f0b23a;
  background: var(--cdt-card);
  border-color: var(--cdt-border);
  transition: background 2.2s ease, border-color 2.2s ease;
}
#gate-countdown .eyebrow{ color: var(--cdt-accent-dark); transition: color 2.2s ease; }
#gate-countdown h1{ color: var(--cdt-text); transition: color 2.2s ease; }
#gate-countdown p.lead{ color: var(--cdt-muted); transition: color 2.2s ease; }
#gate-countdown .cd-box{ background: var(--cdt-box); border-color: var(--cdt-box-border); transition: background 2.2s ease, border-color 2.2s ease; }
#gate-countdown .cd-num{ color: var(--cdt-accent-dark); transition: color 2.2s ease; }
#gate-countdown .cd-label{ color: var(--cdt-label); transition: color 2.2s ease; }
#gate-countdown .cd-progress-track{ background: var(--cdt-box); border-color: var(--cdt-box-border); transition: background 2.2s ease, border-color 2.2s ease; }
#gate-countdown .cd-progress-fill{ background: linear-gradient(90deg, var(--cdt-accent), var(--cdt-gold), var(--cdt-accent)); background-size:250% 100%; transition: width 1s ease, background 2.2s ease; }
#gate-countdown .cd-progress-label{ color: var(--cdt-label); transition: color 2.2s ease; }
#gate-countdown .daily-msg{ background: linear-gradient(135deg, var(--cdt-box), var(--cdt-card)); border-color: var(--cdt-box-border); color: var(--cdt-text); transition: background 2.2s ease, border-color 2.2s ease, color 2.2s ease; }
#gate-countdown .visit-streak{ color: var(--cdt-label); transition: color 2.2s ease; }

.cd-backdrop{ position:fixed; inset:0; z-index:0; pointer-events:none; opacity:0; transition:opacity 1s ease; }
.cd-backdrop.active{ opacity:1; }
.cd-bg-layer{
  position:absolute; inset:0; opacity:0; filter:saturate(1.25);
  clip-path: circle(0% at 50% 10%);
  transition: opacity .12s ease, clip-path 1.3s cubic-bezier(.16,1,.3,1);
}
.cd-bg-layer.show{ opacity:1; clip-path: circle(150% at 50% 10%); }

/* transisi tema "wow": cincin warna yang ngeledak keluar dari tengah + percikan sparkle */
.cd-theme-burst{
  position:fixed; inset:0; z-index:3; pointer-events:none;
  display:flex; align-items:center; justify-content:center;
  --burst-accent:#ff8aa6; --burst-gold:#f0b23a;
}
.cd-burst-ring{
  position:absolute; width:16px; height:16px; border-radius:50%;
  border:3px solid var(--burst-accent); opacity:0;
}
.cd-burst-ring2{ border-color: var(--burst-gold); }
.cd-theme-burst.pulse .cd-burst-ring{ animation: cdBurstRing 1s cubic-bezier(.16,1,.3,1); }
.cd-theme-burst.pulse .cd-burst-ring2{ animation: cdBurstRing 1s cubic-bezier(.16,1,.3,1) .15s backwards; }
@keyframes cdBurstRing{
  0%{ width:16px; height:16px; opacity:0.95; }
  100%{ width:560px; height:560px; opacity:0; }
}
.cd-burst-spark{
  position:absolute; font-size:16px; opacity:0;
  animation: cdBurstSpark .9s ease-out forwards;
}
@keyframes cdBurstSpark{
  0%{ transform:translate(0,0) scale(0.4); opacity:1; }
  100%{ transform:translate(var(--sx), var(--sy)) scale(1.15); opacity:0; }
}

.cd-greeting-overlay{
  position:fixed; inset:0; z-index:70;
  display:flex; align-items:center; justify-content:center;
  background: rgba(74,31,52,0.22);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  opacity:0; transition: opacity .5s ease, backdrop-filter .5s ease;
  pointer-events:none;
}
.cd-greeting-overlay.show{ opacity:1; pointer-events:auto; }
.cd-greeting-overlay.hidden{ display:none; }
.cd-greeting-card{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:36px 42px; border-radius:26px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 24px 60px rgba(74,31,52,0.28), 0 2px 0 rgba(255,255,255,0.6) inset;
  border:1px solid rgba(255,255,255,0.8);
  font-weight:700; font-size:19px; color:var(--cdt-text,#4a1f34); text-align:center;
  transform: scale(0.85) translateY(10px);
  transition: transform .5s cubic-bezier(.2,.9,.25,1);
  max-width:86%;
}
.cd-greeting-overlay.show .cd-greeting-card{ transform: scale(1) translateY(0); }
.cd-greeting-icon{ font-size:40px; line-height:1; }
.cd-greeting-text{ line-height:1.4; }
.cd-final-card{ padding:42px 38px; }
.cd-final-num{
  font-family:'Fraunces',serif; font-weight:700; font-size:64px; line-height:1;
  color: var(--coral-dark,#e14c72); margin-top:6px;
}
.cd-final-start-btn{ margin-top:4px; }
@media (max-width:420px){
  .cd-greeting-card{ font-size:16px; padding:28px 26px; }
  .cd-greeting-icon{ font-size:34px; }
  .cd-final-num{ font-size:52px; }
}
@media (prefers-reduced-motion: reduce){
  .cd-bg-layer, .cd-backdrop, .cd-greeting-overlay, .cd-greeting-card, #gate-countdown{ transition-duration:.001ms !important; }
  .cd-theme-burst.pulse .cd-burst-ring{ animation:none !important; }
  .cd-burst-spark{ animation:none !important; opacity:0 !important; }
}

/* ---------- gate 3: pilih warna background ---------- */
.bg-deco{ position:absolute; inset:0; pointer-events:none; overflow:hidden; border-radius:28px; }
.bg-float{ position:absolute; font-size:20px; opacity:0.5; animation: bgFloat 5.5s ease-in-out infinite; }
.bg-float.bf1{ top:10%; left:7%; animation-delay:0s; font-size:20px; }
.bg-float.bf2{ top:16%; right:9%; animation-delay:0.7s; font-size:18px; }
.bg-float.bf3{ top:46%; left:4%; animation-delay:1.6s; font-size:16px; }
.bg-float.bf4{ top:50%; right:6%; animation-delay:2.3s; font-size:22px; }
.bg-float.bf5{ bottom:12%; left:14%; animation-delay:1.1s; font-size:18px; }
.bg-float.bf6{ bottom:16%; right:14%; animation-delay:1.9s; font-size:20px; }
@keyframes bgFloat{
  0%,100%{ transform: translateY(0) rotate(0deg); opacity:0.4; }
  50%{ transform: translateY(-12px) rotate(10deg); opacity:0.75; }
}
.bgc-preview{
  position:relative; margin:18px 0 20px; border-radius:20px; padding:26px 18px;
  border:2px dashed #ffcede; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  min-height:90px; background: linear-gradient(135deg,var(--cream),var(--mint)); transition: background 0.5s ease;
}
.bgc-preview.bgc-preview-active{ border-style:solid; border-color:#ffb6c9; }
.bgc-preview-emoji{ font-size:30px; animation: bgcPreviewPop 0.4s ease; }
@keyframes bgcPreviewPop{ 0%{ transform:scale(0.6) rotate(-10deg); opacity:0; } 100%{ transform:scale(1) rotate(0deg); opacity:1; } }
.bgc-preview-text{ font-size:13.5px; font-weight:700; color: var(--coral-dark); text-align:center; }
.bgc-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap:10px; margin:0 0 18px;
}
.bgc-swatch{
  position:relative; border:2px solid var(--blush); border-radius:16px; padding:14px 8px 12px;
  cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-family:'Quicksand', sans-serif; min-height:72px; justify-content:center;
}
.bgc-swatch:hover{ transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 20px rgba(74,31,52,0.14); }
.bgc-swatch:active{ transform: translateY(0) scale(0.98); }
.bgc-swatch.picked{ border-color: var(--coral-dark); box-shadow: 0 10px 24px rgba(225,76,114,0.28); }
.bgc-swatch.picked::after{
  content:'💖'; position:absolute; top:-8px; right:-6px; font-size:16px;
  animation: bgcPreviewPop 0.3s ease;
}
.bgc-swatch-emoji{ font-size:26px; }
.bgc-swatch-label{ font-size:11.5px; font-weight:700; color: var(--plum); }
.bgc-custom{
  background:var(--mint); border:1px solid var(--blush); border-radius:16px; padding:14px 16px; margin:0 0 16px; text-align:left;
}
.bgc-custom-label{ display:block; font-size:12.5px; font-weight:700; color: var(--coral-dark); margin-bottom:8px; }
.bgc-custom-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.bgc-custom-row input[type="color"]{
  width:48px; height:48px; border:2px solid var(--blush); border-radius:12px; padding:0; cursor:pointer; background:transparent;
}
.bgc-custom-hint{ font-size:12px; color:#8a5468; flex:1; min-width:150px; }
.bgc-status{ font-size:12.5px; font-weight:600; color:#a8768a; margin:0 0 6px; }

/* ========== Love emoji button (🤔) — menarik biar mau diklik ========== */
.love-emoji-btn{
  appearance: none;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #fff5f8 0%, #ffe3ea 50%, #ffd0dc 100%);
  border: 2.5px solid #ff6f91;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 6px 18px rgba(225,76,114,0.28),
    0 0 0 0 rgba(255,111,145,0.4);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
  animation: loveEmojiWiggle 2.4s ease-in-out infinite;
  position: relative;
}
.love-emoji-btn::after{
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255,111,145,0.35);
  animation: loveEmojiRing 2.4s ease-out infinite;
  pointer-events: none;
}
.love-emoji-btn:hover{
  transform: scale(1.18) rotate(-8deg);
  box-shadow: 0 10px 28px rgba(225,76,114,0.4);
  background: linear-gradient(145deg, #ffe3ea, #ffb6c9);
}
.love-emoji-btn:active{
  transform: scale(0.92);
  animation: none;
}
@keyframes loveEmojiWiggle{
  0%, 100%{ transform: rotate(0deg) scale(1); }
  15%{ transform: rotate(-12deg) scale(1.06); }
  30%{ transform: rotate(10deg) scale(1.04); }
  45%{ transform: rotate(-6deg) scale(1.02); }
  60%{ transform: rotate(4deg) scale(1); }
  75%{ transform: rotate(-2deg) scale(1); }
}
@keyframes loveEmojiRing{
  0%{ transform: scale(0.85); opacity: 0.7; }
  70%{ transform: scale(1.35); opacity: 0; }
  100%{ transform: scale(1.35); opacity: 0; }
}

/* Popup "Kamu masih nanya?" */
.love-ask-popup{
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(40,15,28,0.25);
  animation: loveAskIn 0.35s cubic-bezier(.2,.9,.25,1);
}
.love-ask-popup.hidden{ display: none !important; }
.love-ask-popup.love-ask-out{
  animation: loveAskOut 0.35s ease forwards;
}
.love-ask-card{
  background: linear-gradient(160deg, #fff8fb 0%, #ffe8ef 100%);
  border: 2px solid #ff6f91;
  border-radius: 22px;
  padding: 22px 28px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(225,76,114,0.28);
  min-width: 220px;
  max-width: 90vw;
}
.love-ask-emoji{
  font-size: 42px;
  display: block;
  margin-bottom: 8px;
  animation: loveAskBounce 0.6s ease;
}
.love-ask-text{
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #e14c72;
  letter-spacing: 0.02em;
}
@keyframes loveAskIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}
@keyframes loveAskOut{
  from{ opacity: 1; }
  to{ opacity: 0; }
}
@keyframes loveAskBounce{
  0%{ transform: scale(0.4); }
  60%{ transform: scale(1.2); }
  100%{ transform: scale(1); }
}

.love-running-overlay{
  position: fixed;
  left: 0;
  right: 0;
  top: 28%;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
  padding: 18px 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,246,250,0.92) 12%,
    rgba(255,246,250,0.95) 50%,
    rgba(255,246,250,0.92) 88%,
    transparent 100%);
  box-shadow: 0 8px 32px rgba(225,76,114,0.18);
  animation: loveOverlayIn 0.45s cubic-bezier(.2,.9,.25,1);
}
.love-running-overlay.hidden{ display: none; }
.love-running-overlay.fade-out{
  animation: loveOverlayOut 0.5s ease forwards;
}

@keyframes loveOverlayIn{
  from{ opacity:0; transform: translateY(20px) scale(0.96); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}
@keyframes loveOverlayOut{
  from{ opacity:1; transform: translateY(0); }
  to{ opacity:0; transform: translateY(-12px); }
}

.love-running-track{
  display: flex;
  width: max-content;
  animation: loveMarquee 22s linear infinite;
  will-change: transform;
}

.love-running-text{
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: clamp(28px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding: 0 0.5em;
  color: #e14c72;
  text-shadow:
    0 0 12px rgba(255,111,145,0.55),
    0 0 28px rgba(240,178,58,0.35),
    0 3px 0 #ffb6c9,
    0 5px 14px rgba(225,76,114,0.4);
  filter: drop-shadow(0 2px 4px rgba(74,31,52,0.15));
  animation: lovePulse 1.8s ease-in-out infinite;
}
@keyframes lovePulse{
  0%, 100%{ transform: scale(1); filter: drop-shadow(0 2px 4px rgba(74,31,52,0.15)); }
  50%{ transform: scale(1.03); filter: drop-shadow(0 4px 12px rgba(225,76,114,0.35)); }
}

@keyframes loveMarquee{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}
/* (loveGradientShift removed — pakai lovePulse + solid color biar emoji tetap kelihatan) */

/* confetti/balon di atas card, running text di atas balon biar kebaca */
.love-running-overlay{ z-index: 100; }
#confettiCanvas{ z-index: 90 !important; }

/* ========== Chat panel (countdown + penutup) ========== */
.chat-fab{
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 120;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #ff6f91, #e14c72);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(225,76,114,0.45);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
}
.chat-fab.hidden{ display: none !important; }
.chat-fab:hover{ transform: scale(1.1); box-shadow: 0 12px 30px rgba(225,76,114,0.55); }
.chat-fab:active{ transform: scale(0.94); }
.chat-fab-icon{ position: relative; z-index: 1; line-height: 1; }
.chat-fab-pulse{
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,111,145,0.5);
  animation: chatFabPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes chatFabPulse{
  0%{ transform: scale(1); opacity: 0.7; }
  100%{ transform: scale(1.55); opacity: 0; }
}

.chat-panel{
  position: fixed;
  right: 16px;
  bottom: 90px;
  z-index: 121;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff8fb;
  border: 2px solid #ffb6c9;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(74,31,52,0.22);
  overflow: hidden;
  animation: chatPanelIn 0.3s cubic-bezier(.2,.9,.25,1);
}
.chat-panel.hidden{ display: none !important; }
@keyframes chatPanelIn{
  from{ opacity: 0; transform: translateY(16px) scale(0.96); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ff6f91, #e14c72);
  color: #fff;
}
.chat-panel-who{ display: flex; align-items: center; gap: 10px; }
.chat-avatar{
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.chat-name{ font-weight: 700; font-size: 15px; }
.chat-status{ font-size: 11px; opacity: 0.9; }
.chat-close{
  appearance: none; border: none; background: rgba(255,255,255,0.2);
  color: #fff; width: 32px; height: 32px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-close:hover{ background: rgba(255,255,255,0.35); }

.chat-messages{
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 340px;
  background: linear-gradient(180deg, #fff8fb 0%, #fff0f5 100%);
}
.chat-bubble{
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: chatBubbleIn 0.35s ease;
}
.chat-bubble.bot{
  align-self: flex-start;
  background: #fff;
  color: #4a1f34;
  border: 1px solid #ffd0dc;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(225,76,114,0.08);
}
.chat-bubble.user{
  align-self: flex-end;
  background: linear-gradient(135deg, #ff6f91, #e14c72);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.typing{
  color: #a8768a;
  font-style: italic;
  font-size: 12.5px;
}
.chat-bubble.thinking{
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a8768a;
  font-style: normal;
  min-height: 28px;
  background: linear-gradient(135deg, #fff5f8, #ffe8ef);
  border-style: dashed;
}
.chat-think-emoji{
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}
.chat-think-emoji.pop{
  animation: chatThinkPop 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chatThinkPop{
  0%{ transform: scale(0.6) rotate(-12deg); }
  60%{ transform: scale(1.2) rotate(6deg); }
  100%{ transform: scale(1) rotate(0); }
}
.chat-think-dots{
  display: inline-flex;
  gap: 2px;
  font-weight: 700;
  letter-spacing: 1px;
}
.chat-think-dots span{
  animation: chatDotBounce 1.2s ease-in-out infinite;
  opacity: 0.45;
}
.chat-think-dots span:nth-child(2){ animation-delay: 0.2s; }
.chat-think-dots span:nth-child(3){ animation-delay: 0.4s; }
@keyframes chatDotBounce{
  0%, 80%, 100%{ transform: translateY(0); opacity: 0.35; }
  40%{ transform: translateY(-4px); opacity: 1; }
}
.chat-think-label{
  font-size: 12.5px;
  font-style: italic;
}
.chat-bubble.chat-answer-in{
  animation: chatAnswerIn 0.45s cubic-bezier(.2,.9,.25,1);
}
@keyframes chatAnswerIn{
  from{ opacity: 0; transform: translateY(12px) scale(0.96); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
.chat-type-cursor{
  display: inline-block;
  margin-left: 1px;
  color: #ff6f91;
  font-weight: 700;
  animation: chatCursorBlink 0.7s step-end infinite;
  vertical-align: baseline;
}
@keyframes chatCursorBlink{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0; }
}
@keyframes chatBubbleIn{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

.chat-choices{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 14px;
  border-top: 1px solid #ffd0dc;
  background: #fff;
  max-height: 140px;
  overflow-y: auto;
}
.chat-choice{
  appearance: none;
  border: 1.5px solid #ffb6c9;
  background: #fff5f8;
  color: #e14c72;
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, color 0.15s;
  text-align: left;
  line-height: 1.35;
}
.chat-choice:hover{
  background: linear-gradient(135deg, #ff6f91, #e14c72);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}
.chat-choice:disabled{
  opacity: 0.45;
  cursor: wait;
  pointer-events: none;
}

@media (max-width: 420px){
  .chat-panel{ right: 10px; bottom: 82px; width: calc(100vw - 20px); }
  .chat-fab{ right: 12px; bottom: 16px; width: 52px; height: 52px; font-size: 24px; }
}


/* ===== menu awal + mode game ===== */
#gate-hub{ text-align:center; }
#gate-hub .eyebrow{ margin-bottom:16px; }
.hub-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.hub-box{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  padding:16px 8px; border-radius:20px; border:2px solid #f3c3d1; background:#fff;
  color:var(--plum); font-family:inherit; cursor:pointer; text-align:center;
  box-shadow:0 6px 16px rgba(225,76,114,.10); transition:transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.hub-box:active{ transform:scale(.97); }
.hub-box:hover{ box-shadow:0 10px 22px rgba(225,76,114,.18); }
.hub-main{ grid-column:1 / -1; background:linear-gradient(135deg, var(--coral) 0%, #ff9bb3 100%); border-color:transparent; color:#fff; padding:20px 12px; }
.hub-wide{ grid-column:1 / -1; }
.hub-ico{ font-size:30px; line-height:1.1; }
.hub-main .hub-ico{ font-size:36px; }
.hub-name{ font-weight:800; font-size:16px; }
.hub-main .hub-name{ font-size:19px; }
.hub-sub{ font-size:12px; opacity:.75; }
.hub-back-login{ margin-top:10px; width:100%; }

.arcade-bar{ display:none; margin:0 0 10px; }
body.arcade-mode .arcade-bar{ display:block; }
.arcade-back{ padding:8px 14px; font-size:14px; }
body.arcade-mode #journey .chapter-nav,
body.arcade-mode #journey .game-skip-btn,
body.arcade-mode #journey .game-skip-row{ display:none !important; }

.arcade-pz-pick{ margin:4px 0 10px; text-align:center; }
.arcade-pz-label{ font-size:13px; font-weight:700; color:var(--coral-dark); margin-bottom:6px; }
.arcade-pz-row{ display:flex; gap:8px; justify-content:center; }
.arcade-pz-thumb{
  width:clamp(48px, 15vw, 64px); aspect-ratio:3/4; padding:0; border-radius:12px; overflow:hidden;
  border:3px solid #f3c3d1; background:#fff; cursor:pointer; opacity:.7; transition:transform .15s ease, opacity .15s ease, border-color .15s ease;
}
.arcade-pz-thumb img{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.arcade-pz-thumb.active{ border-color:var(--coral-dark); opacity:1; transform:translateY(-2px); }

/* ===== mode game tanpa login: latar sesuai game (bukan foto) =====
   Flappy Heart = langit cerah + awan lewat + bukit; Tangkap Love = taman rumput + pelangi.
   Alur ultah setelah login tetap pakai mosaik foto seperti biasa. */
body.arcade-mode .flappy-photo-bg,
body.arcade-mode .catch-photo-bg,
body.arcade-mode .catch-photo-wash{ display:none; }

body.arcade-mode #flappyWrap{ background:linear-gradient(180deg,#6fc8f5 0%,#b9e8ff 62%,#fff1d6 100%); }
body.arcade-mode #flappyWrap::before{
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='420' viewBox='0 0 340 420'%3E%3Cg fill='%23fff' opacity='.92'%3E%3Cellipse cx='70' cy='70' rx='34' ry='11'/%3E%3Ccircle cx='56' cy='62' r='12'/%3E%3Ccircle cx='82' cy='58' r='15'/%3E%3Cellipse cx='250' cy='170' rx='30' ry='10'/%3E%3Ccircle cx='238' cy='163' r='11'/%3E%3Ccircle cx='262' cy='160' r='13'/%3E%3Cellipse cx='120' cy='290' rx='28' ry='9'/%3E%3Ccircle cx='108' cy='284' r='10'/%3E%3Ccircle cx='130' cy='281' r='12'/%3E%3C/g%3E%3Cg fill='%23ff9fbd' opacity='.75'%3E%3Cpath d='M200 60c-7-9-19 2-10 11l10 10 10-10c9-9-3-20-10-11z'/%3E%3Cpath d='M300 300c-6-8-16 2-8 9l8 9 8-9c8-7-2-17-8-9z'/%3E%3Cpath d='M40 190c-5-7-14 1-7 8l7 8 7-8c7-7-2-15-7-8z'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0 / 340px 420px;
  animation:gameSkyDrift 60s linear infinite;
}
body.arcade-mode #flappyWrap::after{
  content:''; position:absolute; left:0; right:0; bottom:0; height:84px; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse 130px 62px at 22% 100%, #a6e6a4 97%, transparent 100%),
    radial-gradient(ellipse 160px 52px at 70% 100%, #86d58e 97%, transparent 100%),
    radial-gradient(ellipse 110px 44px at 100% 100%, #a6e6a4 97%, transparent 100%);
}
@keyframes gameSkyDrift{ from{ background-position-x:0; } to{ background-position-x:-340px; } }

body.arcade-mode #catchArea{
  background:
    radial-gradient(circle at 80% 118%, transparent 0 50%, rgba(255,110,120,.38) 50% 54%, rgba(255,205,110,.38) 54% 58%, rgba(150,220,150,.38) 58% 62%, rgba(120,185,255,.38) 62% 66%, transparent 66%),
    linear-gradient(180deg,#9bdcf7 0%,#d6f1ff 58%,#eefbe3 100%);
}
body.arcade-mode #catchArea::before{
  content:''; position:absolute; inset:0 0 40px 0; z-index:0; pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Cg fill='%23fff' opacity='.9'%3E%3Cellipse cx='60' cy='36' rx='30' ry='10'/%3E%3Ccircle cx='48' cy='30' r='11'/%3E%3Ccircle cx='72' cy='27' r='13'/%3E%3Cellipse cx='215' cy='80' rx='26' ry='9'/%3E%3Ccircle cx='204' cy='74' r='10'/%3E%3Ccircle cx='226' cy='72' r='12'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0 / 300px 200px;
}
body.arcade-mode #catchArea::after{
  content:''; position:absolute; left:0; right:0; bottom:0; height:38px; z-index:0; pointer-events:none;
  background:
    radial-gradient(circle at 12% 30%, #ff8fb1 0 3px, transparent 4px),
    radial-gradient(circle at 37% 55%, #ffe27a 0 3px, transparent 4px),
    radial-gradient(circle at 63% 28%, #ffffff 0 3px, transparent 4px),
    radial-gradient(circle at 88% 52%, #ff8fb1 0 3px, transparent 4px),
    linear-gradient(180deg,#8be08f 0 8px,#5fc872 8px 100%);
  border-top:2px solid #4fb862;
}
@media (prefers-reduced-motion: reduce){ body.arcade-mode #flappyWrap::before{ animation:none; } }

/* ===== Balap Dino (game mobil) ===== */
.hub-img{ width:68px; height:auto; display:block; margin-bottom:2px; }
#gate-car .arcade-bar{ display:block; }
#gate-car h2{ text-align:center; margin:4px 0 6px; }
#gate-car .lead{ text-align:center; }
#carWrap{
  position:relative; width:100%; margin:0 auto; border-radius:16px; overflow:hidden;
  border:4px solid var(--plum); box-shadow:0 16px 34px rgba(74,31,52,.28), inset 0 0 0 3px #ffd0dd;
  background:#8fd3ff; touch-action:none; line-height:0;
}
#carCanvas{ display:block; width:100%; height:auto; aspect-ratio:16/9; }
#carWrap .flappy-overlay-inner{ line-height:1.4; max-width:340px; padding:14px 16px; text-align:center; }
#carWrap .flappy-overlay-title{ font-size:13px; margin-bottom:6px; }
.car-ov-img{ width:84px; height:auto; margin:0 auto 6px; display:block; }
#carControls{ max-width:none; }
.car-pad{ display:flex; align-items:center; gap:12px; }
#carBtnNitro{ width:66px; height:66px; font-size:26px; background:#a56bff; border-color:#c9a0ff; box-shadow:0 5px 0 #7a43d6; }
#carBtnJump{ width:66px; height:66px; font-size:28px; font-weight:900; background:#3fc8a8; color:#fff; border-color:#8fe6cf; box-shadow:0 5px 0 #25977d; }
#carBtnJump.down{ background:#25977d; box-shadow:0 1px 0 #1b7560; }
#carBtnNitro.down{ background:#7a43d6; box-shadow:0 1px 0 #5a2fb0; }
#carBtnBrake{ width:78px; height:78px; }
#carBtnGas{ width:96px; height:78px; border-radius:39px; font-size:30px; background:var(--coral); color:#fff; border-color:#ff9db5; box-shadow:0 5px 0 #d6587a; }
#carBtnGas.down{ background:var(--coral-dark); box-shadow:0 1px 0 #d6587a; }
/* layar penuh */
#carStage.is-fs #carWrap{ width:min(100vw, calc(100vh * 16 / 9)); width:min(100vw, calc(100dvh * 16 / 9)); max-width:none; margin:0; border:0; border-radius:0; box-shadow:none; }
#carStage.is-fs #carScore{ position:absolute; top:8px; right:96px; z-index:8; margin:0; font-size:10px; padding:6px 10px; pointer-events:none; }
#carStage.is-fs #carControls{ position:absolute; left:0; right:0; bottom:0; margin:0; padding:0 18px 16px; z-index:8; pointer-events:none; }
#carStage.is-fs .dino-btn{ pointer-events:auto; opacity:.85; }
@media (max-height:480px){ #carStage.is-fs #carBtnBrake{ width:58px; height:58px; } #carStage.is-fs #carBtnGas{ width:76px; height:58px; } #carStage.is-fs #carBtnNitro, #carStage.is-fs #carBtnJump{ width:54px; height:54px; font-size:22px; } }

/* ===== Pukul Dino (whack-a-mole) ===== */
#gate-mole .arcade-bar{ display:block; }
#gate-mole h2{ text-align:center; margin:4px 0 6px; }
#gate-mole .lead{ text-align:center; }
.mole-hud{ text-align:center; }
#moleScore{
  font-family:'Press Start 2P', monospace; font-size:11px; letter-spacing:.5px; white-space:pre;
  color:var(--coral-dark); background:#fff0f4; border:2px solid #ffd0dd; border-radius:10px;
  padding:8px 12px; display:inline-block; margin:0 auto 8px; text-align:center;
}
#moleScore.hot{ color:#fff; background:var(--coral); border-color:#ff9db5; }
#moleTime{ max-width:420px; height:10px; margin:0 auto 12px; border-radius:6px; background:#ffe3eb; overflow:hidden; border:2px solid #ffd0dd; box-sizing:content-box; }
#moleTimeBar{ height:100%; width:100%; background:linear-gradient(90deg,#3fc8a8,#8fe6cf); transform-origin:left center; will-change:transform; }
#moleTimeBar.low{ background:linear-gradient(90deg,#e14c72,#ff9db5); }
#moleWrap{
  position:relative; max-width:420px; margin:0 auto; border-radius:16px; overflow:hidden; padding:14px;
  border:4px solid var(--plum); box-shadow:0 16px 34px rgba(74,31,52,.28), inset 0 0 0 3px #ffd0dd;
  background:linear-gradient(180deg,#9bdcf7 0%,#d6f1ff 22%,#8be08f 22%,#5fc872 100%); touch-action:none;
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
#moleWrap .flappy-overlay-inner{ max-width:300px; padding:16px 16px; }
#moleWrap .flappy-overlay-title{ font-size:13px; margin-bottom:8px; }
#moleBoard{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px 10px; margin-top:34px; }
#moleBoard.shake{ animation:moleShake .35s ease; }
@keyframes moleShake{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-6px); } 40%{ transform:translateX(6px); } 60%{ transform:translateX(-4px); } 80%{ transform:translateX(3px); } }
.mole-hole{
  position:relative; display:block; width:100%; aspect-ratio:1/1; padding:0; margin:0; border:0; background:none;
  overflow:hidden; cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:none; font:inherit;
}
.mole-pit{ position:absolute; left:3%; right:3%; bottom:8%; height:30%; border-radius:50%; background:radial-gradient(ellipse at 50% 35%,#5a3a26 0%,#2c170c 100%); z-index:0; }
.mole-lip{
  position:absolute; left:3%; right:3%; bottom:8%; height:30%; border-radius:50%; z-index:2; pointer-events:none;
  background:linear-gradient(180deg,#a8744d,#7a4b2c); clip-path:inset(46% 0 0 0);
  box-shadow:inset 0 -3px 0 rgba(0,0,0,.18);
}
.mole-char{
  position:absolute; left:14%; right:14%; bottom:17%; height:74%; z-index:1; pointer-events:none;
  display:flex; align-items:flex-end; justify-content:center;
  transform:translateY(125%); transition:transform .09s ease-out;
}
.mole-hole.up .mole-char{ transform:translateY(0); }
.mole-hole.up.hit .mole-char{ transform:translateY(14%); transition-duration:.06s; filter:brightness(1.25) saturate(1.2); animation:moleHit .22s ease; }
@keyframes moleHit{ 0%{ rotate:0deg; } 30%{ rotate:-10deg; } 60%{ rotate:8deg; } 100%{ rotate:0deg; } }
.mole-img{ display:none; height:100%; width:auto; max-width:100%; object-fit:contain; pointer-events:none; }
.mole-emo{ display:none; font-size:min(15vw,62px); line-height:1; margin-bottom:6%; }
.mole-hole[data-kind="dino"] .mole-img{ display:block; }
.mole-hole[data-kind="bomb"] .mole-bomb{ display:block; }
.mole-hole[data-kind="heart"] .mole-gold{ display:block; filter:drop-shadow(0 0 6px rgba(255,210,60,.95)); animation:molePulse .4s ease-in-out infinite alternate; }
@keyframes molePulse{ from{ scale:1; } to{ scale:1.15; } }
.mole-fx{
  position:absolute; left:0; right:0; top:6%; z-index:3; text-align:center; pointer-events:none; line-height:1;
  font-family:'Press Start 2P', monospace; font-size:13px; text-shadow:0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
  animation:moleFx .7s ease-out forwards;
}
@keyframes moleFx{ 0%{ transform:translateY(8px) scale(.7); opacity:0; } 20%{ opacity:1; transform:translateY(0) scale(1.15); } 100%{ transform:translateY(-14px) scale(1); opacity:0; } }
@media (prefers-reduced-motion: reduce){ #moleBoard.shake, .mole-hole[data-kind="heart"] .mole-gold{ animation:none; } .mole-char{ transition:none; } }

/* ===== hub: Wisuda Salma = hero (paling besar) ===== */
.hub-hero{grid-column:1 / -1;position:relative;overflow:hidden;padding:38px 14px 34px;border-radius:28px;border:0;color:#fff;
  background:linear-gradient(135deg,#c9577a 0%,#e8899f 52%,#f2b36b 100%);box-shadow:0 16px 36px rgba(201,87,122,.4);animation:heroGlow 3.4s ease-in-out infinite}
.hub-hero .hub-ico{font-size:64px;line-height:1.05;display:inline-block;animation:heroFloat 3.2s ease-in-out infinite;filter:drop-shadow(0 6px 8px rgba(0,0,0,.18))}
.hub-hero .hub-name{font-family:'Fraunces',serif;font-size:30px;font-weight:600;letter-spacing:.3px}
.hub-hero .hub-sub{font-size:13.5px;opacity:.95}
.hub-hero::before{content:"";position:absolute;top:0;left:-70%;width:45%;height:100%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.4),transparent);transform:skewX(-20deg);animation:heroSheen 4s ease-in-out infinite;pointer-events:none}
.hub-hero .hs{position:absolute;font-style:normal;font-size:18px;animation:heroTw 2.6s ease-in-out infinite;pointer-events:none}
.hs1{left:12%;top:14%}.hs2{right:12%;top:20%;animation-delay:.9s}.hs3{left:7%;bottom:12%;animation-delay:1.6s}
@keyframes heroGlow{50%{box-shadow:0 18px 46px rgba(242,179,107,.6)}}
@keyframes heroFloat{50%{transform:translateY(-6px) rotate(-3deg)}}
@keyframes heroSheen{0%,55%{left:-70%}100%{left:140%}}
@keyframes heroTw{0%,100%{opacity:.2;transform:scale(.6)}50%{opacity:1;transform:scale(1.15)}}
@media (prefers-reduced-motion:reduce){.hub-hero,.hub-hero *,.hub-hero::before{animation:none!important}}
