﻿
:root {
  --bg: #ede7ff;
  --bg-2: #f4e9ff;
  --text: #7b65b9;
  --muted: #9d8cc6;
  --panel: rgba(255,255,255,0.7);
  --border: rgba(169, 140, 224, 0.4);
}

* { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
button, a { outline: none; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
  display: grid;
  place-items: center;
  padding: clamp(8px, 3vw, 24px);
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#confetti span {
  position: absolute;
  width: 8px; height: 12px;
  background: #cdb5ff;
  opacity: 0.7;
  border-radius: 2px;
  animation: fall 8s linear infinite;
}
#confetti span:nth-child(2n) { background: #ffc0dd; }
#confetti span:nth-child(3n) { background: #b5d8ff; height: 10px; width: 10px; }

@keyframes fall {
  0% { transform: translateY(-10%) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}

main { width: min(1100px, 100%); }
.screen { display: none; }
.screen.active { display: grid; }
.hidden { display: none !important; }

/* Loader */
.loader {
  position: relative;
  text-align: center;
  gap: 12px;
  padding: clamp(16px, 4vw, 32px);
}
.cat-wrap {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 12px 30px rgba(86, 67, 154, 0.35));
}
.cat {
  width: clamp(240px, 40vw, 340px);
  animation: float 2.6s ease-in-out infinite;
}
h1 {
  margin: 4px 0 0;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: 0.02em;
}
.sub {
  margin: 0;
  color: #9b8fc5;
  font-size: 16px;
}
.progress {
  width: min(360px, 90vw);
  height: 10px;
  background: rgba(143, 121, 206, 0.15);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
  margin: 4px auto 2px;
}
.progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c8a8ff, #9b7fff, #c8a8ff);
  animation: loading 3.6s ease-in-out infinite;
}
.dots { display: flex; gap: 10px; justify-content: center; }
.dot {
  width: 9px; height: 9px;
  background: #c4b2f2;
  border-radius: 50%;
  opacity: 0.5;
}
.dot:nth-child(1){ animation: pulse 1.2s infinite 0.1s; }
.dot:nth-child(2){ animation: pulse 1.2s infinite 0.3s; }
.dot:nth-child(3){ animation: pulse 1.2s infinite 0.5s; }

/* Reveal page */
.reveal {
  text-align: center;
  justify-items: center;
  gap: 14px;
  width: min(960px, 100%);
  margin: 0 auto;
}
.eyebrow {
  margin: 0;
  font-weight: 700;
  color: #9d86d0;
  letter-spacing: 0.02em;
  font-size: 18px;
}
.reveal h2 {
  margin: 0 0 12px;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  color: #8a6be3;
  text-shadow: 0 8px 26px rgba(118, 87, 192, 0.28);
  width: 100%;
}
.card {
  position: relative;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 34px) clamp(18px, 5vw, 40px) clamp(36px, 7vw, 56px);
  box-shadow: 0 18px 36px rgba(123, 101, 185, 0.22);
  display: grid;
  place-items: center;
  gap: 10px;
  overflow: hidden;
  width: min(700px, 90vw);
  margin: 0 auto;
  min-height: 160px;
}
.card-body { max-width: 640px; display: grid; gap: 8px; }
.reveal .cta { margin-top: 6px; }
.card-text {
  margin: 0;
  font-size: 18px;
  color: #7b65b9;
}
.hint {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  min-height: 1.2em;
}
.typewriter { letter-spacing: 0.02em; }
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #b28bff, #9b76f7);
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(123, 101, 185, 0.34);
  transition: transform 0.15s ease, opacity 0.2s ease;
  margin-bottom: 10px;
  width: min(420px, 100%);
}
.cta:hover { opacity: 0.92; }
.cta:active { transform: translateY(2px); }
.ghost {
  background: rgba(168, 141, 227, 0.18);
  color: #7b65b9;
  box-shadow: 0 10px 18px rgba(123, 101, 185, 0.15);
  border: none;
}
.primary {
  background: linear-gradient(135deg, #b28bff, #9b76f7);
  color: #fff;
  box-shadow: 0 16px 26px rgba(123, 101, 185, 0.35);
  border: none;
}
.primary:disabled {
  opacity: 0.55;
  filter: grayscale(0.2);
  cursor: not-allowed;
  box-shadow: none;
}
.shake { animation: shake 0.4s; }
.cta.small { padding: 12px 18px; font-weight: 700; }
.snail {
  position: absolute;
  left: clamp(12px, 3vw, 22px);
  bottom: clamp(10px, 3vw, 20px);
  width: clamp(66px, 11vw, 96px);
}
.rabbit {
  position: absolute;
  right: clamp(12px, 3vw, 22px);
  top: clamp(10px, 2.5vw, 18px);
  width: clamp(74px, 13vw, 110px);
}

@media (max-width: 540px) {
  .snail { display: none !important; }
  .rabbit { display: none !important; }
}

@media (max-width: 768px) {
  .snail { display: none !important; }
}

.note {
  text-align: center;
  gap: 10px;
}
.note-title {
  margin: 0 0 18px;
}
.envelope-wrap {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(169, 140, 224, 0.4);
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(123, 101, 185, 0.22);
  padding: clamp(18px, 4vw, 32px);
  display: grid;
  place-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.envelope {
  width: min(620px, 90vw);
  aspect-ratio: 4 / 2.5;
  background: linear-gradient(180deg, #ddcef8 0%, #d3c3f0 100%);
  border-radius: 18px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.6), 0 18px 28px rgba(123, 101, 185, 0.22);
  overflow: hidden;
  transform-style: preserve-3d;
}
.envelope-wrap.opening {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 22px 40px rgba(123, 101, 185, 0.28);
}
.flap {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d6c7f4 0%, #c7b6eb 100%);
  clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 100%, 0 100%);
  border-radius: 18px;
  transform-origin: top center;
  transition: transform 0.7s ease;
}
.seal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -10%);
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  background: #bfa0f2;
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(123, 101, 185, 0.25);
  font-size: 28px;
  transition: transform 0.35s ease, opacity 0.35s ease;
  animation: sealPulse 1.6s ease-in-out infinite;
}

.envelope.open .flap { transform: rotateX(-115deg) translateY(-6px); }
.envelope.open .seal { transform: translate(-50%, -40%) scale(0.8); opacity: 0; }

.letter {
  text-align: center;
  gap: 16px;
  position: relative;
}
.letter-card {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(169, 140, 224, 0.45);
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(123, 101, 185, 0.22);
  padding: clamp(18px, 4vw, 32px);
  display: grid;
  gap: 14px;
  justify-items: center;
  position: relative;
  overflow: visible;
  width: min(1040px, 100%);
}
.letter-inner {
  background: #fff9ff;
  border-radius: 18px;
  border: 1px solid rgba(169, 140, 224, 0.35);
  padding: clamp(18px, 3vw, 32px);
  width: min(900px, 100%);
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.7);
  display: grid;
  gap: 10px;
  text-align: left;
}
.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hey {
  margin: 0;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 800;
  color: #8a6be3;
}
.sticker {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(123,101,185,0.25));
}
.cat-outer {
  position: absolute;
  top: -10px;
  right: -14px;
  width: clamp(90px, 18vw, 140px);
  transform: rotate(6deg);
  filter: drop-shadow(0 12px 22px rgba(123,101,185,0.25));
  pointer-events: none;
}
.letter-body {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: #4a3f63;
}
.closing {
  margin: 8px 0 0;
  text-align: right;
  color: #8a6be3;
  font-weight: 700;
}
.corner-cat {
  position: absolute;
  right: clamp(10px, 3vw, 24px);
  bottom: clamp(10px, 3vw, 24px);
  width: clamp(90px, 14vw, 140px);
  filter: drop-shadow(0 10px 20px rgba(123,101,185,0.25));
  opacity: 0.9;
}
.heart-particle {
  position: absolute;
  font-size: 18px;
  opacity: 0.9;
  animation: heartFloat 1s ease-out forwards;
  pointer-events: none;
}

/* Songs */
.songs {
  text-align: center;
  gap: 16px;
}
.tapes {
  display: grid;
  gap: 18px;
  width: 100%;
}
.tape {
  position: relative;
  background: #f7e7d7;
  border-radius: 24px;
  padding: clamp(18px, 3vw, 26px) clamp(16px, 3vw, 22px) clamp(30px, 4vw, 40px);
  box-shadow: 0 20px 36px rgba(123, 101, 185, 0.18);
  border: 1px solid rgba(169,140,224,0.22);
  display: grid;
  gap: 10px;
  overflow: hidden;
}
.tape:nth-child(2n) { background: #e1f1df; }
.tape:nth-child(3n) { background: #e5e2ff; }
.tape:nth-child(odd) { transform: rotate(-1deg); }
.tape:nth-child(even) { transform: rotate(1deg); }
.tape .label {
  font-size: 14px;
  color: #a38bc7;
  letter-spacing: 0.08em;
}
.tape .window {
  background: #e9e0ff;
  border: 1px solid rgba(169,140,224,0.32);
  border-radius: 16px;
  padding: 14px clamp(10px, 2vw, 20px);
  box-shadow: inset 0 3px 8px rgba(255,255,255,0.7);
}
.tape h3 {
  margin: 4px 0 4px;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: clamp(22px, 4.8vw, 32px);
  color: #7253c4;
}
.tape .subtitle {
  margin: 0 0 8px;
  color: #8c7ba9;
  font-weight: 600;
}
.player {
  background: #f4f0ff;
  border: 1px solid rgba(169,140,224,0.25);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}
.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f7e7d7;
  color: #7b65b9;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.8);
}
.progress-wrap {
  width: 100%;
  display: grid;
  gap: 4px;
}
.bar-outer {
  height: 12px;
  background: #2f2016;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.25);
}
.bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f5d9a8, #fbdcae);
}
.reel {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #faf0df;
  border: 2px solid #c8ae8a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
.time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #7f6dbd;
  padding: 0 4px;
}
.side {
  font-size: 12px;
  color: #a38bc7;
  text-align: center;
}
.tape-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.tape .hearts {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 32px;
  display: grid;
  gap: 4px;
  justify-items: end;
  color: #b07b5e;
  font-size: 18px;
  opacity: 0.7;
}
.tape .hearts span:last-child { font-size: 14px; opacity: 0.8; }
.tape .holes {
  position: absolute;
  inset: 12px 12px auto auto;
  display: grid;
  gap: 6px;
  color: #9c7b5c;
  font-size: 12px;
  opacity: 0.8;
  right: auto;
  left: 12px;
}
.tape .holes span { width: 10px; height: 10px; }
.center-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #b28bff, #9b76f7);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(123,101,185,0.25);
}
.center-play.playing { background: linear-gradient(135deg, #9f86ff, #7c5cff); }

.play-game {
  margin: 8px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Game */
.game {
  text-align: center;
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}
.game h2 { margin: 0; }
.hero .lede {
  margin: 4px 0 0;
  color: #9f8fc8;
  font-size: 15px;
}
.stats {
  display: flex;
  gap: 18px;
  margin: 10px auto 0;
  justify-content: center;
}
.stat {
  background: #f9f4ff;
  border: 2px solid #e4d9ff;
  padding: 12px 26px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(123, 101, 185, 0.18);
  min-width: 120px;
}
.stat .label { margin: 0; font-size: 14px; color: #a29ac5; }
.stat .value { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: #7b63c8; }
.board {
  background: #f8f3ff;
  border: 1px solid #e4d9ff;
  border-radius: 26px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 22px 34px rgba(123, 101, 185, 0.2);
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: clamp(10px, 2vw, 16px);
  margin: 10px auto 0;
}
.tile {
  position: relative;
  height: clamp(110px, 16vw, 140px);
  cursor: pointer;
  perspective: 900px;
}
.tile-inner {
  position: absolute; inset: 0;
  transition: transform 0.35s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  border-radius: 14px;
  box-shadow: 0 14px 26px rgba(123, 101, 185, 0.25);
}
.tile.flipped .tile-inner { transform: rotateY(180deg); }
.tile-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 42px;
  font-weight: 700;
}
.tile-face.back {
  background: linear-gradient(135deg, #b695ff, #9f7cf1);
  color: #f2e8ff;
}
.tile-face.front {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #e6ddff, #d8cafe);
  border: 2px solid #d1c0ff;
  color: #7f6dbd;
}
.tile.matched .tile-inner {
  box-shadow: 0 10px 22px rgba(116, 205, 164, 0.25);
  opacity: 0.8;
}
.tile-face.done-text {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  font-size: 24px;
  text-transform: uppercase;
}
.tile.disabled { pointer-events: none; }
.actions {
  margin: 16px auto 0;
  display: flex;
  gap: 14px;
  justify-content: center;
}
.actions button {
  min-width: 130px;
}
.win {
  margin: 18px auto 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
  border: 1px solid #f4dfff;
  border-radius: 22px;
  padding: 18px 16px 20px;
  box-shadow: 0 16px 30px rgba(123, 101, 185, 0.2);
  display: grid;
  gap: 6px;
  justify-items: center;
  width: min(540px, 100%);
}
.win h3 { margin: 0; color: #8a6be3; font-size: 26px; }
.win .emoji { font-size: 32px; }
.win .muted { margin: 0; color: #9d8cc6; }
.win-actions { display: flex; gap: 10px; }

.final {
  text-align: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 24px 44px rgba(123,101,185,0.28);
  margin: 18px auto;
  width: min(980px, 100%);
  justify-items: center;
  position: relative;
}
.note-title.big {
  font-size: clamp(34px, 7vw, 58px);
  margin: 4px 0;
}
.final .eyebrow { margin-bottom: 4px; }
.next-cta { margin-top: 14px; }
.thoughts {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: clamp(12px, 2vw, 18px);
  justify-items: center;
  margin-top: 12px;
}
.polaroid {
  width: 100%;
  max-width: 240px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 12px 16px;
  box-shadow: 0 16px 32px rgba(123,101,185,0.26);
  position: relative;
  display: grid;
  gap: 8px;
  transform-origin: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.polaroid:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 18px 32px rgba(123,101,185,0.28);
}
.polaroid-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f5f0ff;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 10px;
}
.polaroid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.caption {
  margin: 0;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 16px;
  color: #7b65b9;
  line-height: 1.3;
}
.emoji { margin: 0; font-size: 18px; }
.tilt-left { transform: rotate(-6deg); }
.tilt-mid { transform: rotate(2deg); }
.tilt-right { transform: rotate(6deg); }
.pin {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 20px;
  height: 12px;
  background: #d9d0ff;
  border-radius: 6px;
  transform: translateX(-50%);
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}
.pin.pin-top { background: #f7d9f0; }
.pin.clip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d5c8ff;
}
.pin.tape {
  width: 32px;
  height: 10px;
  border-radius: 4px;
  background: #c2b6ff;
}

@media (max-width: 760px) {
  .final { width: 100%; border-radius: 18px; padding: 20px; }
  .thoughts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
  .tilt-left, .tilt-mid, .tilt-right { transform: rotate(-2deg); }
  .polaroid { max-width: 200px; }
  .polaroid-img { aspect-ratio: 3 / 4; padding: 10px; }
}

@media (max-width: 520px) {
  .final { padding: 18px 14px; }
  .note-title.big { font-size: clamp(30px, 9vw, 44px); }
  .thoughts { grid-template-columns: 1fr; justify-items: center; }
  .polaroid { max-width: 280px; margin: 0 auto; }
  .tilt-left { transform: rotate(-4deg); }
  .tilt-mid  { transform: rotate(1deg); }
  .tilt-right{ transform: rotate(4deg); }
  .polaroid:hover { transform: translateY(-2px); }
}

/* Why section */
.why {
  text-align: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 24px 44px rgba(123,101,185,0.28);
  margin: 18px auto;
  width: min(1080px, 100%);
  justify-items: center;
}
.why .note-title.big { font-size: clamp(32px, 7vw, 56px); }
.why .lede { margin-bottom: 10px; }
.why-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(12px, 2vw, 18px);
  margin-top: 10px;
}
.why-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75));
  border: 1px solid rgba(169,140,224,0.24);
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(123,101,185,0.18);
  padding: 18px 16px 20px;
  display: grid;
  gap: 8px;
  justify-items: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.why-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(123,101,185,0.22);
}
.why-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #e9ddff);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #8a6be3;
  box-shadow: inset 0 3px 6px rgba(255,255,255,0.7), 0 6px 14px rgba(123,101,185,0.18);
}
.why-card h3 {
  margin: 0;
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 20px;
  color: #7b63c8;
}
.why-card p {
  margin: 0;
  color: #625583;
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .why { padding: 18px 14px; }
  .why-grid { grid-template-columns: 1fr; }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes loading {
  0% { width: 0%; }
  60% { width: 100%; }
  100% { width: 0%; }
}
@keyframes pulse {
  0%,100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}
@keyframes sealPulse {
  0%,100% { transform: translate(-50%, -10%) scale(1); }
  50% { transform: translate(-50%, -13%) scale(1.08); }
}
@keyframes heartFloat {
  0% { transform: translateY(0) scale(0.6); opacity: 0.9; }
  100% { transform: translateY(-40px) scale(1.1); opacity: 0; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  body { place-items: center; }
  main { width: 100%; }
  .loader { margin-top: 0; }
  .cat { width: clamp(170px, 60vw, 240px); }
  h1 { font-size: clamp(26px, 7vw, 36px); }
  .sub { font-size: 15px; }
  .reveal h2 { font-size: clamp(28px, 8vw, 42px); }
  .card { padding: clamp(22px, 7vw, 30px) clamp(16px, 6vw, 24px) clamp(36px, 9vw, 56px); min-height: 190px; }
  .card-body { width: 100%; gap: 10px; }
  .cta { width: 100%; justify-content: center; }
  .card { width: min(640px, 94vw); }
  .note-title { font-size: clamp(28px, 7vw, 40px); }
  .envelope { width: 100%; }
  .letter-card { padding: clamp(14px, 6vw, 24px); border-radius: 18px; }
  .letter-inner { padding: clamp(14px, 5vw, 24px); }
  .letter-body { font-size: 16px; line-height: 1.5; }
  .hey { font-size: 24px; }
  .cat-outer { width: clamp(80px, 24vw, 120px); top: -6px; right: -8px; }
  .tape { padding: 16px 12px 26px; border-radius: 18px; transform: rotate(-0.8deg); }
  .center-play { width: 56px; height: 56px; }
  .bar-outer { height: 10px; }
  .board { grid-template-columns: repeat(4, minmax(90px, 1fr)); }
  .tile { height: clamp(90px, 18vw, 120px); }
  .stats { flex-wrap: wrap; gap: 12px; }
  .stat { min-width: 110px; padding: 10px 18px; }
  .actions { flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
  .actions button { width: 100%; }
}

@media (max-width: 480px) {
  .loader { gap: 10px; }
  .progress { width: min(300px, 92vw); }
  .dots { gap: 8px; }
  .eyebrow { font-size: 16px; }
  .card-text { font-size: 16px; }
  .hint { font-size: 14px; }
  .cta { padding: 13px 18px; }
  .letter-body { font-size: 15px; line-height: 1.48; }
  .letter-card { box-shadow: 0 14px 26px rgba(123,101,185,0.18); }
  .tape { padding: 14px 10px 24px; }
  .tape h3 { font-size: 20px; }
  .center-play { width: 52px; height: 52px; font-size: 18px; }
  .board { grid-template-columns: repeat(3, minmax(80px, 1fr)); }
  .tile { height: clamp(80px, 22vw, 110px); }
  .stats { gap: 10px; }
  .stat { min-width: 100px; }
}




.why-actions { margin-top: 14px; display: grid; place-items: center; width: 100%; }
.why-actions .full-width { width: min(340px, 100%); }

.why-actions { margin-top: 14px; display: grid; place-items: center; width: 100%; }
.why-actions .full-width { width: min(340px, 100%); }

/* Carousel */
.carousel {
  text-align: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 24px 44px rgba(123,101,185,0.28);
  margin: 18px auto;
  width: min(1080px, 100%);
  justify-items: center;
}
.carousel .note-title.big { font-size: clamp(32px, 7vw, 56px); }
.carousel-frame {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(169,140,224,0.24);
  box-shadow: inset 0 2px 10px rgba(255,255,255,0.6), 0 16px 32px rgba(123,101,185,0.18);
}
.carousel-track {
  display: flex;
  gap: 16px;
  padding: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}
.slide {
  min-width: 240px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(123,101,185,0.2);
  overflow: hidden;
  display: grid;
  gap: 8px;
  scroll-snap-align: start;
  padding: 10px 10px 14px;
  position: relative;
}
.slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  background: #f7f4ff;
}
.slide p {
  margin: 0;
  font-weight: 700;
  color: #7b65b9;
}
.tack {
  position: absolute;
  width: 26px;
  height: 14px;
  border-radius: 6px;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  background: #c7baff;
}
.tack.pink { background: #f7c8f5; }
.tack.mint { background: #c8f3e1; }
.tack.yellow { background: #f9e3a0; }
.tack.blue { background: #c8dfff; }
.tilt-left { transform: rotate(-5deg); }
.tilt-mid { transform: rotate(1deg); }
.tilt-right { transform: rotate(5deg); }
.carousel-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.carousel-actions .ghost {
  min-width: 60px;
  border-radius: 14px;
  font-size: 18px;
}

@media (max-width: 700px) {
  .carousel { padding: 18px 14px; }
  .carousel-track { gap: 12px; padding: 12px; }
  .slide { min-width: 200px; padding: 10px 10px 12px; }
  .slide img { height: 180px; object-fit: cover; }
  /* keep playful tilt on mobile, just reduce the angle for readability */
  .tilt-left { transform: rotate(-3deg); }
  .tilt-mid { transform: rotate(1deg); }
  .tilt-right { transform: rotate(3deg); }
}

