@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,600&family=DM+Sans:wght@400;500;600;700&family=Sacramento&display=swap");

:root {
  --ink: #25191d;
  --wine: #7b3944;
  --rose: #b85f68;
  --blush: #f2c6c4;
  --cream: #fff8ed;
  --paper: #f7ead7;
  --gold: #d6b48c;
  --muted: #7b6969;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--cream);
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(184, 95, 104, 0.45);
  outline-offset: 2px;
}
canvas {
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------------- Shell Layout ---------------- */
.lock-screen,
.loading-screen,
.experience-shell {
  min-height: 100svh;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.lock-screen {
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  background:
    radial-gradient(circle at 12% 18%, rgba(242, 198, 196, 0.22), transparent 26%),
    radial-gradient(circle at 84% 78%, rgba(214, 180, 140, 0.15), transparent 30%), var(--ink);
}

.lock-screen::before,
.experience-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 248, 237, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.lock-card {
  width: min(460px, 100%);
  padding: clamp(42px, 8vw, 62px) clamp(22px, 6vw, 48px) clamp(28px, 5vw, 38px);
  border: 1px solid rgba(255, 248, 237, 0.18);
  background: rgba(255, 248, 237, 0.96);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.32);
  text-align: center;
  position: relative;
  border-radius: 4px 42px 4px 42px;
  z-index: 2;
  margin: auto;
}

.lock-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(123, 57, 68, 0.18);
  border-radius: 2px 34px 2px 34px;
  pointer-events: none;
}

.lock-seal {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: absolute;
  top: -34px;
  left: calc(50% - 34px);
  color: var(--cream);
  background: var(--wine);
  border: 6px solid var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: clamp(10px, 2.2vw, 11px);
  font-weight: 600;
}

.lock-card h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(40px, 9vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lock-copy {
  max-width: 320px;
  margin: 16px auto 26px;
  color: var(--muted);
  font-size: clamp(13px, 3vw, 14px);
  line-height: 1.65;
}
.lock-card form {
  text-align: left;
  position: relative;
  z-index: 1;
}
.lock-card label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #d9c8bb;
  background: #fffdf8;
}
.input-wrap:focus-within {
  border-color: var(--rose);
}
.input-wrap svg {
  color: var(--rose);
  flex: 0 0 auto;
}
.input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 14px 0;
  background: transparent;
  color: var(--ink);
  letter-spacing: 0.08em;
  font-size: 15px;
}
.input-wrap input::placeholder {
  color: #b5a7a1;
}
.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.error-message {
  margin: 12px 0 0;
  color: #9c3340;
  font-size: 12px;
  font-weight: 600;
}

.unlock-button,
.nav-button,
.meter-game button,
.wish-panel button,
.game-proceed-btn,
.letter-action-btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.unlock-button {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  color: white;
  background: var(--wine);
  box-shadow: 6px 6px 0 var(--blush);
  font-weight: 600;
}
.unlock-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 var(--blush);
}
.unlock-button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--blush);
}
.tiny-note {
  display: block;
  margin-top: 22px;
  color: #aa9c93;
  font-family: "Sacramento", cursive;
  font-size: 20px;
}
.shake {
  animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ---------------- Loading screen ---------------- */
.loading-screen {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
  color: var(--cream);
  background: var(--ink);
}
.loading-sticker {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--rose);
  background: var(--cream);
  border-radius: 43% 57% 62% 38% / 51% 39% 61% 49%;
  animation: softSpin 3s ease-in-out infinite;
}
.loading-sticker > svg {
  animation: heartbeat 1.1s ease infinite;
}
.orbit {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--gold);
  animation: orbit 2.2s linear infinite;
}
.orbit-one {
  inset: -20px;
}
.orbit-two {
  inset: -36px;
  animation-direction: reverse;
  animation-duration: 3s;
}
.loading-screen h2 {
  margin: 36px 0 7px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(26px, 6vw, 42px);
}
.loading-screen p {
  margin: 0;
  color: rgba(255, 248, 237, 0.65);
  font-size: 13px;
}
.loading-track {
  width: min(280px, 72vw);
  height: 4px;
  margin-top: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.loading-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blush);
  transform-origin: left;
  animation: load 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* ---------------- Experience shell ---------------- */
.experience-shell {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  min-height: 100svh;
  min-height: 100vh;
}
.journey-header {
  height: clamp(56px, 8vh, 70px);
  padding: 0 clamp(16px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(37, 25, 29, 0.11);
  position: relative;
  z-index: 20;
}
.music-button {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: clamp(10px, 2.2vw, 11px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 8px;
}
.music-button svg {
  color: var(--rose);
  flex-shrink: 0;
}

.page-stage {
  flex: 1 1 auto;
  min-height: calc(100svh - 146px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  animation: pageIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.page-content {
  width: min(1200px, 100%);
  flex: 1 1 auto;
  margin: auto;
  padding: clamp(24px, 5vw, 60px) clamp(16px, 4vw, 60px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.page-nav {
  height: clamp(60px, 9vh, 76px);
  padding: 0 clamp(16px, 4vw, 58px);
  padding-bottom: max(0px, var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid rgba(37, 25, 29, 0.11);
  position: relative;
  z-index: 20;
  background: rgba(255, 248, 237, 0.92);
  backdrop-filter: blur(12px);
}
.nav-button {
  width: fit-content;
  padding: clamp(9px, 2vh, 12px) clamp(14px, 3vw, 20px);
  font-size: clamp(11px, 2.2vw, 12px);
  font-weight: 600;
}
.nav-button.secondary {
  background: transparent;
  border: 1px solid #d9c8bb;
}
.nav-button.secondary:disabled {
  opacity: 0.25;
  cursor: default;
}
.nav-button.primary {
  justify-self: end;
  color: white;
  background: var(--wine);
  box-shadow: 4px 4px 0 var(--blush);
}
.nav-button.primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--blush);
}
.page-label {
  text-align: center;
  line-height: 1.15;
  padding: 0 8px;
}
.page-label span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.page-label strong {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(15px, 3.5vw, 19px);
  white-space: nowrap;
}

/* ---------------- Floating Background Decor ---------------- */
.floating-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.float-heart,
.float-spark {
  position: absolute;
  color: rgba(184, 95, 104, 0.14);
  animation: drift 7s ease-in-out infinite;
}
.heart-a {
  width: 54px;
  height: 54px;
  left: 5%;
  top: 18%;
  transform: rotate(-18deg);
}
.heart-b {
  width: 28px;
  height: 28px;
  right: 7%;
  bottom: 15%;
  animation-delay: -3s;
}
.spark-a {
  right: 10%;
  top: 13%;
  color: rgba(214, 180, 140, 0.35);
}
.spark-b {
  left: 9%;
  bottom: 12%;
  color: rgba(123, 57, 68, 0.22);
  animation-delay: -2s;
}
.grain {
  position: fixed;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

/* ---------------- Section Intro ---------------- */
.section-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
  width: min(840px, 100%);
  margin: 0 auto clamp(20px, 4vh, 36px);
}
.section-intro.compact {
  margin-bottom: clamp(14px, 3vh, 24px);
}
.chapter-number {
  color: var(--blush);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(42px, 8vw, 70px);
  line-height: 0.78;
  font-weight: 600;
}
.section-intro h2,
.wish-panel h2,
.finale-copy h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(28px, 5.5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

/* ---------------- Chapter 1: Welcome Page ---------------- */
.welcome-page {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
}
.date-stamp {
  position: absolute;
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 4vw, 5vw);
  transform: rotate(3deg);
  padding: 6px 12px;
  border: 1px solid var(--rose);
  color: var(--wine);
  font:
    600 10px "DM Sans",
    sans-serif;
  letter-spacing: 0.15em;
  background: rgba(255, 248, 237, 0.8);
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.hero-copy h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(48px, 8vw, 104px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.82;
}
.hero-copy h1 em {
  color: var(--rose);
  font-weight: 600;
  font-style: normal;
}
.name-ribbon {
  width: fit-content;
  margin: clamp(16px, 3vh, 26px) 0 clamp(14px, 2.5vh, 22px);
  padding: 8px clamp(16px, 3vw, 24px);
  color: var(--cream);
  background: var(--wine);
  transform: rotate(-2deg);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(24px, 3.5vw, 38px);
  letter-spacing: 0.09em;
  box-shadow: 6px 6px 0 var(--blush);
}
.hero-note {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.75;
  font-size: clamp(13px, 2.5vw, 14.5px);
}
.hero-art {
  aspect-ratio: 0.92;
  min-height: 320px;
  max-height: 480px;
  position: relative;
  display: grid;
  place-items: center;
}
.hero-art::before {
  content: "";
  position: absolute;
  width: 74%;
  height: 82%;
  border: 1px solid var(--gold);
  background: var(--paper);
  transform: rotate(5deg);
  box-shadow: 16px 20px 0 rgba(123, 57, 68, 0.09);
}
.big-heart {
  width: min(240px, 62%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  z-index: 1;
  color: var(--rose);
  transform: rotate(-7deg);
  filter: drop-shadow(10px 13px 0 rgba(123, 57, 68, 0.11));
}
.big-heart svg {
  width: 100%;
  height: 100%;
  stroke-width: 1;
}
.scribble {
  position: absolute;
  z-index: 2;
  bottom: 12%;
  right: 4%;
  transform: rotate(-8deg);
  font:
    clamp(20px, 4vw, 28px) "Sacramento",
    cursive;
  color: var(--wine);
}
.tape {
  position: absolute;
  z-index: 3;
  width: 82px;
  height: 24px;
  background: rgba(214, 180, 140, 0.63);
  top: 7%;
  left: 17%;
  transform: rotate(-18deg);
}
.mini-card {
  position: absolute;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  z-index: 3;
  color: var(--wine);
  background: #fffdf8;
  border: 1px solid rgba(37, 25, 29, 0.12);
  box-shadow: 6px 8px 0 rgba(123, 57, 68, 0.1);
}
.mini-card-one {
  right: 2%;
  top: 18%;
  transform: rotate(11deg);
}
.mini-card-two {
  left: 4%;
  bottom: 14%;
  transform: rotate(-12deg);
}
.scroll-note {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #a7958c;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------- Chapter 2: Envelope Page ---------------- */
.envelope-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.envelope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
}
.envelope {
  width: min(540px, 90vw);
  height: clamp(240px, 38vw, 320px);
  margin: 16px auto 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  perspective: 1000px;
}
.envelope-back {
  position: absolute;
  inset: 0;
  background: #e6c5ac;
  border-radius: 4px;
  box-shadow: 0 24px 55px rgba(58, 35, 38, 0.19);
}
.envelope-back::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 59%, 100% 0);
  background: #f1d6be;
  transform-origin: top;
  transition: transform 0.7s ease;
  z-index: 4;
}
.envelope.open .envelope-back::before {
  transform: rotateX(180deg);
  z-index: 0;
}
.envelope-front {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
  background: #d9b392;
  z-index: 3;
  display: grid;
  place-items: center;
}
.envelope-front svg {
  color: var(--wine);
  width: clamp(44px, 8vw, 56px);
  height: clamp(44px, 8vw, 56px);
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.25));
}
.open-prompt {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: clamp(34px, 6vw, 48px);
  transform: translateX(-50%);
  color: var(--cream);
  font-size: clamp(10px, 2.4vw, 11px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(123, 57, 68, 0.75);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

/* ---------------- Chapter 2: Dedicated Letter Page ---------------- */
.letter-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.letter-card-wrapper {
  width: min(720px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.letter-card {
  background: #fffdf8;
  border: 1px solid rgba(123, 57, 68, 0.2);
  border-radius: 6px;
  padding: clamp(24px, 5vw, 46px) clamp(20px, 5vw, 48px);
  box-shadow:
    0 20px 60px rgba(58, 35, 38, 0.12),
    8px 10px 0 rgba(242, 198, 196, 0.5);
  position: relative;
}
.letter-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(184, 95, 104, 0.25);
  border-radius: 3px;
  pointer-events: none;
}
.letter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(123, 57, 68, 0.12);
}
.letter-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wine);
  font:
    600 11px "DM Sans",
    sans-serif;
  letter-spacing: 0.15em;
  padding: 4px 10px;
  border: 1px solid var(--rose);
  border-radius: 3px;
  background: rgba(242, 198, 196, 0.2);
}
.letter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.letter-body {
  position: relative;
  z-index: 1;
}
.letter-salutation {
  font-family: "Cormorant Garamond", serif !important;
  font-size: clamp(20px, 4vw, 26px) !important;
  font-weight: 600 !important;
  color: var(--wine) !important;
  margin-bottom: 14px !important;
}
.letter-body p {
  margin: 12px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(16px, 3.2vw, 19.5px);
  line-height: 1.6;
  color: #2c2024;
}
.letter-sign {
  display: block;
  margin-top: clamp(16px, 3vh, 24px);
  color: var(--wine);
  font:
    clamp(24px, 5vw, 32px) "Sacramento",
    cursive;
}
.letter-card-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: clamp(20px, 3.5vh, 28px);
  padding-top: 16px;
  border-top: 1px dashed rgba(123, 57, 68, 0.15);
  flex-wrap: wrap;
}
.letter-action-btn {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  background: transparent;
  border: 1px solid #d9c8bb;
}
.letter-action-btn.primary {
  color: white;
  background: var(--wine);
  border-color: var(--wine);
  box-shadow: 3px 3px 0 var(--blush);
}

/* ---------------- Chapter 3: Split Pages (Part 1 & Part 2) ---------------- */
.play-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.game-solo-layout {
  width: min(580px, 100%);
  margin: 0 auto;
}
.game-card {
  padding: clamp(22px, 4.5vw, 40px);
  border: 1px solid rgba(37, 25, 29, 0.12);
  background: #fffdf8;
  box-shadow: 10px 12px 0 rgba(123, 57, 68, 0.08);
  border-radius: 6px;
  text-align: center;
}
.game-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--rose);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}
.game-card h3 {
  margin: 10px 0 16px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.1;
}
.game-card > p {
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 12px 0;
}
.scratch-area {
  height: clamp(160px, 30vh, 210px);
  position: relative;
  overflow: hidden;
  border: 8px solid var(--paper);
  border-radius: 4px;
  margin: 0 auto;
}
.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--wine);
  background: repeating-linear-gradient(45deg, #fff8ed, #fff8ed 12px, #f8e8dd 12px, #f8e8dd 24px);
}
.scratch-prize svg {
  width: clamp(34px, 6vw, 42px);
  height: clamp(34px, 6vw, 42px);
}
.scratch-prize strong {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(22px, 4.5vw, 30px);
}
.scratch-prize span {
  font-size: 11px;
  color: var(--muted);
  padding: 0 10px;
}
.scratch-area canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}
.game-proceed-btn {
  margin-top: 10px;
  padding: 12px 22px;
  color: white;
  background: var(--wine);
  box-shadow: 4px 4px 0 var(--blush);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  transition:
    opacity 0.3s ease,
    transform 0.2s ease;
}
.game-proceed-btn.visible {
  opacity: 1;
  transform: scale(1.03);
  box-shadow: 6px 6px 0 var(--blush);
}

.meter-game {
  text-align: center;
}
.meter-visual {
  width: 100px;
  height: 155px;
  margin: 0 auto 8px;
  border: 2px solid var(--wine);
  border-radius: 60px 60px 15px 15px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: end center;
  color: var(--cream);
}
.meter-fill {
  position: absolute;
  inset: 0;
  transform-origin: bottom;
  background: var(--rose);
  transition: transform 0.05s linear;
}
.meter-visual svg {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
}
.meter-number {
  display: block;
  color: var(--wine);
  font-family: "Cormorant Garamond", serif;
  font-size: 36px;
}
.meter-game button {
  padding: 12px 20px;
  color: var(--cream);
  background: var(--wine);
  box-shadow: 4px 4px 0 var(--blush);
  font-size: 12px;
  font-weight: 600;
}
.meter-game button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--blush);
}

/* ---------------- Chapter: Cut The Cake ---------------- */
.cake-page {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: clamp(24px, 5vw, 60px);
}
.wish-panel {
  max-width: 480px;
}
.wish-panel p:not(.eyebrow) {
  margin: 20px 0;
  color: var(--muted);
  font-size: clamp(13px, 2.5vw, 14.5px);
  line-height: 1.75;
}
.wish-panel button {
  padding: 12px 20px;
  color: var(--cream);
  background: var(--wine);
  box-shadow: 4px 4px 0 var(--blush);
  font-size: 12px;
}
.wish-panel button:disabled {
  cursor: default;
  background: var(--rose);
}

/* ---------------- Finale Page ---------------- */
.finale-page {
  width: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--cream);
  background: var(--ink);
  overflow: hidden;
  padding: clamp(24px, 5vw, 60px) clamp(16px, 4vw, 40px);
}
.fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.finale-copy {
  width: min(680px, 92vw);
  position: relative;
  z-index: 2;
  padding: clamp(26px, 5vw, 42px);
  background: rgba(37, 25, 29, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 248, 237, 0.12);
  border-radius: 6px;
}
.finale-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: var(--rose);
  background: var(--cream);
}
.finale-icon svg {
  width: 32px;
  height: 32px;
}
.finale-copy .eyebrow {
  color: var(--blush);
}
.finale-copy h2 {
  font-size: clamp(42px, 8vw, 84px);
}
.finale-copy > p:not(.eyebrow) {
  max-width: 590px;
  margin: 20px auto;
  color: rgba(255, 248, 237, 0.78);
  line-height: 1.8;
  font-size: clamp(13px, 2.5vw, 14.5px);
}
.signature {
  color: var(--blush);
  font:
    clamp(24px, 5vw, 30px) "Sacramento",
    cursive;
}
.twenty-badge {
  position: absolute;
  right: 4%;
  top: 10%;
  color: rgba(242, 198, 196, 0.1);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(100px, 20vw, 260px);
  line-height: 1;
  z-index: -1;
}

/* ---------------- Global Keyframe Animations ---------------- */
@keyframes shake {
  10%,
  90% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
  20%,
  80% {
    transform: translateX(5px) rotate(0.5deg);
  }
  30%,
  50%,
  70% {
    transform: translateX(-8px) rotate(-1deg);
  }
  40%,
  60% {
    transform: translateX(8px) rotate(1deg);
  }
}
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(0.9);
  }
  15% {
    transform: scale(1.08);
  }
  30% {
    transform: scale(0.94);
  }
  45% {
    transform: scale(1.03);
  }
}
@keyframes softSpin {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(6deg);
  }
}
@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(65px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(65px) rotate(-360deg);
  }
}
@keyframes load {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-18px) rotate(8deg);
  }
}
@keyframes flicker {
  from {
    transform: rotate(42deg) scale(0.92);
  }
  to {
    transform: rotate(48deg) scale(1.08);
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(-5deg);
  }
}

/* ---------------- Responsive Rules (All Devices) ---------------- */
@media (max-width: 860px) {
  .welcome-page {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
    padding-top: clamp(20px, 4vh, 36px);
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .date-stamp {
    position: static;
    transform: none;
    margin-bottom: 12px;
    display: inline-block;
  }
  .hero-note {
    margin: 0 auto;
  }
  .hero-art {
    min-height: 240px;
    max-height: 320px;
    aspect-ratio: 1.4;
  }
  .hero-art::before {
    height: 92%;
    width: 68%;
  }
  .big-heart {
    width: 140px;
  }
  .scribble {
    font-size: 20px;
    right: 5%;
    bottom: 6%;
  }
  .mini-card {
    width: 52px;
    height: 52px;
  }
  .mini-card svg {
    width: 20px;
  }
  .scroll-note {
    display: none;
  }
  .section-intro {
    gap: 12px;
  }
  .section-intro h2 {
    font-size: clamp(24px, 5.5vw, 36px);
  }
  .cake-page {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .wish-panel {
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .lock-card {
    padding: 44px 18px 24px;
    border-radius: 4px 28px 4px 28px;
  }
  .journey-header {
    height: 58px;
    padding: 0 14px;
  }
  .music-button span {
    display: none;
  }
  .page-nav {
    height: 64px;
    padding: 0 12px;
  }
  .nav-button {
    padding: 8px 12px;
  }
  .letter-card {
    padding: 24px 16px;
  }
  .letter-stamp {
    font-size: 10px;
  }
  .letter-tag {
    font-size: 10px;
  }
  .letter-card-actions {
    justify-content: center;
  }
  .letter-action-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .game-card {
    padding: 22px 14px;
  }
  .envelope {
    height: 220px;
  }
  .finale-copy {
    padding: 22px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
