:root {
  color-scheme: light;
  --ink: #321923;
  --muted: #7d5965;
  --paper: #fff8f5;
  --panel: rgba(255, 249, 247, 0.82);
  --rose: #c5284f;
  --rose-dark: #8f1534;
  --blush: #f7c6d0;
  --wine: #4a0f24;
  --sage: #6d8d79;
  --teal: #0e5960;
  --gold: #d9a441;
  --gold-light: #ffe4a3;
  --gold-deep: #9f6f1e;
  --shadow: 0 26px 70px rgba(91, 12, 38, 0.23);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 214, 222, 0.9), transparent 26rem),
    radial-gradient(circle at 82% 18%, rgba(255, 220, 142, 0.48), transparent 24rem),
    linear-gradient(135deg, #fff7f2 0%, #fbe1e6 42%, #f4f1df 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  content: "♥";
  color: rgba(197, 40, 79, 0.18);
  font-family: Georgia, serif;
  line-height: 1;
  animation: drift 8s ease-in-out infinite;
}

.ambient-one {
  inset: 12vh auto auto 8vw;
}

.ambient-one::before {
  font-size: 6rem;
}

.ambient-one::after {
  top: 6rem;
  left: 4rem;
  color: rgba(14, 89, 96, 0.16);
  font-size: 2.4rem;
  animation-delay: -2s;
}

.ambient-two {
  right: 10vw;
  bottom: 16vh;
}

.ambient-two::before {
  color: rgba(231, 168, 78, 0.22);
  font-size: 4.8rem;
  animation-delay: -4s;
}

.ambient-two::after {
  right: 5rem;
  bottom: 5rem;
  font-size: 2.1rem;
  animation-delay: -6s;
}

.couple-mark {
  appearance: none;
  position: fixed;
  top: clamp(1rem, 2vw, 1.6rem);
  right: clamp(1rem, 3vw, 2.5rem);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid rgba(197, 40, 79, 0.24);
  border-radius: 999px;
  background: rgba(255, 248, 245, 0.72);
  box-shadow: 0 12px 28px rgba(91, 12, 38, 0.14), inset 0 0 0 1px rgba(255, 228, 163, 0.45);
  color: var(--wine);
  font-size: clamp(0.74rem, 1.5vw, 0.88rem);
  font-weight: 800;
  letter-spacing: 0;
  backdrop-filter: blur(16px);
}

.couple-mark:hover,
.couple-mark:focus-visible {
  background: rgba(255, 248, 245, 0.92);
  box-shadow: 0 16px 32px rgba(91, 12, 38, 0.18), inset 0 0 0 1px rgba(255, 228, 163, 0.62);
}

.mark-heart {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--gold-light) 58%, var(--gold-deep));
  box-shadow: 0 8px 18px rgba(197, 40, 79, 0.28), 0 0 0 1px rgba(159, 111, 30, 0.28);
}

.floating-counter {
  position: fixed;
  top: clamp(4.75rem, 6vw, 5.35rem);
  right: clamp(1rem, 3vw, 2.5rem);
  z-index: 10;
  display: none;
  min-width: 8.6rem;
  gap: 0.16rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid rgba(217, 164, 65, 0.48);
  border-radius: 0.9rem;
  background: rgba(255, 248, 245, 0.82);
  box-shadow:
    0 14px 34px rgba(91, 12, 38, 0.14),
    inset 0 0 0 1px rgba(255, 228, 163, 0.44);
  color: var(--wine);
  text-align: right;
  pointer-events: none;
  backdrop-filter: blur(16px);
}

body.is-unlocked.is-viewing-story .floating-counter {
  display: grid;
}

.floating-counter span {
  color: #704856;
  font-size: 0.72rem;
  font-weight: 900;
}

.floating-counter strong {
  color: var(--rose-dark);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

main {
  position: relative;
  z-index: 1;
}

.lock-screen,
.welcome-screen,
.story-screen {
  min-height: 100vh;
  padding: 5.7rem clamp(1rem, 3vw, 3rem) 2rem;
}

.lock-screen {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.lock-screen::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 248, 245, 0.32), transparent 14rem),
    linear-gradient(180deg, rgba(255, 248, 245, 0.14), rgba(255, 239, 216, 0.28));
  pointer-events: none;
}

.lock-feature-photos {
  position: absolute;
  inset: 4.8rem 1.4rem 1rem;
  z-index: 0;
  width: min(100% - 2.8rem, 92rem);
  margin-inline: auto;
  pointer-events: none;
}

.feature-photo {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 228, 163, 0.9);
  border-radius: 1.2rem;
  background: rgba(255, 248, 245, 0.5);
  box-shadow:
    0 28px 65px rgba(91, 12, 38, 0.2),
    0 0 0 1px rgba(159, 111, 30, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  opacity: 0.84;
}

.feature-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 228, 163, 0.22), transparent 42%),
    linear-gradient(0deg, rgba(255, 248, 245, 0.2), rgba(74, 15, 36, 0.16));
}

.feature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(0.98);
}

.feature-photo:nth-child(1) {
  left: 0;
  top: 2rem;
  width: min(20vw, 16rem);
  height: 17rem;
  transform: rotate(-5deg);
}

.feature-photo:nth-child(2) {
  left: 14vw;
  bottom: 0.6rem;
  width: min(23vw, 19rem);
  height: 13rem;
  transform: rotate(3deg);
}

.feature-photo:nth-child(3) {
  right: 0.4rem;
  top: 1.2rem;
  width: min(19vw, 15rem);
  height: 16rem;
  transform: rotate(4deg);
}

.feature-photo:nth-child(4) {
  right: 9vw;
  bottom: 1rem;
  width: min(21vw, 17rem);
  height: 12rem;
  transform: rotate(-3deg);
}

.feature-photo:nth-child(5) {
  left: 31vw;
  top: 0;
  width: min(16vw, 13rem);
  height: 12.5rem;
  transform: rotate(2deg);
}

.feature-photo:nth-child(6) {
  right: 29vw;
  bottom: 0;
  width: min(16vw, 13rem);
  height: 11rem;
  transform: rotate(-2deg);
}

.lock-collage {
  position: absolute;
  inset: 5.4rem clamp(0.7rem, 3vw, 3rem) 1.2rem;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(4.2rem, 1fr));
  grid-auto-rows: minmax(5.6rem, 1fr);
  gap: clamp(0.45rem, 1vw, 0.8rem);
  width: min(100% - 1.4rem, 88rem);
  max-height: 45rem;
  margin-inline: auto;
  opacity: 0.32;
  transform: rotate(-1.5deg);
  pointer-events: none;
}

.lock-collage::before {
  position: absolute;
  inset: -1rem;
  z-index: 2;
  content: "";
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 248, 245, 0.62), transparent 18rem),
    linear-gradient(90deg, rgba(255, 247, 242, 0.78), transparent 18%, transparent 82%, rgba(244, 241, 223, 0.78));
  pointer-events: none;
}

.collage-tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255, 228, 163, 0.72);
  border-radius: 1rem;
  background: rgba(255, 248, 245, 0.48);
  box-shadow: 0 18px 40px rgba(91, 12, 38, 0.16), inset 0 0 0 1px rgba(159, 111, 30, 0.14);
}

.collage-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(255, 228, 163, 0.28), transparent 44%, rgba(74, 15, 36, 0.18));
}

.collage-tile.is-video::before {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid rgba(255, 228, 163, 0.75);
  border-radius: 50%;
  background: rgba(50, 25, 35, 0.62);
  color: var(--gold-light);
  content: "▶";
  font-size: 0.7rem;
}

.collage-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.95);
}

.collage-tile:nth-child(2),
.collage-tile:nth-child(9) {
  grid-row: span 2;
}

.collage-tile:nth-child(4),
.collage-tile:nth-child(12) {
  grid-column: span 2;
}

.collage-tile:nth-child(6),
.collage-tile:nth-child(11) {
  transform: translateY(1.2rem);
}

.lock-panel {
  position: relative;
  z-index: 3;
  width: min(100%, 24.4rem);
  padding: 1.05rem 1.15rem 1.25rem;
  border: 1px solid rgba(255, 228, 163, 0.96);
  border-radius: 2.1rem;
  background:
    linear-gradient(145deg, rgba(255, 243, 204, 0.96), rgba(197, 137, 44, 0.72) 46%, rgba(255, 246, 218, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(159, 111, 30, 0.22));
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(159, 111, 30, 0.26),
    0 0 80px rgba(255, 228, 163, 0.56),
    inset 0 2px 0 rgba(255, 255, 255, 0.68),
    inset 0 -18px 45px rgba(112, 70, 20, 0.24);
  overflow: hidden;
  text-align: center;
  backdrop-filter: blur(18px);
}

.lock-panel::before {
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(255, 248, 226, 0.72);
  border-radius: 1.55rem;
  content: "";
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.5), transparent 26%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.5), transparent 8rem),
    linear-gradient(180deg, rgba(255, 228, 163, 0.3), rgba(112, 70, 20, 0.1));
  pointer-events: none;
}

.lock-panel::after {
  position: absolute;
  inset: auto 1.1rem 0.9rem;
  height: calc(100% - 9.7rem);
  border: 1px solid rgba(112, 70, 20, 0.2);
  border-radius: 1.35rem;
  content: "";
  background: rgba(255, 248, 230, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -16px 30px rgba(159, 111, 30, 0.12);
  pointer-events: none;
}

.lock-panel > * {
  position: relative;
  z-index: 1;
}

.safe-door {
  position: relative;
  display: grid;
  width: min(100%, 18.5rem);
  height: 7.2rem;
  margin: 0 auto 0.72rem;
  place-items: center;
  border: 1px solid rgba(112, 70, 20, 0.34);
  border-radius: 1.55rem;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.8), transparent 3.4rem),
    linear-gradient(135deg, rgba(255, 250, 226, 0.94), rgba(218, 166, 70, 0.92) 38%, rgba(142, 88, 25, 0.72) 62%, rgba(255, 239, 185, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 12px);
  box-shadow:
    0 20px 38px rgba(112, 70, 20, 0.24),
    inset 0 0 0 0.45rem rgba(255, 248, 226, 0.46),
    inset 0 0 0 0.72rem rgba(159, 111, 30, 0.12),
    inset 0 -18px 34px rgba(92, 54, 13, 0.22);
}

.safe-door::before {
  position: absolute;
  inset: 0.9rem;
  border: 1px solid rgba(112, 70, 20, 0.24);
  border-radius: 1.08rem;
  content: "";
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46), 0 0 28px rgba(255, 228, 163, 0.32);
}

.safe-door::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.42) 44%, transparent 52%);
  pointer-events: none;
}

.safe-rivet {
  position: absolute;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff3bf, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 0 0 0.2rem rgba(255, 248, 226, 0.24), inset 0 -1px 2px rgba(92, 54, 13, 0.36);
}

.safe-rivet:nth-child(1) {
  top: 1rem;
  left: 1.1rem;
}

.safe-rivet:nth-child(2) {
  top: 1rem;
  right: 1.1rem;
}

.safe-rivet:nth-child(3) {
  bottom: 1rem;
  left: 1.1rem;
}

.safe-rivet:nth-child(4) {
  right: 1.1rem;
  bottom: 1rem;
}

.safe-handle {
  position: relative;
  display: grid;
  width: 4.6rem;
  height: 4.6rem;
  place-items: center;
  border: 1px solid rgba(112, 70, 20, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(74, 15, 36, 0.92) 0 0.82rem, transparent 0.86rem),
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.82), transparent 1.1rem),
    linear-gradient(145deg, #fff2b4, #d8a64b 48%, #8f641b);
  box-shadow: 0 13px 22px rgba(112, 70, 20, 0.26), inset 0 0 0 0.38rem rgba(255, 248, 226, 0.38);
}

.safe-handle span {
  position: absolute;
  width: 0.56rem;
  height: 1.65rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3bf, #c88d2b);
  box-shadow: 0 2px 5px rgba(92, 54, 13, 0.2);
  transform-origin: center 1.95rem;
}

.safe-handle span:nth-child(1) {
  transform: rotate(0deg) translateY(-1.35rem);
}

.safe-handle span:nth-child(2) {
  transform: rotate(120deg) translateY(-1.35rem);
}

.safe-handle span:nth-child(3) {
  transform: rotate(240deg) translateY(-1.35rem);
}

.kicker,
.memory-date {
  margin: 0;
  color: var(--rose-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.passcode-dots {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin: 0.55rem 0 0.78rem;
}

.dot {
  width: 0.82rem;
  height: 0.82rem;
  border: 1px solid rgba(143, 21, 52, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.dot.is-filled {
  border-color: var(--gold-deep);
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--rose));
  transform: scale(1.06);
}

.lock-message {
  display: inline-flex;
  min-height: 2.15rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(112, 70, 20, 0.24);
  border-radius: 999px;
  background: rgba(255, 248, 226, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 8px 18px rgba(112, 70, 20, 0.1);
  color: var(--wine);
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, clamp(3.15rem, 7vw, 3.7rem));
  justify-content: center;
  gap: 0.58rem;
}

.key {
  display: grid;
  width: 100%;
  min-height: 0;
  place-items: center;
  border: 1px solid rgba(217, 164, 65, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 22px rgba(91, 12, 38, 0.09);
  color: var(--wine);
  font-size: 1.34rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  aspect-ratio: 1;
}

.key:hover,
.key:focus-visible {
  background: white;
  box-shadow: 0 15px 26px rgba(91, 12, 38, 0.14), 0 0 0 1px rgba(255, 228, 163, 0.42);
  transform: translateY(-2px);
}

.key:active {
  transform: translateY(1px) scale(0.98);
}

.key-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--rose-dark);
  font-size: 0.95rem;
}

.is-shaking {
  animation: shake 420ms ease;
}

.is-hidden {
  display: none !important;
}

.welcome-screen,
.story-screen {
  display: none;
}

.welcome-screen {
  position: relative;
  overflow: hidden;
}

.welcome-screen::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    radial-gradient(circle at 48% 30%, rgba(255, 248, 245, 0.55), transparent 20rem),
    linear-gradient(90deg, rgba(255, 247, 242, 0.82), rgba(255, 247, 242, 0.58) 44%, rgba(255, 238, 220, 0.72));
  pointer-events: none;
}

.home-photo-backdrop {
  position: absolute;
  inset: 4.9rem 0 0;
  z-index: 0;
  pointer-events: none;
}

.home-photo-tile {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 228, 163, 0.72);
  border-radius: 1rem;
  background: rgba(255, 248, 245, 0.5);
  box-shadow: 0 22px 52px rgba(91, 12, 38, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  opacity: 0.46;
}

.home-photo-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 228, 163, 0.24), transparent 42%),
    linear-gradient(0deg, rgba(74, 15, 36, 0.16), rgba(255, 248, 245, 0.12));
}

.home-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-photo-tile:nth-child(6n + 1) {
  width: min(16vw, 13rem);
  height: min(22vw, 17rem);
  left: 2vw;
  top: calc(var(--tile-row) * 15rem);
  transform: rotate(-5deg);
}

.home-photo-tile:nth-child(6n + 2) {
  width: min(18vw, 15rem);
  height: min(16vw, 13rem);
  left: 19vw;
  top: calc(2rem + var(--tile-row) * 15rem);
  transform: rotate(3deg);
}

.home-photo-tile:nth-child(6n + 3) {
  width: min(20vw, 17rem);
  height: min(18vw, 14rem);
  left: 39vw;
  top: calc(0.5rem + var(--tile-row) * 15rem);
  transform: rotate(-2deg);
}

.home-photo-tile:nth-child(6n + 4) {
  width: min(17vw, 14rem);
  height: min(22vw, 17rem);
  right: 22vw;
  top: calc(3rem + var(--tile-row) * 15rem);
  transform: rotate(4deg);
}

.home-photo-tile:nth-child(6n + 5) {
  width: min(18vw, 15rem);
  height: min(15vw, 12rem);
  right: 5vw;
  top: calc(1rem + var(--tile-row) * 15rem);
  transform: rotate(-4deg);
}

.home-photo-tile:nth-child(6n) {
  width: min(14vw, 12rem);
  height: min(18vw, 14rem);
  right: 38vw;
  top: calc(6.5rem + var(--tile-row) * 15rem);
  transform: rotate(5deg);
}

.story-screen {
  place-items: center;
}

body.is-unlocked .welcome-screen {
  display: block;
}

body.is-unlocked.is-viewing-story .welcome-screen {
  display: none;
}

body.is-unlocked.is-viewing-story .story-screen {
  display: grid;
  padding-top: 8.3rem;
}

body.is-unlocked .lock-screen {
  display: none;
}

.welcome-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(22rem, 1fr) minmax(18rem, 0.68fr);
  gap: clamp(1rem, 2.2vw, 1.5rem);
  width: min(100%, 78rem);
  margin-inline: auto;
  align-items: start;
}

.welcome-intro,
.love-game-panel,
.love-map-panel,
.home-feature-panel,
.story-tools {
  border: 1px solid rgba(255, 228, 163, 0.68);
  border-radius: 1.35rem;
  background: rgba(255, 248, 245, 0.78);
  box-shadow: 0 20px 52px rgba(91, 12, 38, 0.13), inset 0 0 0 1px rgba(159, 111, 30, 0.12);
  backdrop-filter: blur(18px);
}

.welcome-intro {
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.home-letter {
  max-height: calc(100svh - 7.4rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.welcome-intro h1,
.section-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wine);
}

.welcome-intro h1 {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  line-height: 0.93;
}

.welcome-copy {
  max-width: 52rem;
  margin: 0;
  color: #55313d;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.7;
}

.letter-copy {
  font-size: clamp(1rem, 1.22vw, 1.12rem);
  line-height: 1.82;
}

.welcome-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.love-game-panel,
.love-map-panel,
.home-feature-panel {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.love-map-panel {
  grid-column: 2;
}

.home-feature-panel {
  grid-column: 1;
}

.anniversary-panel h2,
.love-calendar-panel h2 {
  margin-top: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wine);
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1;
}

.anniversary-count {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 0.7rem;
}

.anniversary-count strong {
  color: var(--rose-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 0.88;
}

.anniversary-count span,
#anniversarySince {
  color: #55313d;
  font-weight: 800;
  line-height: 1.35;
}

.anniversary-clock {
  width: max-content;
  margin-top: 0.9rem;
  padding: 0.52rem 0.78rem;
  border: 1px solid rgba(217, 164, 65, 0.45);
  border-radius: 999px;
  background: rgba(255, 248, 245, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 228, 163, 0.38);
  color: var(--rose-dark);
  font-size: 1.12rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#anniversarySince {
  margin: 0.55rem 0 0;
}

.calendar-grid {
  display: grid;
  max-height: 22rem;
  gap: 0.9rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
}

.calendar-month {
  display: grid;
  gap: 0.45rem;
}

.calendar-month-title {
  color: var(--wine);
  font-size: 0.84rem;
  font-weight: 900;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}

.calendar-weekdays span {
  color: rgba(85, 49, 61, 0.66);
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  min-height: 2.1rem;
  place-items: center;
  border: 1px solid rgba(217, 164, 65, 0.18);
  border-radius: 0.54rem;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(85, 49, 61, 0.62);
  font-size: 0.74rem;
  font-weight: 900;
}

.calendar-day.is-empty {
  border-color: transparent;
  background: transparent;
}

.calendar-day.has-memory {
  border-color: rgba(197, 40, 79, 0.24);
  background:
    radial-gradient(circle at 50% 84%, rgba(217, 164, 65, 0.4), transparent 0.34rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 232, 238, 0.76));
  color: var(--wine);
  box-shadow: 0 10px 20px rgba(91, 12, 38, 0.08);
}

.calendar-day.has-memory.is-favorite {
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--wine) 60%, var(--gold-deep));
}

.calendar-day.has-memory:hover,
.calendar-day.has-memory:focus-visible {
  box-shadow: 0 14px 25px rgba(91, 12, 38, 0.16);
  transform: translateY(-1px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-head h2 {
  margin-top: 0.25rem;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-weight: 800;
}

.game-meta strong {
  color: var(--rose-dark);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.58rem;
}

.game-card {
  display: grid;
  min-height: 4.95rem;
  place-items: center;
  border: 1px solid rgba(217, 164, 65, 0.34);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 228, 163, 0.44), transparent 4rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 232, 238, 0.72));
  color: var(--wine);
  box-shadow: 0 14px 28px rgba(91, 12, 38, 0.1);
  font-size: clamp(0.82rem, 1.35vw, 1.08rem);
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  box-shadow: 0 18px 32px rgba(91, 12, 38, 0.15);
  transform: translateY(-2px);
}

.game-card:disabled {
  cursor: default;
  opacity: 1;
}

.game-card.is-hidden-card {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.72), transparent 2.4rem),
    linear-gradient(135deg, var(--rose), var(--wine) 55%, var(--gold-deep));
  color: var(--gold-light);
  font-size: 1.8rem;
}

.game-card.is-matched {
  border-color: rgba(109, 141, 121, 0.4);
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 228, 163, 0.42), transparent 4rem),
    linear-gradient(145deg, rgba(231, 247, 235, 0.86), rgba(255, 255, 255, 0.72));
  color: #205342;
}

.love-map-canvas {
  position: relative;
  height: clamp(19.5rem, 32vw, 25rem);
  min-height: 19.5rem;
  overflow: hidden;
  border: 1px solid rgba(217, 164, 65, 0.34);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 52% 48%, rgba(42, 102, 142, 0.2), transparent 8rem),
    linear-gradient(118deg, rgba(14, 37, 68, 0.1), transparent 38%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.76), rgba(255, 232, 238, 0.7)),
    repeating-linear-gradient(35deg, rgba(125, 89, 101, 0.07) 0 1px, transparent 1px 1.2rem);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 245, 0.58);
}

.love-map-canvas.is-leaflet {
  background: #f4efe8;
}

.love-map-canvas.is-leaflet::before {
  display: none;
}

.love-map-canvas .leaflet-pane,
.love-map-canvas .leaflet-control-container {
  font-family: inherit;
}

.love-map-canvas .leaflet-tile-pane {
  filter: saturate(0.9) sepia(0.08) hue-rotate(350deg);
}

.love-map-canvas .leaflet-control-attribution {
  border-radius: 999px 0 0 0;
  background: rgba(255, 248, 245, 0.82);
  color: rgba(85, 49, 61, 0.72);
  font-size: 0.58rem;
  font-weight: 800;
}

.love-leaflet-marker {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 228, 163, 0.9);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--wine) 62%, var(--gold-deep));
  color: var(--gold-light);
  box-shadow: 0 14px 26px rgba(91, 12, 38, 0.25);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.love-map-tooltip {
  border: 1px solid rgba(217, 164, 65, 0.56);
  border-radius: 999px;
  background: rgba(255, 248, 245, 0.92);
  color: var(--wine);
  box-shadow: 0 12px 22px rgba(91, 12, 38, 0.14);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0.22rem 0.46rem;
}

.love-map-tooltip::before {
  display: none;
}

.love-map-popup {
  display: grid;
  width: 12rem;
  gap: 0.45rem;
  color: var(--wine);
}

.love-map-popup img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.65rem;
  object-fit: cover;
}

.love-map-popup strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1;
}

.love-map-popup span {
  color: rgba(85, 49, 61, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.love-map-popup button {
  min-height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--wine) 58%, var(--gold-deep));
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
}

.love-map-canvas::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(14, 37, 68, 0.08) 49.7% 50.3%, transparent 50.3%),
    linear-gradient(0deg, transparent 49.7%, rgba(14, 37, 68, 0.08) 49.7% 50.3%, transparent 50.3%);
  background-size: 4.5rem 4.5rem;
  content: "";
  opacity: 0.52;
}

.love-map-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.love-map-route polyline {
  stroke: rgba(159, 105, 24, 0.7);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
  filter: drop-shadow(0 7px 8px rgba(91, 12, 38, 0.16));
}

.love-map-pin {
  --pin-x: -50%;
  --pin-y: -50%;
  position: absolute;
  z-index: 2;
  display: inline-flex;
  max-width: min(12rem, 50%);
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem 0.4rem 0.42rem;
  border: 1px solid rgba(217, 164, 65, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 239, 218, 0.88)),
    linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: var(--wine);
  box-shadow: 0 14px 26px rgba(91, 12, 38, 0.14);
  text-align: left;
  transform: translate(var(--pin-x), var(--pin-y));
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.love-map-pin:hover,
.love-map-pin:focus-visible {
  border-color: rgba(197, 40, 79, 0.48);
  box-shadow: 0 18px 32px rgba(91, 12, 38, 0.2);
  transform: translate(var(--pin-x), var(--pin-y)) translateY(-2px);
}

.pin-heart {
  display: grid;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--wine) 62%, var(--gold-deep));
  color: var(--gold-light);
  font-size: 0.92rem;
  line-height: 1;
}

.pin-copy {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.pin-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.05;
}

.pin-copy small {
  color: rgba(85, 49, 61, 0.74);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
}

.story-shell {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 68rem);
  gap: clamp(0.9rem, 2vw, 1.5rem);
  width: min(100%, 78rem);
  align-items: stretch;
}

.story-main {
  display: grid;
  gap: clamp(0.85rem, 1.7vw, 1.15rem);
  min-width: 0;
}

.story-rail {
  display: grid;
  grid-template-rows: auto auto 1fr;
  justify-items: center;
  gap: 1rem;
  min-height: 34rem;
  padding: 1rem 0.65rem;
  border: 1px solid rgba(197, 40, 79, 0.13);
  border-radius: 1.6rem;
  background: rgba(255, 248, 245, 0.62);
  box-shadow: 0 18px 44px rgba(91, 12, 38, 0.12);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--wine);
  color: white;
  box-shadow: 0 13px 24px rgba(74, 15, 36, 0.24);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.icon-button.small {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
}

.icon-button.soft {
  background: rgba(255, 255, 255, 0.72);
  color: var(--wine);
  box-shadow: 0 12px 22px rgba(91, 12, 38, 0.1);
}

.memory-count {
  display: grid;
  gap: 0.15rem;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.memory-count span:first-child {
  color: var(--rose);
  font-size: 1.25rem;
}

.memory-count span:last-child::before {
  content: "/";
  margin-right: 0.1rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-height: 25rem;
  overflow-y: auto;
  padding-block: 0.4rem;
  scrollbar-width: thin;
}

.timeline-button {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  border: 0;
  border-radius: 50%;
  background: rgba(125, 89, 101, 0.28);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.timeline-button::after {
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: 0.6rem;
  background: rgba(125, 89, 101, 0.18);
  content: "";
}

.timeline-button:last-child::after {
  display: none;
}

.timeline-button.is-active {
  background: var(--rose);
  box-shadow: 0 0 0 0.4rem rgba(197, 40, 79, 0.14);
  transform: scale(1.08);
}

.timeline-button.is-video,
.timeline-button.is-collage {
  width: 1rem;
  height: 1rem;
  border-radius: 0.32rem;
  background: rgba(14, 89, 96, 0.34);
}

.timeline-button.is-video.is-active,
.timeline-button.is-collage.is-active {
  background: var(--teal);
  box-shadow: 0 0 0 0.4rem rgba(14, 89, 96, 0.14);
}

.timeline-button.is-collage {
  border-radius: 50%;
  background: rgba(217, 164, 65, 0.5);
}

.timeline-button.is-collage.is-active {
  background: var(--gold-deep);
}

.timeline-button.is-filtered-out {
  opacity: 0.22;
}

.timeline-button.is-favorite::before {
  position: absolute;
  right: -0.28rem;
  top: -0.35rem;
  color: var(--rose);
  content: "♥";
  font-size: 0.62rem;
  line-height: 1;
}

.story-tools {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: clamp(0.8rem, 2vw, 1rem);
}

.memory-search {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--wine);
  font-size: 0.75rem;
  font-weight: 900;
}

.memory-search input {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid rgba(143, 21, 52, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0.66rem 0.9rem;
  outline: none;
}

.memory-search input:focus {
  border-color: rgba(197, 40, 79, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(197, 40, 79, 0.1);
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control-button.is-active,
.control-button[aria-pressed="true"] {
  border-color: rgba(217, 164, 65, 0.45);
  background: linear-gradient(135deg, rgba(255, 228, 163, 0.86), rgba(255, 255, 255, 0.78));
  color: var(--rose-dark);
}

.search-status {
  grid-column: 1 / -1;
  min-height: 1.1rem;
  margin: -0.25rem 0 0;
  color: rgba(85, 49, 61, 0.75);
  font-size: 0.78rem;
  font-weight: 800;
}

.memory-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
  min-height: 34rem;
  border: 1px solid rgba(255, 228, 163, 0.72);
  border-radius: 1.65rem;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(159, 111, 30, 0.12);
  overflow: hidden;
  backdrop-filter: blur(22px);
}

.photo-wrap {
  position: relative;
  min-height: 26rem;
  overflow: hidden;
  background: #f2d7d7;
}

.photo-wrap > img,
.photo-wrap > video,
.memory-collage {
  width: 100%;
  height: 100%;
}

.photo-wrap > img {
  object-fit: contain;
}

.photo-wrap > img:not(.is-hidden),
.memory-collage-tile {
  cursor: zoom-in;
}

.photo-wrap > video {
  object-fit: contain;
  background: #160711;
}

.memory-card.has-video .photo-wrap {
  background: #160711;
}

.memory-card.has-video .photo-shine {
  display: none;
}

.memory-card.has-collage .photo-wrap {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 228, 163, 0.34), transparent 13rem),
    linear-gradient(135deg, #fff2ed, #f5d6dc 54%, #fff1cf);
}

.memory-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(8rem, 1fr);
  gap: clamp(0.35rem, 1vw, 0.65rem);
  padding: clamp(0.45rem, 1.2vw, 0.75rem);
}

.memory-collage[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-collage[data-count="3"],
.memory-collage[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-collage[data-count="5"],
.memory-collage[data-count="6"],
.memory-collage[data-count="7"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory-collage-tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 1px solid rgba(255, 228, 163, 0.78);
  border-radius: 0.85rem;
  background: rgba(255, 248, 245, 0.68);
  box-shadow: 0 14px 28px rgba(91, 12, 38, 0.12);
}

.memory-collage-tile:first-child:nth-last-child(3),
.memory-collage-tile:first-child:nth-last-child(5),
.memory-collage-tile:first-child:nth-last-child(7) {
  grid-row: span 2;
}

.memory-collage-tile:nth-child(4):last-child,
.memory-collage-tile:nth-child(5):last-child {
  grid-column: span 2;
}

.memory-collage-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  width: min(calc(100vw - 2rem), 72rem);
  max-width: none;
  height: min(calc(100vh - 2rem), 48rem);
  max-height: none;
  margin: auto;
  border: 1px solid rgba(255, 228, 163, 0.72);
  border-radius: 1.2rem;
  background: rgba(35, 13, 24, 0.88);
  box-shadow: 0 30px 90px rgba(35, 13, 24, 0.42), inset 0 0 0 1px rgba(255, 248, 245, 0.12);
  padding: clamp(0.55rem, 1.5vw, 0.9rem);
  overflow: hidden;
}

.photo-lightbox::backdrop {
  background: rgba(50, 25, 35, 0.62);
  backdrop-filter: blur(12px);
}

.photo-lightbox img {
  width: 100%;
  height: 100%;
  border-radius: 0.85rem;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid rgba(255, 228, 163, 0.5);
  border-radius: 50%;
  background: rgba(255, 248, 245, 0.84);
  color: var(--wine);
  box-shadow: 0 12px 24px rgba(35, 13, 24, 0.22);
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.media-type {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2;
  padding: 0.45rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(50, 25, 35, 0.62);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  backdrop-filter: blur(12px);
}

.photo-shine {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(50, 25, 35, 0.22), transparent 28%),
    linear-gradient(0deg, rgba(50, 25, 35, 0.24), transparent 44%);
  pointer-events: none;
}

.memory-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.45rem, 4vw, 3rem);
}

.memory-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.favorite-button {
  display: grid;
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
  border: 1px solid rgba(217, 164, 65, 0.38);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  color: var(--rose);
  box-shadow: 0 12px 24px rgba(91, 12, 38, 0.1);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.favorite-button:hover,
.favorite-button:focus-visible {
  background: white;
  box-shadow: 0 16px 28px rgba(91, 12, 38, 0.16);
  transform: translateY(-1px);
}

.favorite-button.is-favorite {
  border-color: rgba(255, 228, 163, 0.78);
  background: linear-gradient(135deg, var(--rose), var(--wine) 62%, var(--gold-deep));
  color: var(--gold-light);
}

.memory-copy h2 {
  margin-top: 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.96;
}

#memoryText {
  margin: 1.2rem 0 0;
  color: #55313d;
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  line-height: 1.75;
  white-space: pre-line;
}

#memoryText.is-empty {
  display: none;
}

.controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.control-button,
.save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid rgba(197, 40, 79, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--wine);
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.control-button:hover,
.control-button:focus-visible,
.save-button:hover,
.save-button:focus-visible {
  background: white;
  box-shadow: 0 14px 28px rgba(91, 12, 38, 0.13);
  transform: translateY(-1px);
}

.control-button.primary,
.save-button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--rose), var(--wine) 54%, var(--gold-deep));
  color: white;
  box-shadow: 0 16px 28px rgba(197, 40, 79, 0.22), inset 0 0 0 1px rgba(255, 228, 163, 0.34);
}

.control-button.compact {
  min-height: 2.55rem;
  padding: 0.62rem 0.85rem;
}

.memory-dialog {
  width: min(calc(100% - 2rem), 34rem);
  border: 0;
  border-radius: 1.35rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.memory-dialog::backdrop {
  background: rgba(50, 25, 35, 0.4);
  backdrop-filter: blur(8px);
}

.memory-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.6rem);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.memory-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--wine);
  font-weight: 800;
}

.memory-form input,
.memory-form textarea {
  width: 100%;
  border: 1px solid rgba(143, 21, 52, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0.85rem 0.9rem;
  outline: none;
}

.memory-form textarea {
  resize: vertical;
}

.memory-form input:focus,
.memory-form textarea:focus {
  border-color: rgba(197, 40, 79, 0.56);
  box-shadow: 0 0 0 0.25rem rgba(197, 40, 79, 0.12);
}

@keyframes drift {
  50% {
    transform: translate3d(0.5rem, -0.7rem, 0) rotate(8deg);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-10px);
  }

  40% {
    transform: translateX(9px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(4px);
  }
}

@media (max-width: 820px) {
  .welcome-shell {
    grid-template-columns: 1fr;
  }

  .love-map-panel {
    grid-column: auto;
  }

  .home-feature-panel {
    grid-column: auto;
  }

  .welcome-intro {
    position: static;
  }

  .home-letter {
    max-height: none;
    overflow: visible;
  }

  .story-shell {
    grid-template-columns: 1fr;
  }

  .story-tools {
    grid-template-columns: 1fr;
  }

  .tool-actions {
    justify-content: stretch;
  }

  .tool-actions .control-button {
    flex: 1 1 10rem;
  }

  .story-rail {
    grid-template-columns: auto auto auto 1fr;
    grid-template-rows: auto;
    min-height: auto;
    padding: 0.8rem;
  }

  .timeline {
    flex-direction: row;
    justify-self: end;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block: 0;
  }

  .timeline-button::after {
    top: calc(50% - 1px);
    left: 100%;
    width: 0.6rem;
    height: 2px;
  }

  .memory-card {
    grid-template-columns: 1fr;
  }

  .photo-wrap {
    min-height: clamp(18rem, 56vw, 28rem);
  }

  .memory-collage {
    grid-auto-rows: minmax(7.2rem, 1fr);
  }
}

@media (max-width: 540px) {
  body {
    background:
      radial-gradient(circle at 20% 8%, rgba(255, 214, 222, 0.78), transparent 18rem),
      radial-gradient(circle at 94% 18%, rgba(255, 220, 142, 0.34), transparent 14rem),
      linear-gradient(145deg, #fff7f2 0%, #f9e0e5 52%, #fff4dd 100%);
  }

  .ambient {
    display: none;
  }

  .lock-screen,
  .welcome-screen,
  .story-screen {
    min-height: 100svh;
    padding: 5.2rem 0.85rem 1rem;
  }

  .couple-mark {
    max-width: calc(100vw - 2rem);
  }

  .floating-counter {
    top: 4.55rem;
    right: 0.85rem;
    min-width: 7.65rem;
    padding: 0.48rem 0.62rem;
    border-radius: 0.78rem;
  }

  body.is-unlocked.is-viewing-story .story-screen {
    padding-top: 7.75rem;
  }

  .lock-panel {
    width: min(100%, 21rem);
    padding: 0.92rem 0.95rem 1.05rem;
    border-radius: 1.5rem;
  }

  .safe-door {
    width: min(100%, 16.8rem);
    height: 6.35rem;
  }

  .safe-handle {
    width: 4rem;
    height: 4rem;
  }

  .lock-collage {
    inset: 5rem 0.4rem 0.7rem;
    grid-template-columns: repeat(3, minmax(4rem, 1fr));
    grid-auto-rows: minmax(5.7rem, 1fr);
    gap: 0.42rem;
    opacity: 0.28;
    transform: none;
  }

  .lock-collage::before {
    inset: -0.4rem;
    background:
      radial-gradient(circle at 50% 48%, rgba(255, 248, 245, 0.78), transparent 12rem),
      linear-gradient(180deg, rgba(255, 247, 242, 0.72), rgba(255, 247, 242, 0.48));
  }

  .collage-tile:nth-child(n + 8),
  .lock-feature-photos {
    display: none;
  }

  .home-photo-backdrop {
    inset: 4.8rem 0 0;
  }

  .home-photo-tile {
    opacity: 0.34;
    border-radius: 0.75rem;
  }

  .home-photo-tile:nth-child(n + 15) {
    display: none;
  }

  .home-photo-tile:nth-child(4n + 1) {
    width: 38vw;
    height: 48vw;
    left: -7vw;
    right: auto;
    top: calc(var(--tile-row) * 12rem);
  }

  .home-photo-tile:nth-child(4n + 2) {
    width: 42vw;
    height: 34vw;
    left: 28vw;
    right: auto;
    top: calc(2rem + var(--tile-row) * 12rem);
  }

  .home-photo-tile:nth-child(4n + 3) {
    width: 36vw;
    height: 46vw;
    left: auto;
    right: -6vw;
    top: calc(0.6rem + var(--tile-row) * 12rem);
  }

  .home-photo-tile:nth-child(4n) {
    width: 42vw;
    height: 32vw;
    left: 8vw;
    right: auto;
    top: calc(7.5rem + var(--tile-row) * 12rem);
  }

  .keypad {
    grid-template-columns: repeat(3, clamp(3rem, 19vw, 3.4rem));
    gap: 0.62rem;
  }

  .key {
    min-height: 0;
    font-size: 1.35rem;
  }

  .memory-copy {
    padding: 1.25rem;
  }

  .memory-collage,
  .memory-collage[data-count="5"],
  .memory-collage[data-count="6"],
  .memory-collage[data-count="7"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(6.4rem, 1fr);
    gap: 0.38rem;
    padding: 0.42rem;
  }

  .memory-collage-tile:first-child:nth-last-child(5),
  .memory-collage-tile:first-child:nth-last-child(7) {
    grid-row: span 1;
  }

  .welcome-intro,
  .love-game-panel,
  .love-map-panel,
  .home-feature-panel,
  .story-tools {
    border-radius: 1.05rem;
  }

  .welcome-intro h1 {
    font-size: clamp(2.4rem, 15vw, 3.5rem);
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-board {
    grid-template-columns: 1fr 1fr;
  }

  .game-card {
    min-height: 5rem;
    padding-inline: 0.35rem;
    font-size: clamp(0.78rem, 3vw, 0.98rem);
  }

  .anniversary-count {
    grid-template-columns: 1fr;
  }

  .anniversary-clock {
    font-size: 1rem;
  }

  .calendar-grid {
    max-height: 18rem;
  }

  .calendar-day {
    min-height: 1.85rem;
    border-radius: 0.45rem;
    font-size: 0.66rem;
  }

  .love-map-canvas {
    height: 16rem;
    min-height: 16rem;
  }

  .love-map-pin {
    max-width: min(8.8rem, 48vw);
    gap: 0.3rem;
    padding: 0.32rem 0.42rem 0.32rem 0.32rem;
  }

  .pin-heart {
    width: 1.38rem;
    height: 1.38rem;
    font-size: 0.76rem;
  }

  .pin-copy strong {
    font-size: 0.68rem;
  }

  .pin-copy small {
    display: none;
  }

  .game-meta,
  .controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .control-button {
    width: 100%;
    padding-inline: 0.65rem;
  }
}
