/* Lilin - Undangan Ulang Tahun Digital
   Warna diatur per tema di bawah. Biasanya cukup ganti data-theme di index.html. */

/* ===== Tema gaya anak ===== */
[data-theme="permen"] {
  --bg: #fff7fa; --bg-2: #fff0f5; --card: #ffffff; --ink: #3b2a4a; --muted: #7b6684;
  --accent: #ff5d99; --accent-2: #ffb938; --accent-3: #3cc5bd; --line: rgba(255, 93, 153, .22);
  --btn-ink: #ffffff; --b1: #ff7eb0; --b2: #ffc94d; --b3: #7fd4f5; --b4: #a98bff; --b5: #6fdcae;
  --cake: #ffd3e3; --icing: #ffffff; --plate: #f6b6cf; --sprinkle: #ff5d99;
}
[data-theme="laut"] {
  --bg: #f3fbff; --bg-2: #e6f5ff; --card: #ffffff; --ink: #183a5c; --muted: #5d7892;
  --accent: #2b8fe3; --accent-2: #ffc94d; --accent-3: #24bfae; --line: rgba(43, 143, 227, .2);
  --btn-ink: #ffffff; --b1: #4fb2ff; --b2: #ffd166; --b3: #43d1c1; --b4: #8fa8ff; --b5: #ff9f7a;
  --cake: #cfe9ff; --icing: #ffffff; --plate: #9fd0f5; --sprinkle: #2b8fe3;
}
[data-theme="pelangi"] {
  --bg: #fffbf3; --bg-2: #f6f0ff; --card: #ffffff; --ink: #392d5c; --muted: #73688f;
  --accent: #7b5cff; --accent-2: #ff8a4c; --accent-3: #2fc27f; --line: rgba(123, 92, 255, .2);
  --btn-ink: #ffffff; --b1: #ff6b6b; --b2: #ffc94d; --b3: #4fd18b; --b4: #5aa9ff; --b5: #b07cff;
  --cake: #ffe3c2; --icing: #ffffff; --plate: #d8c9ff; --sprinkle: #7b5cff;
}
/* ===== Tema gaya dewasa ===== */
[data-theme="sampanye"] {
  --bg: #fbf7f0; --bg-2: #f4ecdf; --card: #fffdf9; --ink: #2f271f; --muted: #7a6a58;
  --accent: #a8823f; --accent-2: #d8bd85; --accent-3: #6f5f4b; --line: rgba(168, 130, 63, .28);
  --btn-ink: #fffdf8; --b1: #e9d7b5; --b2: #d8bd85; --b3: #f6efe2; --b4: #c9a66b; --b5: #efe2c9;
  --cake: #f3e6cf; --icing: #fffaf0; --plate: #d8bd85; --sprinkle: #a8823f;
}
[data-theme="malam"] {
  --bg: #0f1a2e; --bg-2: #15233c; --card: #1b2b48; --ink: #f3ead9; --muted: #b5b9c6;
  --accent: #d6b06a; --accent-2: #f0d9a6; --accent-3: #8fa6cc; --line: rgba(214, 176, 106, .3);
  --btn-ink: #18233a; --b1: #d6b06a; --b2: #f0d9a6; --b3: #8fa6cc; --b4: #c9a15a; --b5: #e8e2d3;
  --cake: #24365a; --icing: #f3ead9; --plate: #d6b06a; --sprinkle: #d6b06a;
}
[data-theme="mawar"] {
  --bg: #fcf5f3; --bg-2: #f7e8e5; --card: #fffaf9; --ink: #3f2a2e; --muted: #85696d;
  --accent: #b86d73; --accent-2: #d9b38a; --accent-3: #7f5258; --line: rgba(184, 109, 115, .26);
  --btn-ink: #fffaf8; --b1: #e7b9b9; --b2: #d9b38a; --b3: #f4dede; --b4: #c98c90; --b5: #efe0d0;
  --cake: #f6dcdc; --icing: #fffaf8; --plate: #d9b38a; --sprinkle: #b86d73;
}

/* Huruf per gaya */
[data-gaya="anak"] { --display: "Fredoka", "DM Sans", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif; --name-size: 3.6rem; --name-weight: 700; --name-style: normal; }
[data-gaya="dewasa"] { --display: "Instrument Serif", Georgia, serif; --body: "Jost", system-ui, sans-serif; --name-size: 4.6rem; --name-weight: 400; --name-style: italic; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.smooth { scroll-behavior: smooth; }
body { background: var(--bg-2); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }

.invitation { max-width: 480px; margin: 0 auto; background: var(--bg); overflow: hidden; box-shadow: 0 0 60px rgba(0, 0, 0, .12); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; }
[data-gaya="dewasa"] h1, [data-gaya="dewasa"] h2, [data-gaya="dewasa"] h3 { font-weight: 400; }
h2 { font-size: 1.85rem; color: var(--accent); margin-bottom: .7rem; }
[data-gaya="dewasa"] h2 { font-size: 2.45rem; }
[data-gaya="dewasa"] h3 { font-size: 1.55rem; }
[data-gaya="dewasa"] .person-name { font-size: 2.35rem; }
[data-gaya="dewasa"] .number { font-size: 1.9rem; }
[data-theme="malam"] h2 { color: var(--accent-2); }
h3 { font-size: 1.25rem; }
strong { font-weight: 700; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { max-width: 34ch; margin: 0 auto 1.6rem; }

.eyebrow { font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: .55rem; }
[data-gaya="dewasa"] .eyebrow { font-weight: 500; letter-spacing: .34em; }

/* ===== Tombol ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .75rem 1.7rem; border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: var(--btn-ink); font: 700 1rem/1 var(--body); letter-spacing: .02em; text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px -8px var(--accent); transition: transform .15s ease, filter .15s ease; }
[data-gaya="anak"] .btn { box-shadow: 0 5px 0 0 color-mix(in srgb, var(--accent) 70%, #000), 0 12px 24px -10px var(--accent); }
[data-gaya="dewasa"] .btn { font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; border-radius: 2px; box-shadow: none; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px) scale(.98); }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: none !important; }
[data-theme="malam"] .btn-ghost { color: var(--accent-2); }

/* ===== Sampul ===== */
.cover { position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 3rem 1.6rem 3.5rem; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-2), var(--bg) 70%); }
[data-gaya="dewasa"] .cover { background: radial-gradient(90% 60% at 50% 40%, var(--card), var(--bg) 75%); }
[data-theme="malam"] .cover { background: radial-gradient(90% 60% at 50% 40%, #1d3054, var(--bg) 75%); }
.cover-inner { position: relative; width: 100%; max-width: 360px; z-index: 2; }
.sky, .hero2-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.float { position: absolute; width: 58px; height: 106px; animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .08)); }
.float.b1 { left: 6%; top: 8%; color: var(--b1); }
.float.b2 { right: 7%; top: 14%; color: var(--b2); width: 50px; height: 92px; animation-delay: -1.5s; }
.float.b3 { left: 10%; bottom: 10%; color: var(--b3); width: 46px; height: 84px; animation-delay: -3s; }
.float.b4 { right: 9%; bottom: 14%; color: var(--b4); animation-delay: -4.2s; }
.float.b5 { right: 16%; top: 46%; color: var(--b5); width: 40px; height: 74px; animation-delay: -2.2s; }
[data-gaya="dewasa"] .float { opacity: .55; width: 40px; height: 74px; }
[data-gaya="dewasa"] .hero2-bg .b5 { display: none; }
.nowrap { white-space: nowrap; }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -14px; rotate: 4deg; } }
.twinkle { position: absolute; width: 18px; height: 18px; color: var(--accent-2); animation: twinkle 3.2s ease-in-out infinite; }
.twinkle.s1 { left: 22%; top: 22%; }
.twinkle.s2 { right: 24%; top: 32%; width: 12px; height: 12px; animation-delay: -1.1s; color: var(--accent); }
.twinkle.s3 { left: 30%; bottom: 22%; width: 14px; height: 14px; animation-delay: -2s; }
@keyframes twinkle { 0%, 100% { opacity: .25; scale: .7; } 50% { opacity: 1; scale: 1.1; } }
.dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; opacity: .7; }
.dot.d1 { left: 18%; top: 40%; background: var(--b1); }
.dot.d2 { right: 20%; top: 58%; background: var(--b3); width: 7px; height: 7px; }
.dot.d3 { left: 40%; top: 10%; background: var(--b2); width: 8px; height: 8px; }
.dot.d4 { right: 36%; bottom: 8%; background: var(--b4); }
.dot.d5 { left: 6%; top: 60%; background: var(--b5); width: 6px; height: 6px; }
.dot.d6 { right: 6%; top: 42%; background: var(--b2); width: 9px; height: 9px; }
[data-gaya="dewasa"] .dot { width: 4px; height: 4px; background: var(--accent) !important; opacity: .5; }

.age-badge { position: relative; width: 150px; height: 150px; margin: .6rem auto 1rem; border-radius: 50%; display: grid; place-content: center; color: var(--btn-ink);
  background: conic-gradient(from 200deg, var(--b1), var(--b2), var(--b3), var(--b4), var(--b1)); box-shadow: 0 14px 30px -12px var(--accent); }
.age-badge::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--accent); }
.age-num, .age-unit { position: relative; }
.age-num { font-family: var(--display); font-size: calc(4.6rem * var(--age-scale, 1)); font-weight: 700; line-height: .9; }
.age-unit { font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; }
[data-gaya="dewasa"] .age-badge { width: 160px; height: 160px; background: none; box-shadow: none; color: var(--accent); }
[data-gaya="dewasa"] .age-badge::before { inset: 0; background: none; border: 1px solid var(--accent); box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 7px var(--line); }
[data-gaya="dewasa"] .age-num { font-size: calc(5.2rem * var(--age-scale, 1)); font-weight: 400; }
[data-gaya="dewasa"] .age-unit { font-weight: 500; color: var(--muted); }

.name-big { font-size: var(--name-size); font-weight: var(--name-weight); font-style: var(--name-style); color: var(--ink); line-height: 1; letter-spacing: -.01em; }
[data-gaya="anak"] .name-big { color: var(--accent); text-shadow: 3px 3px 0 color-mix(in srgb, var(--accent-2) 70%, transparent); }
[data-theme="malam"] .name-big { color: var(--accent-2); }
.date { margin-top: .7rem; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
[data-gaya="dewasa"] .date { font-weight: 400; letter-spacing: .18em; text-transform: uppercase; font-size: .86rem; }
.guest { margin: 1.6rem 0 1.5rem; padding: 1rem 1.2rem; background: var(--card); border: 2px dashed var(--line); border-radius: 18px; }
[data-gaya="dewasa"] .guest { border: 1px solid var(--line); border-radius: 2px; background: transparent; }
.guest-label { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.guest-name { font-family: var(--display); font-size: 1.55rem; font-weight: 700; margin: .1rem 0 .3rem; }
[data-gaya="dewasa"] .guest-name { font-weight: 400; font-style: italic; font-size: 1.9rem; }
.guest-note { font-size: .9rem; color: var(--muted); }

/* Animasi sampul saat pertama dibuka */
.js .cover-inner > * { opacity: 0; transform: translateY(16px); }
.ready .cover-inner > * { opacity: 1; transform: none; transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 110ms + .1s); }
.js .age-badge { transform: scale(.4) rotate(-30deg) !important; }
.ready .age-badge { transform: none !important; transition: transform .9s cubic-bezier(.34, 1.56, .64, 1) .25s, opacity .4s ease .25s !important; }
.cover.leaving .cover-inner { opacity: 0; transform: translateY(-30px) scale(.96); transition: opacity .4s ease, transform .4s ease; }

/* ===== Halaman utama ===== */
.hero2 { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3.5rem 1.6rem; overflow: hidden; isolation: isolate; background: var(--bg-2); }
.hero2-photo { position: relative; width: 230px; height: 230px; margin: .4rem 0 1.4rem; }
.hero2-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 8px solid var(--card); box-shadow: 0 0 0 3px var(--accent), 0 20px 40px -16px rgba(0, 0, 0, .3); }
[data-gaya="dewasa"] .hero2-photo { width: 240px; height: 300px; }
[data-gaya="dewasa"] .hero2-photo img { border-radius: 120px 120px 4px 4px; border: 6px solid var(--card); box-shadow: 0 0 0 1px var(--accent), 0 24px 44px -20px rgba(0, 0, 0, .35); }
.photo-age { position: absolute; right: -10px; bottom: 4px; width: 72px; height: 72px; border-radius: 50%; display: grid; place-content: center; background: var(--accent-2); color: var(--ink); font-family: var(--display); font-size: calc(2.4rem * var(--age-scale, 1)); font-weight: 700; box-shadow: 0 6px 0 0 color-mix(in srgb, var(--accent-2) 60%, #000); rotate: 10deg; }
[data-gaya="dewasa"] .photo-age { background: var(--accent); color: var(--btn-ink); font-weight: 400; box-shadow: none; rotate: 0deg; right: -18px; bottom: -14px; }
.hero2-sub { font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--muted); margin-top: .3rem; }
[data-gaya="dewasa"] .hero2-sub { font-weight: 400; font-style: italic; font-size: 1.6rem; }
.js .hero2 .h-anim { opacity: 0; transform: translateY(26px); }
.hero2.hero-in .h-anim { opacity: 1; transform: none; transition: opacity .8s ease, transform 1s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--d, 0) * 140ms); }
.js .hero2 .hero2-photo.h-anim { transform: scale(.6) rotate(-8deg); }
.hero2.hero-in .hero2-photo.h-anim { transform: none; transition: opacity .6s ease, transform 1.1s cubic-bezier(.34, 1.56, .64, 1) .1s; }

/* ===== Bagian umum ===== */
.section { position: relative; padding: 4.2rem 1.6rem; background: var(--bg); }
.section.soft { background: var(--bg-2); }
[data-gaya="anak"] .section.soft::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 28px; background: radial-gradient(14px 14px at 14px 14px, var(--bg-2) 13.5px, transparent 14px) repeat-x; background-size: 28px 28px; }
.divider { display: block; width: 180px; height: 22px; margin: 1.4rem auto; color: var(--accent); }
.profile-photo { width: 200px; height: 200px; margin: 0 auto 1.2rem; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 34% 66% 58% 42% / 44% 40% 60% 56%; border: 6px solid var(--card); box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .3); }
[data-gaya="dewasa"] .profile-photo img { border-radius: 50%; }
.person-name { font-size: 1.9rem; color: var(--ink); margin-bottom: .3rem; }
[data-gaya="dewasa"] .person-name { font-style: italic; }
.wish { max-width: 32ch; margin: 0 auto; font-style: italic; color: var(--muted); }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-top: 1.2rem; }
.countdown div { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: .8rem .2rem .6rem; }
[data-gaya="dewasa"] .countdown div { border-width: 1px; border-radius: 2px; }
.countdown div:nth-child(1) { box-shadow: 0 6px 0 -1px var(--b1); }
.countdown div:nth-child(2) { box-shadow: 0 6px 0 -1px var(--b2); }
.countdown div:nth-child(3) { box-shadow: 0 6px 0 -1px var(--b3); }
.countdown div:nth-child(4) { box-shadow: 0 6px 0 -1px var(--b4); }
[data-gaya="dewasa"] .countdown div { box-shadow: none !important; }
.countdown strong { display: block; font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--accent); }
[data-gaya="dewasa"] .countdown strong { font-weight: 400; font-size: 2.4rem; }
[data-theme="malam"] .countdown strong { color: var(--accent-2); }
.countdown span { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.countdown-done { margin-top: 1rem; color: var(--accent); font-weight: 700; }

.events { display: grid; gap: 1rem; margin-top: 1.6rem; }
.event { text-align: center; background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 1.6rem 1.2rem 1.4rem; }
[data-gaya="dewasa"] .event { border-width: 1px; border-radius: 2px; }
.event-icon { display: block; width: 92px; height: 70px; margin: 0 auto .5rem; }
.role { font-size: .76rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: .3rem; }
.event h3 { color: var(--ink); margin-bottom: .2rem; }
.time { color: var(--muted); margin-bottom: .8rem; }
.place { margin-bottom: 1.2rem; }
.event-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

.swatches { display: flex; justify-content: center; gap: .7rem; margin-top: .4rem; }
.swatches span { width: 46px; height: 46px; border-radius: 50%; background: var(--c); border: 4px solid var(--card); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35); }
[data-gaya="dewasa"] .swatches span { width: 40px; height: 40px; border-width: 3px; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem .8rem; margin-top: 1.6rem; }
.polaroid { background: #fff; padding: .45rem .45rem 1.6rem; border-radius: 6px; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .35); }
.polaroid:nth-child(odd) { rotate: -3deg; }
.polaroid:nth-child(even) { rotate: 2.5deg; translate: 0 .8rem; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
[data-gaya="dewasa"] .polaroid { padding: .4rem; rotate: 0deg !important; translate: none !important; border-radius: 2px; background: var(--card); }

.rsvp-form { display: grid; gap: .9rem; text-align: left; margin-top: 1.4rem; }
.rsvp-form label { display: grid; gap: .35rem; font-size: .88rem; color: var(--muted); font-weight: 600; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea { width: 100%; padding: .75rem .9rem; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 400 1rem var(--body); }
[data-gaya="dewasa"] .rsvp-form input, [data-gaya="dewasa"] .rsvp-form select, [data-gaya="dewasa"] .rsvp-form textarea { border-width: 1px; border-radius: 2px; }
.rsvp-form textarea { resize: vertical; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rsvp-form .btn { justify-self: center; margin-top: .4rem; }
.form-error { color: #d23b52; font-size: .86rem; min-height: 1em; }
[data-theme="malam"] .form-error { color: #ffb3a8; }

.kado-icon { display: block; width: 64px; height: 64px; margin: 0 auto .6rem; color: var(--accent); }
.wishlist { list-style: none; display: grid; gap: .5rem; max-width: 320px; margin: 0 auto 1.6rem; text-align: left; }
.wishlist li { position: relative; padding: .7rem 1rem .7rem 2.6rem; background: var(--card); border: 2px solid var(--line); border-radius: 14px; }
[data-gaya="dewasa"] .wishlist li { border-width: 1px; border-radius: 2px; }
.wishlist li::before { content: "★"; position: absolute; left: 1rem; top: .65rem; color: var(--accent-2); }
.gift-list { display: grid; gap: .9rem; }
.gift { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 1.3rem; }
[data-gaya="dewasa"] .gift { border-width: 1px; border-radius: 2px; }
.bank { color: var(--accent); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.number { font-family: var(--display); font-size: 1.6rem; letter-spacing: .06em; margin: .2rem 0; word-break: break-all; }
.holder { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.copy { min-height: 40px; padding: .5rem 1.1rem; border-radius: 999px; border: 2px solid var(--accent); background: transparent; color: var(--accent); font: 700 .88rem var(--body); cursor: pointer; }
[data-theme="malam"] .copy { color: var(--accent-2); }
[data-gaya="dewasa"] .copy { border-width: 1px; border-radius: 2px; font-weight: 500; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; }

.footer { padding: 4rem 1.6rem 7rem; background: var(--bg); }
.footer-cake { position: relative; width: 120px; height: 120px; margin: 0 auto 1rem; }
.footer-cake svg { position: absolute; left: 0; bottom: 0; width: 120px; height: 92px; }
.mini-candle { position: absolute; left: 56px; top: 40px; width: 8px; height: 30px; border-radius: 3px; background: repeating-linear-gradient(-45deg, var(--accent) 0 5px, var(--card) 5px 10px); }
.mini-candle::after { content: ""; position: absolute; left: -2px; top: -16px; width: 12px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c8, #ffb400 60%, #ff7a00); animation: flicker .14s ease-in-out infinite alternate; }
.signoff { margin: 1.2rem 0 .6rem; font-size: .98rem; }
.tag { margin-top: .4rem; letter-spacing: .06em; font-weight: 700; }

/* ===== Musik, notifikasi, menu ===== */
.music-btn { position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--accent); background: var(--card); color: var(--accent); font-size: 1.2rem; cursor: pointer; z-index: 20; }
.music-btn.playing { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.botnav { position: fixed; left: 50%; bottom: 0; z-index: 25; width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--line); box-shadow: 0 -10px 28px rgba(0, 0, 0, .12); transform: translate(-50%, 110%); transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.botnav.show { transform: translate(-50%, 0); }
.botnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .4rem 0 .3rem; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; transition: color .25s ease, background-color .25s ease; }
.botnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.botnav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.has-nav .music-btn { bottom: 84px; }
.has-nav .toast { bottom: 92px; }

/* ===== Animasi tiup lilin ===== */
.gate { position: fixed; inset: 0; z-index: 60; display: none; overflow: hidden; }
.gate::before { content: ""; position: absolute; inset: 0; transition: opacity .6s ease;
  background: radial-gradient(circle at 14% 18%, var(--b1) 0 5px, transparent 6px), radial-gradient(circle at 84% 24%, var(--b2) 0 6px, transparent 7px), radial-gradient(circle at 22% 78%, var(--b3) 0 5px, transparent 6px), radial-gradient(circle at 78% 72%, var(--b4) 0 7px, transparent 8px), radial-gradient(circle at 60% 12%, var(--b5) 0 4px, transparent 5px), radial-gradient(circle at 8% 52%, var(--b2) 0 4px, transparent 5px), radial-gradient(circle at 92% 50%, var(--b1) 0 4px, transparent 5px), radial-gradient(90% 60% at 50% 45%, var(--card), var(--bg-2) 70%); }
[data-gaya="dewasa"] .gate::before { background: radial-gradient(circle at 18% 20%, rgba(255, 236, 190, .55) 0 34px, transparent 70px), radial-gradient(circle at 82% 30%, rgba(255, 236, 190, .45) 0 24px, transparent 56px), radial-gradient(circle at 70% 80%, rgba(255, 236, 190, .4) 0 40px, transparent 80px), radial-gradient(circle at 24% 74%, rgba(255, 236, 190, .35) 0 20px, transparent 50px), radial-gradient(90% 60% at 50% 45%, var(--card), var(--bg-2) 70%); }
[data-theme="malam"] .gate::before { background: radial-gradient(circle at 18% 20%, rgba(214, 176, 106, .25) 0 30px, transparent 66px), radial-gradient(circle at 82% 30%, rgba(214, 176, 106, .2) 0 22px, transparent 52px), radial-gradient(circle at 70% 80%, rgba(214, 176, 106, .18) 0 36px, transparent 76px), radial-gradient(90% 60% at 50% 45%, #22365c, var(--bg) 72%); }
.gate.clear { pointer-events: none; }
.gate.clear::before { opacity: 0; }
.gate.show { display: block; animation: gateIn .35s ease both; }
.gate.done { animation: gateOut .5s ease forwards; }
@keyframes gateIn { from { opacity: 0; } }
@keyframes gateOut { to { opacity: 0; visibility: hidden; } }
.gate-lock { overflow: hidden; }
.gate-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.2rem; padding: 2rem; text-align: center; }
.gate-hint { font-family: var(--display); font-size: 1.45rem; font-weight: 700; color: var(--accent); animation: nudge 1.6s ease-in-out infinite; transition: opacity .3s ease; }
[data-gaya="dewasa"] .gate-hint { font-weight: 400; font-style: italic; font-size: 1.8rem; }
[data-theme="malam"] .gate-hint { color: var(--accent-2); }
@keyframes nudge { 50% { transform: translateY(-4px); } }
.gate-cake { position: relative; width: 220px; height: 260px; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; scale: 1.25; }
.gate-cake .cake-svg { --sprinkle: transparent; }
.gate-cake:focus-visible { outline: 3px solid var(--accent); outline-offset: 8px; border-radius: 20px; }
.cake-svg { position: absolute; left: 0; bottom: 0; width: 220px; height: 168px; }
.cake-age { position: absolute; left: 0; right: 0; bottom: 24px; font-family: var(--display); font-size: calc(2.6rem * var(--age-scale, 1)); font-weight: 700; color: var(--accent); line-height: 1; }
[data-gaya="dewasa"] .cake-age { font-weight: 400; }
.candle { position: absolute; left: 50%; top: 86px; width: 16px; height: 86px; margin-left: -8px; border-radius: 5px; background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, var(--card) 8px 16px); box-shadow: inset -3px 0 0 rgba(0, 0, 0, .08); }
[data-gaya="dewasa"] .candle { background: linear-gradient(90deg, var(--accent-2), var(--card) 60%, var(--accent-2)); }
.wick { position: absolute; left: 7px; top: -9px; width: 2px; height: 10px; background: #4a3a2a; border-radius: 1px; }
.flame { position: absolute; left: -5px; top: -44px; width: 26px; height: 38px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 50% 72%, #fffbe0 0 18%, #ffd34d 42%, #ff8f1f 72%, rgba(255, 110, 20, 0) 74%); transform-origin: 50% 90%; animation: flicker .15s ease-in-out infinite alternate; }
.glow { position: absolute; left: -52px; top: -92px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 90, .45), rgba(255, 210, 90, 0) 65%); animation: pulse 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-2deg); } to { transform: scale(.94, 1.06) rotate(2deg); } }
@keyframes pulse { 50% { opacity: .65; transform: scale(.92); } }
.smoke { position: absolute; left: 50%; top: 52px; width: 0; height: 0; }
.smoke i { position: absolute; left: -10px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: rgba(150, 150, 160, .55); opacity: 0; }
.blown .flame { animation: blowOut .28s ease-in forwards; }
.blown .glow { animation: none; opacity: 0; transition: opacity .3s ease; }
.blown .smoke i { animation: puff 1s ease-out forwards; }
.blown .smoke i:nth-child(2) { animation-delay: .12s; left: -2px; }
.blown .smoke i:nth-child(3) { animation-delay: .24s; left: -16px; }
.blown .gate-hint { opacity: 0; }
@keyframes blowOut { to { transform: scale(.2, .1) translate(10px, 10px); opacity: 0; } }
@keyframes puff { 0% { opacity: .7; transform: translateY(0) scale(.5); } 100% { opacity: 0; transform: translate(6px, -70px) scale(2.2); } }
.gate-skip { position: absolute; right: 18px; top: 18px; border: 0; background: none; color: var(--muted); font: 600 .9rem var(--body); text-decoration: underline; cursor: pointer; padding: .4rem; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst .bal { position: absolute; bottom: -130px; width: 58px; height: 106px; animation: rise 1.6s cubic-bezier(.3, .1, .4, 1) forwards; }
.burst .bal svg { width: 100%; height: 100%; }
@keyframes rise { to { transform: translate(var(--dx), calc(-100vh - 180px)) rotate(var(--r)); } }
.burst .spark { position: absolute; left: 50%; top: 42%; width: 14px; height: 14px; color: var(--accent-2); animation: sparkle 1.4s cubic-bezier(.2, .8, .3, 1) forwards; }
.burst .spark svg { width: 100%; height: 100%; }
@keyframes sparkle { 0% { opacity: 0; transform: translate(0, 0) scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(180deg); } }
.gate.lift .gate-stage { transform: translateY(-40px) scale(.94); opacity: 0; transition: transform .6s ease, opacity .5s ease; }

/* ===== Muncul saat digulir ===== */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.zoom { transform: scale(.82); }
.js .reveal.left { transform: translateX(-40px); }
.js .reveal.right { transform: translateX(40px); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.smooth { scroll-behavior: auto; }
  .float, .twinkle, .gate-hint, .flame, .glow, .mini-candle::after, .music-btn.playing { animation: none !important; }
  .js .reveal, .js .reveal.zoom, .js .reveal.left, .js .reveal.right { opacity: 1; transform: none; transition: none; }
  .js .cover-inner > *, .js .age-badge, .js .hero2 .h-anim, .js .hero2 .hero2-photo.h-anim { opacity: 1; transform: none !important; transition: none !important; }
  .botnav { transition: none; }
}
