/* ===== TEMA & DASAR =====
   ✏️ UBAH: warna utama cukup diganti di variabel :root ini */
:root {
  --bg: #12040a;
  --pink: #ff7aa8;
  --rose: #e0517f;
  --maroon: #6b1030;
  --txt: #f8e3ea;
  --script: 'Great Vibes', cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(ellipse at top, #3a0a1d, var(--bg) 60%) fixed;
  color: var(--txt);
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.7;
  overflow-x: hidden;
}

body.locked {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: var(--script);
  font-weight: 400;
  color: var(--pink);
  text-shadow: 0 0 18px #e0517f66;
}

h1 {
  font-size: clamp(3rem, 14vw, 5.5rem);
  line-height: 1.1;
}

h2 {
  font-size: 2.4rem;
  margin-bottom: 6px;
}

.sub {
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 14px;
}

section,
footer {
  max-width: 760px;
  margin: auto;
  padding: 70px 20px;
  text-align: center;
}

button {
  font: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--maroon));
  border: 0;
  border-radius: 30px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 6px 20px #e0517f44;
  transition: transform 0.2s;
}

button:active {
  transform: scale(0.94);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.hidden {
  display: none !important;
}

/* ===== ANIMASI UMUM ===== */
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes shk {
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
  }
}

.screen:not(.hidden),
#main:not(.hidden) {
  animation: in 1s;
}

.reveal,
.ti {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s, transform 1s;
}

.reveal.in,
.ti.in {
  opacity: 1;
  transform: none;
}

.pop {
  animation: pop 0.6s;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

#dim {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s;
  z-index: 100;
}

#dim.on {
  opacity: 0.65;
}

#flowerMsg,
#jarMsg {
  min-height: 64px;
  margin-top: 16px;
  font-style: italic;
  font-size: 1.1rem;
  color: #ffd1df;
}

/* ===== 1. LOCK SCREEN ===== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, #3a0a1d, var(--bg) 70%);
  transition: opacity 0.8s;
}

.screen.fade {
  opacity: 0;
  pointer-events: none;
}

#dots {
  display: flex;
  gap: 14px;
  margin: 8px 0 14px;
}

#dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  transition: 0.2s;
}

#dots i.on {
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
}

#dots.shake {
  animation: shk 0.5s;
}

#dots.shake i {
  border-color: #ff3b5c;
  background: #ff3b5c;
}

#keypad {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  gap: 14px;
}

#keypad button {
  height: 68px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.5rem;
  background: #ffffff0d;
  border: 1px solid #ff7aa844;
  box-shadow: none;
}

/* ===== 2. KADO ===== */
@keyframes bob {
  50% {
    transform: translateY(-10px);
  }
}

#giftbox {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 30px;
  cursor: pointer;
  animation: bob 2s ease-in-out infinite;
}

#giftbox .box,
#giftbox .lid {
  position: absolute;
  border-radius: 6px;
}

#giftbox .box {
  bottom: 0;
  left: 0;
  width: 130px;
  height: 90px;
  background: linear-gradient(#b0264f, var(--maroon));
  transition: box-shadow 1s;
}

#giftbox .lid {
  top: 10px;
  left: -8px;
  width: 146px;
  height: 36px;
  z-index: 2;
  background: linear-gradient(#d4336a, #8b1a43);
  transition: transform 1s cubic-bezier(0.5, -0.6, 0.5, 1.4), opacity 1s;
}

#giftbox .box::before,
#giftbox .lid::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 22px;
  height: 100%;
  margin-left: -11px;
  background: #ffb3c8aa;
}

#giftbox .lid::after {
  content: "🎀";
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  font-size: 2rem;
}

#giftbox.open {
  animation: none;
}

#giftbox.open .lid {
  transform: translateY(-80px) rotate(-20deg);
  opacity: 0;
}

#giftbox.open .box {
  box-shadow: 0 -10px 60px 20px var(--pink);
}

/* ===== 3. HERO & KUE ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cake {
  position: relative;
  width: 200px;
  height: 195px;
  margin: 30px 0 24px;
}

.tier {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 14px 14px 6px 6px;
}

.t1 {
  bottom: 0;
  width: 200px;
  height: 72px;
  background: linear-gradient(#a3224b, var(--maroon));
}

.t2 {
  bottom: 72px;
  width: 140px;
  height: 56px;
  background: linear-gradient(#f0678f, #a3224b);
}

.tier::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  border-radius: 14px 14px 20px 20px;
  background: #fff0f3;
}

.candle {
  position: absolute;
  left: 50%;
  bottom: 128px;
  width: 10px;
  height: 38px;
  margin-left: -5px;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #fff0f3 0 6px, #ff9db9 6px 12px);
}

#flame {
  position: absolute;
  left: 50%;
  bottom: 164px;
  width: 16px;
  height: 28px;
  margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(#fff 15%, #ffc766 50%, #ff7a3d 80%);
  box-shadow: 0 0 30px 10px #ff9f4388;
  transform-origin: 50% 100%;
  animation: flick 0.18s infinite alternate;
  transition: opacity 0.5s;
}

@keyframes flick {
  to {
    transform: scale(0.88, 1.08) rotate(3deg);
  }
}

.cake.out #flame {
  opacity: 0;
  animation: none;
}

#wish {
  margin-top: 16px;
  min-height: 28px;
  font-style: italic;
  color: #ffd1df;
}

/* ===== 4. SURAT ===== */
.letter {
  padding: 34px 26px;
  border-radius: 6px;
  text-align: left;
  color: #4a1a2b;
  background: linear-gradient(#fff8ef, #f5e6d6);
  box-shadow: 0 20px 50px #000a, 0 0 0 6px #fdf3e722;
  transform: rotate(-1deg);
}

.letter h2 {
  text-align: center;
  color: var(--maroon);
  text-shadow: none;
}

.letter p {
  margin-bottom: 16px;
  line-height: 1.9;
}

.letter .sign {
  margin: 0;
  text-align: right;
  font-family: var(--script);
  font-size: 1.7rem;
  line-height: 1.4;
}

/* ===== 5. BUKET ===== */
#bouquet {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 190px;
  margin-top: 20px;
}

.fl {
  position: relative;
  width: 46px;
  height: 160px;
  margin: 0 -4px;
  cursor: pointer;
  transform-origin: 50% 100%;
}

.fl::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 120px;
  margin-left: -2px;
  border-radius: 2px;
  background: linear-gradient(#4aa36b, #1f5135);
}

.head {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 14px;
  width: 24px;
  height: 36px;
  margin-left: -12px;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: linear-gradient(#ff7aa8, #a3224b);
  transition: all 0.9s cubic-bezier(0.3, 1.7, 0.5, 1);
}

.fl.open .head {
  top: 0;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  border-radius: 50%;
  transform: rotate(200deg);
  box-shadow: 0 0 24px #ff5c8d99;
  background: radial-gradient(circle, #ffd86b 0 14%, transparent 15%),
    repeating-conic-gradient(var(--pink) 0 22.5deg, var(--rose) 0 45deg);
}

/* ===== 6. POLAROID ===== */
#gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 16px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  #gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pol {
  position: relative;
  padding: 8px 8px 42px;
  border-radius: 3px;
  background: #fdf6f0;
  box-shadow: 0 10px 25px #000a;
  cursor: pointer;
  transform: rotate(-3deg);
  transition: transform 0.4s;
}

.pol:nth-child(even) {
  transform: rotate(3deg);
}

.pol:hover {
  transform: rotate(0) scale(1.04);
}

.ph {
  position: relative;
  overflow: hidden;
}

.ph img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: blur(14px) brightness(0.6);
  transform: scale(1.2);
  transition: filter 1.2s, transform 1.2s;
}

.ph::after {
  content: "📷";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  transition: opacity 0.6s;
}

.pol p {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  color: #4a1a2b;
  font-family: var(--script);
  font-size: 1.35rem;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 1s 0.4s;
}

.pol.show img {
  filter: none;
  transform: none;
}

.pol.show .ph::after {
  opacity: 0;
}

.pol.show p {
  opacity: 1;
}

/* ===== 7. TIMELINE ===== */
.tl {
  position: relative;
  margin-top: 30px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--rose), var(--maroon));
}

.ti {
  position: relative;
  width: 50%;
  padding: 0 22px 34px 0;
  text-align: right;
}

.ti:nth-child(even) {
  margin-left: 50%;
  padding: 0 0 34px 22px;
  text-align: left;
}

.ti::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
}

.ti:nth-child(even)::after {
  right: auto;
  left: -6px;
}

.ti small {
  opacity: 0.6;
}

.ti h3 {
  font-size: 1.6rem;
  line-height: 1.2;
}

.ti p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== 8. MUSIC PLAYER ===== */
.player {
  max-width: 340px;
  margin: 20px auto 0;
  padding: 22px;
  border-radius: 24px;
  background: #ffffff0d;
  border: 1px solid #ff7aa833;
  backdrop-filter: blur(8px);
}

.disc {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid #ff7aa855;
  background: repeating-radial-gradient(#1a0710 0 3px, #3a0a1d 3px 6px);
}

.disc::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--pink);
}

.disc.spin {
  animation: rot 4s linear infinite;
}

@keyframes rot {
  to {
    transform: rotate(1turn);
  }
}

#np {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.bar {
  height: 4px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: #ffffff22;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--pink);
}

.ctrl {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.ctrl button {
  padding: 9px 18px;
}

#plist {
  list-style: none;
  text-align: left;
}

#plist li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  cursor: pointer;
}

#plist li small {
  opacity: 0.6;
}

#plist li.on {
  background: #e0517f33;
  color: var(--pink);
}

/* ===== 9. TOPLES ===== */
#jar {
  width: 160px; /* Ukuran lebar toples (bisa disesuaikan) */
  margin: 24px auto 20px;
  cursor: pointer;
}

#jar.shake {
  animation: shk 0.12s 6;
}

/* Style untuk gambar toples baru */
.jar-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  pointer-events: none; /* Mencegah gambar menghalangi klik kocok */
}

/* ===== 10. FOOTER ===== */
footer {
  padding: 90px 20px 70px;
  border-top: 1px solid #ff7aa822;
}

footer p {
  max-width: 480px;
  margin: 10px auto;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* ===== TOMBOL LINK MEMORY VENDING MACHINE ===== */
.vending-link-wrap {
  margin-top: 32px;
  text-align: center;
}

.btn-vending {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--rose), var(--maroon));
  color: #ffffff;
  text-decoration: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  border-radius: 30px;
  box-shadow: 0 6px 20px #e0517f44;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-vending:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px #e0517f77;
}

.btn-vending:active {
  transform: scale(0.96);
}