
/* =========================================
   CHARLENE — CHAPTER 21
   Stylesheet untuk HTML versi kartu / slide
========================================= */

/* =========================================
   01. TEMA & RESET
========================================= */

:root {
  color-scheme: dark;

  --bg: #100d19;
  --bg-deep: #090710;

  --surface: rgba(31, 24, 46, 0.82);
  --surface-light: rgba(255, 255, 255, 0.055);

  --text: #faf3ff;
  --muted: #bdb0cc;
  --dim: #9685a7;

  --pink: #ffafd0;
  --pink-bright: #ff7fb3;
  --purple: #c1a2ff;
  --blue: #a8d7ff;
  --gold: #ffe0a6;
  --mint: #b3f0da;

  --border: rgba(242, 218, 255, 0.12);
  --border-bright: rgba(242, 218, 255, 0.25);

  --radius: 30px;
  --radius-small: 18px;

  --shadow:
    0 28px 90px rgba(0, 0, 0, 0.4),
    0 2px 12px rgba(0, 0, 0, 0.2);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Segoe UI", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-width: 280px;
  overflow: hidden;

  display: flex;
  flex-direction: column;

  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);

  background: var(--bg);
  color: var(--text);

  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;

  isolation: isolate;
}

/*
  Halaman luar tetap satu layar.
  Konten panjang tetap bisa dibaca melalui
  overflow-y: auto pada .slide__scroll.
*/

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  cursor: pointer;
}

button {
  border: 0;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  touch-action: manipulation;
}

textarea {
  max-width: 100%;
}

h1,
h2,
h3,
p,
blockquote {
  margin: 0;
}

img,
svg,
canvas {
  display: block;
}

::selection {
  background: rgba(255, 175, 208, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}

h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus {
  outline: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-note {
  position: fixed;
  inset: auto 14px 14px;
  z-index: 100;
  padding: 16px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: #2a2037;
  color: var(--gold);
  text-align: center;
}

/* =========================================
   02. LATAR BELAKANG
========================================= */

.ambient,
#starsCanvas,
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient {
  z-index: -3;
  overflow: hidden;

  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(82, 44, 113, 0.24),
      transparent 65%
    ),
    linear-gradient(155deg, #140e20, #100d19 55%, #171122);
}

#starsCanvas {
  z-index: -1;
}

#confettiCanvas {
  z-index: 60;
}

.ambient__orb {
  position: absolute;
  width: min(65vw, 650px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;

  animation: aurora-drift 19s ease-in-out infinite alternate;
}

.ambient__orb--one {
  top: -30%;
  left: -14%;
  background: #bf74ff;
}

.ambient__orb--two {
  right: -18%;
  bottom: -40%;
  background: #ff78ae;
  animation-delay: -7s;
  animation-duration: 23s;
}

.ambient__orb--three {
  top: 32%;
  left: 48%;
  width: min(40vw, 400px);
  background: #6498ff;
  opacity: 0.09;
  animation-delay: -12s;
}

.ambient__grid {
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);

  background-size: 72px 72px;

  -webkit-mask-image: radial-gradient(ellipse, #000, transparent 76%);
  mask-image: radial-gradient(ellipse, #000, transparent 76%);
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.1;

  background-image:
    radial-gradient(rgba(255, 255, 255, 0.28) 0.6px, transparent 0.6px);

  background-size: 5px 5px;
}

/* =========================================
   03. HEADER
========================================= */

.site-header {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 20px 32px 10px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
}

.brand__mark {
  width: 39px;
  height: 39px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border-bright);
  border-radius: 14px;

  background:
    linear-gradient(
      140deg,
      rgba(255, 175, 208, 0.15),
      rgba(193, 162, 255, 0.06)
    );

  color: var(--pink);
  font-size: 24px;

  box-shadow: 0 0 25px rgba(255, 175, 208, 0.06);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand__text strong {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.21em;
}

.brand__text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.25em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  width: 42px;
  height: 42px;

  display: inline-grid;
  place-items: center;

  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 22px;

  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.icon-button[aria-pressed="true"] {
  background: rgba(255, 175, 208, 0.13);
  border-color: rgba(255, 175, 208, 0.4);
  color: var(--pink);
}

/* =========================================
   04. LAYOUT KARTU / SLIDE
========================================= */

.birthday-app {
  width: min(960px, 100%);
  flex: 1;
  min-height: 0;

  margin: 0 auto;
  padding: 8px 28px 12px;

  display: flex;
  flex-direction: column;

  position: relative;
  z-index: 1;
}

.deck-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 0 8px 11px;
  flex-shrink: 0;
}

.deck-meta > .eyebrow {
  font-size: 9px;
}

.deck-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

#currentSlideNumber {
  color: var(--pink);
  font-weight: 700;
}

.deck {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;

  border: 1px solid var(--border-bright);
  border-radius: var(--radius);

  background:
    linear-gradient(
      145deg,
      rgba(42, 31, 59, 0.91),
      rgba(23, 19, 35, 0.94) 58%,
      rgba(36, 25, 44, 0.94)
    );

  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);

  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);

  overflow: hidden;
  isolation: isolate;
}

/* Garis cahaya di tepi atas kartu. */
.deck::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  z-index: 4;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 204, 228, 0.8),
      transparent
    );

  pointer-events: none;
}

.slide {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;

  --slide-enter-x: 35px;
}

.slide.is-active {
  animation: slide-enter 650ms var(--ease) both;
}

.slide.from-left {
  --slide-enter-x: -35px;
}

.slide__scroll {
  width: 100%;
  height: 100%;
  min-height: 0;

  padding: clamp(24px, 4vh, 44px) clamp(22px, 5vw, 60px);

  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  scrollbar-color: rgba(255, 175, 208, 0.3) transparent;

  text-align: center;
}

.slide__scroll::-webkit-scrollbar {
  width: 5px;
}

.slide__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.slide__scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(255, 175, 208, 0.3);
}

.slide__scroll > * {
  max-width: 100%;
}

.slide__scroll > .button,
.slide__scroll > .text-button {
  margin-top: 23px;
}

.slide--intro .slide__scroll,
.slide--ending .slide__scroll {
  background:
    radial-gradient(
      ellipse at 50% 18%,
      rgba(193, 162, 255, 0.075),
      transparent 60%
    );
}

.slide--cake .slide__scroll {
  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(255, 175, 208, 0.055),
      transparent 65%
    );
}

/* =========================================
   05. TEKS & KOMPONEN UMUM
========================================= */

.eyebrow {
  color: var(--pink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.21em;
  line-height: 1.6;
  text-transform: uppercase;
}

.slide-heading {
  width: min(100%, 620px);
  margin: 0 auto;
}

.slide-heading > .eyebrow {
  margin-bottom: 12px;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(39px, 5.5vw, 67px);
  line-height: 1.08;
}

h2 {
  font-size: clamp(31px, 4.5vw, 49px);
  line-height: 1.15;
}

h3 {
  line-height: 1.35;
}

.text-gradient {
  color: var(--pink);

  background:
    linear-gradient(
      100deg,
      #ffc0d9 10%,
      #d9c3ff 55%,
      #ffe1b5
    );

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.slide-description {
  max-width: 470px;
  margin: 17px auto 0;

  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
  text-wrap: pretty;
}

.micro-copy {
  margin: 17px auto 0;
  max-width: 430px;

  color: var(--dim);
  font-size: 11px;
  line-height: 1.8;
}

.interaction-note {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.button {
  min-height: 47px;
  max-width: 100%;
  padding: 12px 23px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;

  border: 1px solid transparent;
  border-radius: 15px;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;

  transition:
    transform 200ms var(--ease),
    box-shadow 200ms ease,
    background 200ms ease,
    border-color 200ms ease;
}

.button--primary {
  background:
    linear-gradient(120deg, #ffc2db, #d5baff 95%);

  color: #2a1739;

  box-shadow:
    0 7px 25px rgba(209, 155, 249, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.button--secondary {
  background: rgba(193, 162, 255, 0.1);
  border-color: rgba(193, 162, 255, 0.25);
  color: #e5d6ff;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
  color: var(--muted);
}

.button--small {
  min-height: 39px;
  padding: 9px 16px;
  font-size: 11px;
  border-radius: 12px;
}

.button:active,
.icon-button:active,
.nav-arrow:active {
  transform: scale(0.96);
}

.button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 23px;
}

.text-button {
  min-height: 44px;
  padding: 8px 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  background: transparent;
  color: var(--pink);

  font-size: 12px;
  line-height: 1.5;

  border-radius: 10px;

  transition:
    color 180ms ease,
    background 180ms ease;
}

.pill,
.birthday-tag,
.ending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.pill {
  padding: 5px 10px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* =========================================
   06. KARTU PEMBUKA
========================================= */

.intro-art {
  position: relative;
  width: 195px;
  height: 178px;
  margin: 0 auto 20px;
}

.birthday-seal {
  position: absolute;
  inset: 14px 23px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 207, 228, 0.3);
  border-radius: 50%;

  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(255, 202, 225, 0.15),
      rgba(193, 162, 255, 0.045) 65%
    );

  box-shadow:
    0 0 50px rgba(220, 159, 255, 0.08),
    inset 0 0 25px rgba(255, 255, 255, 0.025);

  animation: float-soft 5s ease-in-out infinite;
}

.birthday-seal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 217, 234, 0.16);
  border-radius: inherit;
}

.birthday-seal__top,
.birthday-seal__bottom {
  color: #e6cced;
  font-size: 8px;
  letter-spacing: 0.26em;
}

.birthday-seal__number {
  color: var(--pink);
  font-family: var(--font-display);
  font-size: 69px;
  line-height: 1.12;
  letter-spacing: -0.07em;

  text-shadow: 0 0 28px rgba(255, 175, 208, 0.2);
}

.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(193, 162, 255, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.orbit--one {
  transform: rotate(-25deg) scaleY(0.68);
}

.orbit--two {
  inset: 5px -6px;
  transform: rotate(35deg) scaleY(0.75);
}

.floating-spark {
  position: absolute;
  z-index: 2;
  color: var(--gold);
  animation: twinkle 3.2s ease-in-out infinite;
}

.floating-spark--one {
  top: 11px;
  right: 19px;
  font-size: 25px;
}

.floating-spark--two {
  left: 5px;
  top: 84px;
  color: var(--pink);
  font-size: 20px;
  animation-delay: -1s;
}

.floating-spark--three {
  bottom: 4px;
  right: 34px;
  font-size: 15px;
  animation-delay: -2s;
}

.birthday-tag {
  width: fit-content;
  margin: 20px auto 0;
  padding: 7px 13px;

  color: #e2cdec;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(179, 240, 218, 0.5);
}

.slide--intro .slide__scroll > .button {
  display: flex;
  width: fit-content;
  margin-right: auto;
  margin-left: auto;
}

/* =========================================
   07. KARTU FLIP
========================================= */

.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;

  max-width: 650px;
  margin: 30px auto 0;
}

.flip-card {
  min-width: 0;
  height: 216px;
  padding: 0;
  border-radius: 20px;
  background: transparent;

  perspective: 1000px;
}

.flip-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;

  transform-style: preserve-3d;
  transition: transform 750ms var(--ease);
}

.flip-card.is-flipped .flip-card__inner,
.flip-card[aria-expanded="true"] .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__front,
.flip-card__back {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 20px 15px;
  border: 1px solid var(--border-bright);
  border-radius: 20px;

  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card__front {
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(193, 162, 255, 0.14),
      transparent 70%
    ),
    #271e37;

  overflow: hidden;
}

.flip-card__front::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px;
}

.flip-card:nth-child(2) .flip-card__front {
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(255, 175, 208, 0.15),
      transparent 70%
    ),
    #2b1e33;
}

.flip-card:nth-child(3) .flip-card__front {
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(255, 224, 166, 0.1),
      transparent 70%
    ),
    #2a2233;
}

.flip-card__icon {
  color: var(--pink);
  font-family: var(--font-display);
  font-size: 43px;
  line-height: 1;
  animation: float-soft 4s ease-in-out infinite;
}

.flip-card:nth-child(2) .flip-card__icon {
  color: var(--purple);
  animation-delay: -1s;
}

.flip-card:nth-child(3) .flip-card__icon {
  color: var(--gold);
  animation-delay: -2s;
}

.flip-card__number {
  margin-top: 18px;
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.flip-card__hint {
  margin-top: 7px;
  color: var(--dim);
  font-size: 10px;
}

.flip-card__back {
  transform: rotateY(180deg);

  background:
    linear-gradient(145deg, #3a2946, #281f36);

  box-shadow: inset 0 0 35px rgba(255, 175, 208, 0.04);
}

.flip-card__back strong {
  margin-bottom: 12px;
  color: var(--pink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.25;
}

.flip-card__back > span {
  color: #d3c5de;
  font-size: 12px;
  line-height: 1.8;
}

/* =========================================
   08. PUZZLE
========================================= */

.puzzle-panel {
  width: min(100%, 350px);
  margin: 25px auto 0;
  padding: 17px;

  border: 1px solid var(--border);
  border-radius: 24px;

  background: rgba(10, 7, 18, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.puzzle-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.puzzle-moves {
  color: var(--muted);
  font-size: 11px;
}

.puzzle-moves strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.puzzle-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 8px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;

  background:
    linear-gradient(145deg, #e1c4ef, #b596d7);

  color: #3a244b;

  box-shadow:
    0 4px 0 rgba(66, 43, 89, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);

  transition:
    transform 220ms var(--ease),
    box-shadow 220ms ease,
    filter 220ms ease;
}

.puzzle-tile[data-value="2"],
.puzzle-tile[data-value="5"],
.puzzle-tile[data-value="8"] {
  background: linear-gradient(145deg, #ffd1df, #e8a8c4);
  color: #632e4b;
}

.puzzle-tile[data-value="3"],
.puzzle-tile[data-value="6"],
.puzzle-tile[data-value="9"] {
  background: linear-gradient(145deg, #ffe5bd, #dfc193);
  color: #60452f;
}

.puzzle-tile__number {
  font-family: var(--font-display);
  font-size: 35px;
  line-height: 1;
}

.puzzle-tile__spark {
  position: absolute;
  right: 9px;
  bottom: 5px;
  opacity: 0.45;
  font-size: 15px;
}

.puzzle-tile.is-selected,
.puzzle-tile[aria-pressed="true"] {
  z-index: 1;
  transform: translateY(-4px) scale(0.95);

  outline: 3px solid var(--gold);
  outline-offset: 2px;

  box-shadow:
    0 8px 22px rgba(255, 224, 166, 0.18),
    0 4px 0 rgba(66, 43, 89, 0.9);
}

.puzzle-tile.is-swapping {
  animation: tile-pop 350ms var(--ease);
}

.puzzle-board.is-solved .puzzle-tile {
  outline: 1px solid rgba(179, 240, 218, 0.6);
  filter: brightness(1.08);
}

.puzzle-status {
  min-height: 22px;
  margin: 17px 0 11px;
  color: var(--muted);
  font-size: 11px;
}

.puzzle-reward {
  max-width: 400px;
  margin: 20px auto 0;
  padding: 20px;

  border: 1px solid rgba(179, 240, 218, 0.23);
  border-radius: 20px;

  background: rgba(179, 240, 218, 0.055);
  animation: reveal-up 550ms var(--ease) both;
}

.puzzle-reward__icon {
  display: block;
  margin-bottom: 6px;
  font-size: 25px;
}

.puzzle-reward h3 {
  color: var(--mint);
  font-size: 16px;
}

.puzzle-reward p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* =========================================
   09. AMPLOP & SURAT
========================================= */

.envelope {
  margin: 22px auto 0;
}

.envelope__visual {
  position: relative;
  width: 270px;
  height: 190px;
  margin: 0 auto 20px;
  perspective: 900px;

  animation: float-soft 5s ease-in-out infinite;
}

.envelope__back {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 156px;

  border: 1px solid #b883a7;
  border-radius: 12px;

  background: #b482a4;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
}

.envelope__paper {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 145px;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  background:
    linear-gradient(135deg, #fff6ee, #f0dfea);

  color: #77536c;

  transition: transform 850ms var(--ease);
}

.envelope__paper span:first-child {
  font-family: var(--font-display);
  font-size: 25px;
  font-style: italic;
}

.envelope__paper span:last-child {
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 0.07em;
}

.envelope__front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 156px;
  z-index: 3;

  border-radius: 0 0 12px 12px;

  background:
    linear-gradient(135deg, #ecc4d8, #c997b8);

  clip-path: polygon(
    0 0,
    50% 53%,
    100% 0,
    100% 100%,
    0 100%
  );
}

.envelope__flap {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 4;

  background: linear-gradient(160deg, #f5d5e4, #d5a4c2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);

  transform-origin: top center;
  transition: transform 650ms var(--ease);
}

.envelope__seal {
  position: absolute;
  left: calc(50% - 21px);
  bottom: 46px;
  z-index: 5;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255, 225, 233, 0.38);
  border-radius: 50%;

  background: linear-gradient(145deg, #bf638e, #8a3d65);
  color: #ffe2ec;
  font-size: 23px;

  box-shadow: 0 3px 8px rgba(70, 27, 51, 0.2);

  transition:
    opacity 200ms ease,
    transform 350ms ease;
}

.envelope.is-open .envelope__flap {
  z-index: 1;
  transform: rotateX(180deg);
}

.envelope.is-open .envelope__paper {
  transform: translateY(-45px);
  transition-delay: 180ms;
}

.envelope.is-open .envelope__seal {
  opacity: 0;
  transform: scale(0.6);
}

.letter-paper {
  max-width: 590px;
  margin: 25px auto 0;
  padding: 30px;

  border: 1px solid rgba(244, 220, 234, 0.65);
  border-radius: 7px 20px 20px 20px;

  background:
    repeating-linear-gradient(
      transparent 0,
      transparent 31px,
      rgba(121, 82, 103, 0.035) 31px,
      rgba(121, 82, 103, 0.035) 32px
    ),
    linear-gradient(135deg, #fff7ef, #f2e4ed);

  color: #594450;
  text-align: left;

  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.2),
    inset 0 0 45px rgba(186, 139, 160, 0.06);

  animation: reveal-up 700ms var(--ease) both;
}

.letter-paper__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 23px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(112, 71, 96, 0.15);
}

.letter-paper__top .eyebrow {
  color: #91657f;
  font-size: 8px;
}

.letter-paper__top > span {
  color: #b884a1;
}

.letter-greeting {
  margin-bottom: 18px;
  color: #754960;

  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 400;
  font-style: italic;
}

.letter-body {
  font-size: 13px;
  line-height: 2;
}

.letter-body p + p {
  margin-top: 17px;
}

.letter-body .letter-highlight {
  margin: 23px 0;
  padding: 15px 18px;

  border-left: 3px solid #bb81a2;
  border-radius: 0 10px 10px 0;

  background: rgba(181, 116, 153, 0.08);
  color: #804a69;

  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.65;
}

.letter-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  margin-top: 26px;
}

.letter-signature span {
  color: #947383;
  font-size: 11px;
}

.letter-signature strong {
  color: #8a526f;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
}

/* =========================================
   10. PANGGUNG KUE
========================================= */

.cake-stage {
  position: relative;
  width: min(100%, 440px);
  height: 300px;
  margin: 14px auto 0;
  isolation: isolate;
}

.cake-halo {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 310px;
  height: 240px;

  transform: translate(-50%, -50%);
  border-radius: 50%;

  background:
    radial-gradient(
      ellipse,
      rgba(255, 185, 157, 0.13),
      rgba(255, 157, 200, 0.05) 50%,
      transparent 72%
    );

  animation: halo-breathe 4s ease-in-out infinite;
  pointer-events: none;
}

.cake {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 280px;
  height: 275px;
  transform: translateX(-50%);
}

.cake-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cake-sparkle {
  position: absolute;
  color: var(--gold);
  animation: twinkle 3s ease-in-out infinite;
}

.cake-sparkle--one {
  left: 10%;
  top: 23%;
  font-size: 22px;
}

.cake-sparkle--two {
  right: 12%;
  top: 13%;
  color: var(--pink);
  font-size: 25px;
  animation-delay: -1.4s;
}

.cake-sparkle--three {
  right: 5%;
  bottom: 21%;
  font-size: 17px;
  animation-delay: -2s;
}

.cake-sparkle--four {
  left: 6%;
  bottom: 25%;
  color: var(--purple);
  font-size: 16px;
  animation-delay: -0.7s;
}

/* =========================================
   11. TOPPER ANGKA 21
========================================= */

.cake-topper {
  position: absolute;
  right: 41px;
  bottom: 155px;
  width: 83px;
  height: 105px;
  z-index: 2;
  pointer-events: none;
}

.cake-topper__number {
  position: relative;
  z-index: 1;
  display: block;

  color: var(--gold);
  font-family: var(--font-display);
  font-size: 66px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.07em;

  text-shadow:
    1px 2px 0 #af7c48,
    0 0 20px rgba(255, 224, 166, 0.16);

  transform: rotate(7deg);
}

.cake-topper__stick {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 52px;
  border-radius: 3px;
  background: linear-gradient(90deg, #976338, #f6d69a);
}

.cake-topper__stick--left {
  left: 25px;
}

.cake-topper__stick--right {
  right: 19px;
}

/* =========================================
   12. LILIN, API & ASAP
========================================= */

.candles {
  position: absolute;
  left: 33px;
  bottom: 155px;
  width: 140px;
  height: 83px;
  z-index: 6;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.candle {
  position: relative;
  width: 44px;
  height: 89px;
  padding: 0;
  background: transparent;
  border-radius: 10px;

  --wax-one: #ffc9e0;
  --wax-two: #dc86b3;
  --wax-stripe: rgba(166, 58, 114, 0.25);
}

.candle--two {
  height: 100px;
  --wax-one: #e4d4ff;
  --wax-two: #a68bd3;
  --wax-stripe: rgba(92, 62, 143, 0.25);
}

.candle--three {
  height: 84px;
  --wax-one: #ffe7b6;
  --wax-two: #d8b06f;
  --wax-stripe: rgba(147, 103, 34, 0.2);
}

.candle__wax {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: calc(100% - 31px);

  border-radius: 5px 5px 4px 4px;

  background:
    repeating-linear-gradient(
      -35deg,
      transparent 0 9px,
      var(--wax-stripe) 9px 14px,
      transparent 14px 20px
    ),
    linear-gradient(
      90deg,
      var(--wax-two),
      var(--wax-one) 45%,
      var(--wax-two)
    );

  box-shadow:
    inset 2px 0 3px rgba(255, 255, 255, 0.2),
    2px 1px 4px rgba(0, 0, 0, 0.13);
}

.candle__wax::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 50%;
  background: var(--wax-one);
}

.candle__wick {
  position: absolute;
  left: 21px;
  top: 24px;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: #4c3034;
}

.candle__flame {
  position: absolute;
  top: 0;
  left: 13px;

  width: 18px;
  height: 29px;
  z-index: 3;

  border-radius: 55% 45% 48% 48% / 65% 65% 35% 35%;

  background:
    radial-gradient(
      ellipse at 50% 85%,
      #fffde0 0 15%,
      #ffe89b 30%,
      #ffc45d 55%,
      #ff8b41 85%
    );

  box-shadow:
    0 0 9px rgba(255, 200, 90, 0.8),
    0 0 23px rgba(255, 169, 74, 0.38),
    0 0 45px rgba(255, 154, 70, 0.17);

  transform-origin: center bottom;
  animation: flame-flicker 1.2s ease-in-out infinite alternate;

  transition:
    opacity 220ms ease,
    scale 250ms ease;
}

.candle--two .candle__flame {
  animation-delay: -0.45s;
  animation-duration: 1.05s;
}

.candle--three .candle__flame {
  animation-delay: -0.8s;
  animation-duration: 1.35s;
}

.candle__flame-core {
  position: absolute;
  left: 6px;
  bottom: 3px;
  width: 6px;
  height: 13px;
  border-radius: 50% 50% 40% 40%;
  background: #fffce8;
  opacity: 0.85;
}

.candle__glow {
  position: absolute;
  left: -17px;
  top: -21px;
  width: 78px;
  height: 78px;
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(255, 189, 93, 0.18),
      transparent 68%
    );

  animation: halo-breathe 2s ease-in-out infinite;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.candle__smoke {
  position: absolute;
  top: 13px;
  left: 17px;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.candle__smoke span {
  position: absolute;
  inset: 0;
  border-radius: 50%;

  background: rgba(227, 209, 228, 0.45);
  filter: blur(4px);
  opacity: 0;
}

/* State ini nanti diaktifkan JavaScript. */
.candle.is-out .candle__flame,
.candle.is-out .candle__glow {
  opacity: 0;
  animation: none;
}

.candle.is-out .candle__flame {
  scale: 0.3;
}

.candle.is-out .candle__smoke span {
  animation: smoke-rise 1.6s ease-out both;
}

.candle.is-out .candle__smoke span:nth-child(2) {
  animation-delay: 180ms;
}

.candle.is-out .candle__smoke span:nth-child(3) {
  animation-delay: 350ms;
}

/* =========================================
   13. LAPISAN KUE & FROSTING
========================================= */

.cake__body {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 25px;
  height: 130px;
  z-index: 3;
}

.cake__layer {
  position: absolute;
  left: 0;
  right: 0;
}

.cake__layer--upper {
  top: 0;
  height: 72px;
  border-radius: 0 0 45% 45% / 0 0 15% 15%;

  background:
    linear-gradient(
      90deg,
      #ba6f97,
      #e8a9c7 20%,
      #f5bed7 48%,
      #df98b9 78%,
      #b66e94
    );
}

.cake__filling {
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  height: 15px;
  z-index: 2;
  border-radius: 0 0 50% 50% / 0 0 45% 45%;

  background:
    linear-gradient(90deg, #d8aac5, #fff0e9 40%, #f5d8de 75%, #cb99b5);
}

.cake__layer--lower {
  top: 76px;
  height: 54px;
  border-radius: 0 0 48% 48% / 0 0 24% 24%;

  background:
    linear-gradient(
      90deg,
      #a96085,
      #dc94b5 20%,
      #edafc9 48%,
      #cb83a5 80%,
      #a65f82
    );

  box-shadow: inset 0 -8px 10px rgba(111, 45, 79, 0.1);
}

.cake__top {
  position: absolute;
  left: 0;
  right: 0;
  top: -19px;
  height: 42px;
  z-index: 5;

  border: 1px solid rgba(255, 247, 239, 0.5);
  border-radius: 50%;

  background:
    radial-gradient(
      ellipse at 45% 35%,
      #fff5ed,
      #ffe5e4 60%,
      #f4ced9
    );

  box-shadow: inset 0 -5px 7px rgba(206, 137, 163, 0.1);
}

.cake__icing {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 24px;
  z-index: 4;

  border-radius: 0 0 50% 50% / 0 0 65% 65%;
  background: #f9dce3;
}

.cake__drip {
  position: absolute;
  top: 13px;
  width: 22px;
  border-radius: 0 0 14px 14px;

  background: linear-gradient(#f9dce3, #f4cddc);

  box-shadow: 1px 3px 2px rgba(152, 74, 112, 0.07);
}

.cake__drip--one {
  left: 13px;
  height: 24px;
  width: 19px;
}

.cake__drip--two {
  left: 56px;
  height: 38px;
}

.cake__drip--three {
  left: 114px;
  height: 27px;
  width: 25px;
}

.cake__drip--four {
  right: 50px;
  height: 41px;
  width: 19px;
}

.cake__drip--five {
  right: 9px;
  height: 22px;
  width: 17px;
}

.cake__cream {
  position: absolute;
  width: 21px;
  height: 23px;
  z-index: 6;

  border-radius: 55% 45% 40% 40%;

  background:
    conic-gradient(
      from 20deg at 50% 80%,
      #fff8ed,
      #ecd0d9,
      #fff8ed,
      #f0d3db,
      #fff8ed
    );

  box-shadow: 0 3px 3px rgba(128, 74, 103, 0.09);
}

.cake__cream--one {
  left: 24px;
  top: 5px;
  transform: rotate(-9deg);
}

.cake__cream--two {
  left: 80px;
  top: 13px;
}

.cake__cream--three {
  right: 77px;
  top: 13px;
}

.cake__cream--four {
  right: 22px;
  top: 4px;
  transform: rotate(9deg);
}

.cake__berry {
  position: absolute;
  width: 18px;
  height: 20px;
  z-index: 7;

  border-radius: 45% 45% 48% 48%;

  background:
    radial-gradient(circle at 30% 35%, #ffe2b4 0 1px, transparent 1.5px),
    radial-gradient(circle at 65% 50%, #ffe2b4 0 1px, transparent 1.5px),
    radial-gradient(circle at 40% 75%, #ffe2b4 0 1px, transparent 1.5px),
    linear-gradient(120deg, #ff8e9e, #c7476b);

  box-shadow: 1px 3px 3px rgba(132, 52, 79, 0.18);
}

.cake__berry::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 4px;
  width: 11px;
  height: 6px;

  background: #88b68d;
  clip-path: polygon(50% 0, 65% 40%, 100% 25%, 75% 100%, 20% 90%, 0 20%, 35% 40%);
}

.cake__berry--one {
  left: 51px;
  top: 3px;
  transform: rotate(-15deg);
}

.cake__berry--two {
  left: 119px;
  top: 12px;
}

.cake__berry--three {
  right: 48px;
  top: 2px;
  transform: rotate(14deg);
}

.cake__sprinkles {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.cake__sprinkles i {
  position: absolute;
  width: 7px;
  height: 3px;
  border-radius: 4px;
  background: #fff0bd;
}

.cake__sprinkles i:nth-child(1) {
  left: 12%;
  top: 46%;
  rotate: 30deg;
}

.cake__sprinkles i:nth-child(2) {
  left: 22%;
  top: 37%;
  rotate: -30deg;
  background: #bd95de;
}

.cake__sprinkles i:nth-child(3) {
  left: 36%;
  top: 46%;
  rotate: 55deg;
  background: #fff2e1;
}

.cake__sprinkles i:nth-child(4) {
  left: 48%;
  top: 35%;
  rotate: -20deg;
}

.cake__sprinkles i:nth-child(5) {
  left: 62%;
  top: 44%;
  rotate: 70deg;
  background: #bd95de;
}

.cake__sprinkles i:nth-child(6) {
  left: 83%;
  top: 42%;
  rotate: -35deg;
}

.cake__sprinkles i:nth-child(7) {
  left: 9%;
  top: 77%;
  rotate: 30deg;
  background: #fce9ed;
}

.cake__sprinkles i:nth-child(8) {
  left: 25%;
  top: 87%;
  rotate: -20deg;
}

.cake__sprinkles i:nth-child(9) {
  left: 43%;
  top: 82%;
  rotate: 60deg;
  background: #bc96de;
}

.cake__sprinkles i:nth-child(10) {
  left: 62%;
  top: 88%;
  rotate: -50deg;
}

.cake__sprinkles i:nth-child(11) {
  left: 78%;
  top: 78%;
  rotate: 35deg;
  background: #fce9ed;
}

.cake__sprinkles i:nth-child(12) {
  left: 90%;
  top: 64%;
  rotate: -25deg;
  background: #bc96de;
}

.cake__label {
  position: absolute;
  left: 50%;
  top: 66px;
  z-index: 7;

  transform: translateX(-50%) rotate(-3deg);

  padding: 5px 14px;
  border: 1px solid rgba(255, 248, 232, 0.55);
  border-radius: 6px;

  background: #fff0e1;
  color: #97647d;

  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.2em;

  box-shadow: 0 3px 6px rgba(105, 42, 72, 0.12);
}

.cake__bottom-piping {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -4px;
  height: 17px;
  z-index: 6;

  border-radius: 0 0 50% 50%;

  background:
    radial-gradient(
      ellipse at 50% 40%,
      #fff0e6 0 57%,
      #eac1d1 62% 75%,
      transparent 78%
    ) 0 0 / 17px 17px repeat-x;
}

.cake__plate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11px;
  height: 36px;
  z-index: 2;

  border: 1px solid rgba(239, 219, 255, 0.45);
  border-radius: 50%;

  background:
    linear-gradient(
      180deg,
      #e9dcef,
      #bba4cc 58%,
      #80698f 65%,
      #c7b5d5
    );

  box-shadow: 0 8px 0 rgba(73, 50, 88, 0.55);
}

.cake__shadow {
  position: absolute;
  left: -15px;
  right: -15px;
  bottom: -9px;
  height: 33px;
  z-index: 0;

  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(11px);
}

.birthday-reveal {
  max-width: 470px;
  margin: 24px auto 0;
  padding: 22px;

  border: 1px solid rgba(255, 224, 166, 0.23);
  border-radius: 22px;

  background:
    linear-gradient(
      135deg,
      rgba(255, 224, 166, 0.075),
      rgba(255, 175, 208, 0.05)
    );

  animation: reveal-up 700ms var(--ease) both;
}

.birthday-reveal .eyebrow {
  color: var(--gold);
  font-size: 8px;
}

.birthday-reveal h3 {
  margin-top: 10px;
  color: #ffe2ba;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 400;
}

.birthday-reveal p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* =========================================
   14. HARAPAN
========================================= */

.wish-art {
  position: relative;
  width: 140px;
  height: 117px;
  margin: 20px auto 6px;
}

.wish-star {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  color: var(--gold);
  font-size: 70px;
  line-height: 1;

  text-shadow:
    0 0 25px rgba(255, 224, 166, 0.22),
    0 0 65px rgba(255, 175, 208, 0.14);

  animation: float-soft 4.5s ease-in-out infinite;
}

.wish-ring {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 224, 166, 0.16);
  border-radius: 50%;
}

.wish-ring--one {
  transform: rotate(-30deg) scaleY(0.55);
}

.wish-ring--two {
  transform: rotate(35deg) scaleY(0.55);
}

.wish-mini-star {
  position: absolute;
  color: var(--pink);
  font-size: 18px;
  animation: twinkle 3s ease-in-out infinite;
}

.wish-mini-star--one {
  top: 7px;
  right: 12px;
}

.wish-mini-star--two {
  left: 10px;
  bottom: 15px;
  color: var(--purple);
  font-size: 13px;
  animation-delay: -1s;
}

.wish-form {
  max-width: 480px;
  margin: 12px auto 0;
  text-align: left;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #e9d9f4;
  font-size: 12px;
  font-weight: 600;
}

.textarea-wrap {
  position: relative;
}

#wishInput {
  display: block;
  width: 100%;
  min-height: 145px;
  max-height: 270px;
  padding: 17px 17px 37px;
  resize: vertical;

  border: 1px solid rgba(193, 162, 255, 0.22);
  border-radius: 18px;

  background: rgba(9, 7, 17, 0.3);
  color: var(--text);

  font-size: 16px;
  line-height: 1.8;

  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

#wishInput::placeholder {
  color: #9884aa;
}

#wishInput:focus {
  outline: none;
  border-color: rgba(255, 175, 208, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 175, 208, 0.065);
}

.character-counter {
  position: absolute;
  right: 15px;
  bottom: 11px;

  color: var(--dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;

  pointer-events: none;
}

.field-note {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.8;
}

.wish-form > .button {
  width: 100%;
  margin-top: 18px;
}

.saved-wish {
  max-width: 480px;
  margin: 20px auto 0;
  padding: 26px;

  border: 1px solid rgba(255, 224, 166, 0.2);
  border-radius: 22px;

  background:
    radial-gradient(
      circle at top,
      rgba(255, 224, 166, 0.08),
      transparent 75%
    ),
    rgba(255, 255, 255, 0.02);

  animation: reveal-up 650ms var(--ease) both;
}

.saved-wish__icon {
  display: block;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 35px;
  line-height: 1;
}

.saved-wish .eyebrow {
  color: var(--gold);
  font-size: 8px;
}

.saved-wish blockquote {
  margin-top: 18px;
  color: #f3e3f1;

  font-family: var(--font-display);
  font-size: 23px;
  font-style: italic;
  line-height: 1.7;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#deleteWish {
  color: #dda5b6;
}

/* =========================================
   15. PENUTUP
========================================= */

.ending-art {
  position: relative;
  width: 170px;
  height: 143px;
  margin: 0 auto 15px;
}

.ending-art__halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(255, 175, 208, 0.14),
      transparent 70%
    );

  animation: halo-breathe 4s ease-in-out infinite;
}

.ending-art__heart {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  color: var(--pink);
  font-family: var(--font-display);
  font-size: 113px;
  line-height: 1;

  text-shadow: 0 0 32px rgba(255, 175, 208, 0.22);
  animation: heart-breathe 3.5s ease-in-out infinite;
}

.ending-art__spark {
  position: absolute;
  color: var(--gold);
  animation: twinkle 3s ease-in-out infinite;
}

.ending-art__spark--one {
  left: 5px;
  top: 36px;
  font-size: 22px;
}

.ending-art__spark--two {
  right: 5px;
  top: 18px;
  color: var(--purple);
  font-size: 27px;
  animation-delay: -1s;
}

.ending-art__spark--three {
  right: 22px;
  bottom: 13px;
  font-size: 16px;
  animation-delay: -2s;
}

.ending-message {
  max-width: 470px;
  margin: 21px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.ending-message p + p {
  margin-top: 12px;
}

.ending-message strong {
  display: block;
  margin-top: 18px;
  color: #f4d5e6;
  font-weight: 500;
}

.ending-badge {
  margin-top: 22px;
  padding: 8px 14px;
  color: var(--gold);
  border-color: rgba(255, 224, 166, 0.19);

  font-size: 9px;
  letter-spacing: 0.1em;
}

/* =========================================
   16. NAVIGASI BAWAH
========================================= */

.deck-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;

  flex-shrink: 0;
  margin-top: 14px;
}

.nav-arrow {
  width: 43px;
  height: 40px;
  padding: 0;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.035);
  color: var(--pink);

  font-size: 20px;

  transition:
    transform 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.nav-arrow:disabled {
  opacity: 0.25;
}

.deck-dots {
  display: flex;
  align-items: center;
  gap: 0;
}

.deck-dot {
  width: 29px;
  height: 36px;
  padding: 0;

  display: grid;
  place-items: center;

  border-radius: 10px;
  background: transparent;
}

.deck-dot span {
  width: 6px;
  height: 6px;

  border-radius: 999px;
  background: #756184;

  transition:
    width 300ms var(--ease),
    background 200ms ease,
    box-shadow 200ms ease;
}

.deck-dot.is-active span,
.deck-dot[aria-current="step"] span {
  width: 19px;
  background: var(--pink);
  box-shadow: 0 0 14px rgba(255, 175, 208, 0.25);
}

.deck-dot.is-visited:not(.is-active) span {
  background: #c1a2d4;
}

.deck-footer {
  flex-shrink: 0;
  padding-top: 7px;
  text-align: center;
}

.deck-caption {
  color: #cab6d8;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.navigation-hint {
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
}

/* =========================================
   17. DIALOG PETA
========================================= */

.map-dialog {
  width: min(480px, calc(100vw - 32px));
  max-width: none;
  max-height: 85vh;
  max-height: 85dvh;

  margin: auto;
  padding: 24px;

  overflow-x: hidden;
  overflow-y: auto;

  border: 1px solid var(--border-bright);
  border-radius: 25px;

  background:
    linear-gradient(145deg, #2b203b, #191321);

  color: var(--text);
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.6);

  scrollbar-width: thin;
  scrollbar-color: #735479 transparent;
}

.map-dialog::backdrop {
  background: rgba(7, 5, 13, 0.76);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.map-dialog[open] {
  animation: dialog-enter 300ms var(--ease) both;
}

.map-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.map-dialog__header > div {
  min-width: 0;
}

.map-dialog__header form {
  margin: 0;
  flex-shrink: 0;
}

.map-dialog__header .eyebrow {
  font-size: 8px;
}

.map-dialog__header h2 {
  margin-top: 6px;
  font-size: 27px;
  line-height: 1.2;
}

.map-list {
  display: grid;
  gap: 8px;
}

.map-item {
  width: 100%;
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 13px;

  padding: 13px;

  border: 1px solid var(--border);
  border-radius: 15px;

  background: rgba(255, 255, 255, 0.025);
  text-align: left;

  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.map-item__number {
  width: 28px;
  flex-shrink: 0;

  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.map-item__text {
  flex: 1;
  min-width: 0;
}

.map-item__text strong,
.map-item__text small {
  display: block;
}

.map-item__text strong {
  color: #e9dcf4;
  font-size: 12px;
  font-weight: 600;
}

.map-item__text small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.6;
}

.map-item__icon {
  width: 25px;
  flex-shrink: 0;
  color: var(--purple);
  font-size: 21px;
  text-align: center;
}

.map-item.is-active,
.map-item[aria-current="step"] {
  border-color: rgba(255, 175, 208, 0.35);
  background: rgba(255, 175, 208, 0.08);
}

.map-item.is-active .map-item__number,
.map-item[aria-current="step"] .map-item__number {
  color: var(--pink);
}

.map-dialog__note {
  margin-top: 17px;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

/* =========================================
   18. TOAST
========================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 80;

  width: max-content;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 19px;

  border: 1px solid rgba(255, 175, 208, 0.28);
  border-radius: 14px;

  background: #34253f;
  color: #f6dfef;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);

  font-size: 12px;
  line-height: 1.6;
  text-align: center;

  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 15px);

  pointer-events: none;

  transition:
    opacity 250ms ease,
    transform 250ms var(--ease),
    visibility 250ms ease;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* =========================================
   19. HOVER — PERANGKAT DENGAN MOUSE
========================================= */

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-bright);
    transform: translateY(-2px);
  }

  .button:not(:disabled):hover {
    transform: translateY(-3px);
  }

  .button--primary:not(:disabled):hover {
    box-shadow:
      0 12px 32px rgba(209, 155, 249, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }

  .button--secondary:hover,
  .button--ghost:hover {
    background: rgba(193, 162, 255, 0.15);
    border-color: rgba(193, 162, 255, 0.38);
  }

  .text-button:hover {
    color: #ffd9e8;
    background: rgba(255, 175, 208, 0.055);
  }

  .flip-card:hover .flip-card__front {
    border-color: rgba(255, 175, 208, 0.44);
  }

  .puzzle-tile:not(.is-selected):hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
  }

  .candle:not(.is-out):hover .candle__glow {
    background:
      radial-gradient(
        circle,
        rgba(255, 189, 93, 0.3),
        transparent 70%
      );
  }

  .nav-arrow:not(:disabled):hover {
    transform: translateY(-2px);
    background: rgba(255, 175, 208, 0.1);
  }

  .deck-dot:hover span {
    background: var(--pink);
  }

  .map-item:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-bright);
  }
}

/* =========================================
   20. ANIMASI
========================================= */

@keyframes aurora-drift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(0.95);
  }

  to {
    transform: translate3d(9%, 7%, 0) scale(1.12);
  }
}

@keyframes float-soft {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.38;
    scale: 0.85;
  }

  50%
    {
    opacity: 1;
    scale: 1.1;
  }
}

/* Animasi masuk kartu */
@keyframes slide-enter {
  from {
    opacity: 0;
    transform:
      translateX(var(--slide-enter-x, 35px))
      scale(0.975);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Animasi muncul surat, hadiah, dan harapan */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animasi kotak puzzle setelah ditukar */
@keyframes tile-pop {
  0% {
    transform: scale(0.9);
    filter: brightness(1.12);
  }

  60% {
    transform: scale(1.045);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/*
  Pakai opacity saja agar tidak menimpa
  transform posisi pada .cake-halo.
*/
@keyframes halo-breathe {
  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

@keyframes flame-flicker {
  0% {
    transform: rotate(-5deg) scaleX(0.94) scaleY(1.03);
  }

  25% {
    transform: rotate(3deg) scaleX(1.04) scaleY(0.96);
  }

  50% {
    transform: rotate(-2deg) scaleX(0.97) scaleY(1.08);
  }

  75% {
    transform: rotate(5deg) scaleX(1.03) scaleY(0.98);
  }

  100% {
    transform: rotate(-3deg) scaleX(0.95) scaleY(1.05);
  }
}

@keyframes smoke-rise {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }

  15% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.28;
    transform: translate(-7px, -28px) scale(1.7);
  }

  100% {
    opacity: 0;
    transform: translate(10px, -65px) scale(2.8);
  }
}

@keyframes heart-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.055);
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================
   21. PENYESUAIAN INTERAKSI
========================================= */

/* Supaya fokus keyboard tidak terpotong tepi puzzle. */
.puzzle-tile:focus-visible {
  outline-offset: 1px;
}

/* Tetap jelas mana kotak yang sedang dipilih. */
.puzzle-tile[aria-pressed="true"]:focus-visible {
  outline-color: var(--gold);
}

/* Lilin yang sudah padam tetap terlihat utuh. */
.candle:disabled {
  opacity: 1;
  cursor: default;
}

/* Ruang saat judul difokuskan setelah pindah slide. */
.slide-heading,
.letter-greeting {
  scroll-margin-top: 20px;
}

/* Teks panjang tidak melebar keluar kartu. */
.slide-description,
.letter-body,
.ending-message,
.map-item__text,
.toast {
  overflow-wrap: anywhere;
}

/* Status kosong tidak menyisakan jarak. */
#wishStatus:empty {
  display: none;
}

/* Pesan status opsional untuk JavaScript nanti. */
#wishStatus.is-success {
  color: var(--mint);
}

#wishStatus.is-error {
  color: #ffc1ca;
}

/* =========================================
   22. RESPONSIF — TABLET & HP
========================================= */

@media (max-width: 768px) {
  .site-header {
    padding: 16px 23px 9px;
  }

  .birthday-app {
    padding: 7px 20px 12px;
  }

  .slide__scroll {
    padding: 30px 28px;
  }

  .flip-grid {
    gap: 10px;
  }

  .flip-card {
    height: 225px;
  }

  .flip-card__front,
  .flip-card__back {
    padding: 17px 12px;
  }

  .flip-card__back strong {
    font-size: 20px;
  }

  .flip-card__back > span {
    font-size: 11px;
  }
}

@media (max-width: 540px) {
  :root {
    --radius: 24px;
    --radius-small: 15px;
  }

  .site-header {
    padding: 12px 17px 8px;
  }

  .brand {
    gap: 9px;
  }

  .brand__mark {
    width: 35px;
    height: 35px;
    border-radius: 12px;
    font-size: 21px;
  }

  .brand__text strong {
    font-size: 10px;
  }

  .brand__text small {
    font-size: 7px;
  }

  .header-actions {
    gap: 7px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .birthday-app {
    padding: 5px 13px 9px;
  }

  .deck-meta {
    padding: 0 5px 9px;
  }

  .deck-meta > .eyebrow {
    font-size: 7px;
    letter-spacing: 0.15em;
  }

  .deck-counter {
    font-size: 10px;
  }

  .slide__scroll {
    padding: 27px 20px 30px;
  }

  h1 {
    font-size: clamp(35px, 10vw, 49px);
  }

  h2 {
    font-size: clamp(29px, 8.3vw, 39px);
  }

  .slide-heading > .eyebrow {
    font-size: 8px;
    letter-spacing: 0.16em;
    margin-bottom: 11px;
  }

  .slide-description {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.8;
  }

  .intro-art {
    width: 180px;
    height: 163px;
    margin-bottom: 18px;
  }

  .birthday-seal__number {
    font-size: 60px;
  }

  .birthday-seal__top,
  .birthday-seal__bottom {
    font-size: 7px;
  }

  .button {
    min-height: 46px;
    padding: 12px 18px;
  }

  .micro-copy {
    font-size: 10px;
  }

  /*
    Di HP, tiga kartu kecil ditata vertikal
    di DALAM slide yang sama.
    Bukan semua bab ditumpuk ke bawah.
  */
  .flip-grid {
    grid-template-columns: 1fr;
    width: min(100%, 340px);
    gap: 13px;
    margin-top: 24px;
  }

  .flip-card {
    height: 165px;
  }

  .flip-card__front,
  .flip-card__back {
    padding: 20px;
    border-radius: 18px;
  }

  .flip-card__icon {
    font-size: 35px;
  }

  .flip-card__number {
    margin-top: 10px;
  }

  .flip-card__hint {
    margin-top: 4px;
  }

  .flip-card__back strong {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .flip-card__back > span {
    max-width: 250px;
    font-size: 12px;
    line-height: 1.7;
  }

  .puzzle-panel {
    width: min(100%, 310px);
    padding: 14px;
    border-radius: 20px;
  }

  .puzzle-board {
    gap: 8px;
  }

  .puzzle-tile {
    border-radius: 13px;
  }

  .puzzle-tile__number {
    font-size: 31px;
  }

  .puzzle-reward {
    padding: 18px;
  }

  .envelope__visual {
    width: 245px;
    height: 180px;
  }

  .envelope__flap {
    top: 24px;
  }

  .letter-paper {
    padding: 23px 19px;
  }

  .letter-greeting {
    font-size: 27px;
  }

  .letter-body {
    font-size: 13px;
    line-height: 1.95;
  }

  .letter-body .letter-highlight {
    padding: 13px 14px;
    font-size: 18px;
  }

  .cake-stage {
    height: 285px;
    margin-top: 12px;
  }

  .cake {
    transform: translateX(-50%) scale(0.94);
    transform-origin: center bottom;
  }

  .cake-halo {
    width: 270px;
  }

  .cake-sparkle--one {
    left: 2%;
  }

  .cake-sparkle--two {
    right: 3%;
  }

  .cake-sparkle--three {
    right: 0;
  }

  .cake-sparkle--four {
    left: 0;
  }

  .birthday-reveal {
    padding: 19px 16px;
  }

  .birthday-reveal h3 {
    font-size: 26px;
  }

  .saved-wish {
    padding: 22px 18px;
  }

  .saved-wish blockquote {
    font-size: 21px;
  }

  .ending-art {
    width: 150px;
    height: 127px;
  }

  .ending-art__heart {
    font-size: 98px;
  }

  .ending-message {
    font-size: 12px;
  }

  .deck-nav {
    gap: 12px;
    margin-top: 10px;
  }

  .nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .deck-dot {
    width: 27px;
    height: 40px;
  }

  .deck-footer {
    padding-top: 4px;
  }

  .navigation-hint {
    font-size: 8px;
  }

  .map-dialog {
    padding: 20px 16px;
    border-radius: 21px;
  }

  .map-dialog__header h2 {
    font-size: 24px;
  }

  .map-item {
    gap: 9px;
    padding: 12px 10px;
  }

  .map-item__number {
    width: 23px;
  }

  .map-item__text small {
    font-size: 9px;
  }
}

/* =========================================
   23. HP SANGAT KECIL
========================================= */

@media (max-width: 360px) {
  .site-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .birthday-app {
    padding-right: 9px;
    padding-left: 9px;
  }

  .slide__scroll {
    padding-right: 15px;
    padding-left: 15px;
  }

  .deck-meta > .eyebrow {
    font-size: 6px;
  }

  .deck-nav {
    gap: 7px;
  }

  .deck-dot {
    width: 24px;
  }

  .nav-arrow {
    width: 36px;
  }

  .envelope__visual {
    width: 215px;
  }

  .cake-stage {
    height: 265px;
  }

  .cake {
    transform: translateX(-50%) scale(0.8);
  }

  .cake-halo {
    width: 230px;
    height: 210px;
  }

  .button-row {
    gap: 9px;
  }

  .button-row > .button {
    width: 100%;
  }

  .puzzle-toolbar {
    gap: 6px;
  }

  .pill {
    padding: 5px 8px;
    font-size: 8px;
  }

  .puzzle-moves {
    font-size: 10px;
  }
}

/* =========================================
   24. LAYAR PENDEK / LANDSCAPE
========================================= */

@media (max-height: 740px) and (min-width: 541px) {
  .site-header {
    padding-top: 12px;
    padding-bottom: 5px;
  }

  .birthday-app {
    padding-top: 4px;
    padding-bottom: 7px;
  }

  .slide__scroll {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .intro-art {
    width: 165px;
    height: 148px;
    margin-bottom: 13px;
  }

  .birthday-seal__number {
    font-size: 53px;
  }

  .birthday-seal__top,
  .birthday-seal__bottom {
    font-size: 7px;
  }

  .deck-nav {
    margin-top: 9px;
  }

  .navigation-hint {
    display: none;
  }
}

@media (max-height: 600px) {
  .site-header {
    padding-top: 7px;
    padding-bottom: 5px;
  }

  .brand__mark {
    width: 32px;
    height: 32px;
  }

  .header-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .birthday-app {
    padding-top: 2px;
    padding-bottom: 5px;
  }

  .deck-meta {
    padding-bottom: 5px;
  }

  .slide__scroll {
    padding-top: 22px;
    padding-bottom: 25px;
  }

  .deck-nav {
    margin-top: 6px;
  }

  .deck-footer {
    display: none;
  }

  .intro-art {
    width: 153px;
    height: 137px;
  }

  .birthday-seal__number {
    font-size: 46px;
  }

  .birthday-seal__top,
  .birthday-seal__bottom {
    font-size: 6px;
  }

  .ending-art {
    height: 110px;
    margin-bottom: 12px;
  }

  .ending-art__heart {
    font-size: 88px;
  }

  .map-dialog {
    max-height: 92dvh;
  }
}

/* =========================================
   25. FALLBACK TANPA BACKDROP FILTER
========================================= */

@supports not (
  (backdrop-filter: blur(1px)) or
  (-webkit-backdrop-filter: blur(1px))
) {
  .deck {
    background:
      linear-gradient(
        145deg,
        #2a1f3b,
        #171323 58%,
        #24192c
      );
  }

  .map-dialog::backdrop {
    background: rgba(7, 5, 13, 0.92);
  }
}

/* =========================================
   26. KURANGI ANIMASI — TOMBOL MANUAL

   JavaScript nanti menambahkan class:
   body.reduce-motion
========================================= */

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.reduce-motion #starsCanvas,
body.reduce-motion #confettiCanvas {
  display: none;
}

/*
  Flip, buka amplop, dan padamkan lilin
  tetap berfungsi, hanya tanpa animasi.
*/

/* =========================================
   27. KURANGI ANIMASI — PENGATURAN SISTEM
========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  #starsCanvas,
  #confettiCanvas {
    display: none;
  }
}

/* =========================================
   28. MODE KONTRAS TINGGI
========================================= */

@media (forced-colors: active) {
  .ambient,
  #starsCanvas,
  #confettiCanvas {
    display: none;
  }

  .text-gradient {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }

  .deck,
  .button,
  .icon-button,
  .nav-arrow,
  .map-item,
  .puzzle-tile,
  .flip-card__front,
  .flip-card__back,
  .letter-paper,
  #wishInput {
    border: 1px solid ButtonText;
  }

  .deck-dot span {
    background: ButtonText;
  }

  .deck-dot[aria-current="step"] span {
    background: Highlight;
  }

  .puzzle-tile[aria-pressed="true"] {
    outline: 3px solid Highlight;
  }
}

/* =========================================
   SELESAI — STYLE.CSS
========================================= */
