:root {
  --bg0: #070a12;
  --bg1: #0b1024;
  --bg2: #120a1b;
  --paper0: #f8f3e8;
  --paper1: #f2e7d8;
  --ink: #1a1b1f;
  --muted: rgba(26, 27, 31, 0.7);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke2: rgba(26, 27, 31, 0.12);
  --hot: #ff2d6d;
  --hot2: #8c6cff;
  --hot3: #32d3ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  --shadow-deep:
    0 55px 140px rgba(0, 0, 0, 0.55),
    0 22px 60px rgba(0, 0, 0, 0.32),
    0 8px 20px rgba(0, 0, 0, 0.22);
  --radius: 22px;
  --vh: 1vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(255, 45, 109, 0.22), transparent 55%),
    radial-gradient(900px 600px at 90% 35%, rgba(140, 108, 255, 0.18), transparent 52%),
    radial-gradient(1000px 700px at 55% 95%, rgba(50, 211, 255, 0.12), transparent 55%),
    linear-gradient(135deg, var(--bg0), var(--bg1) 55%, var(--bg2));
  color: rgba(255, 255, 255, 0.92);
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app {
  height: calc(var(--vh) * 100);
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  padding: 14px 16px 10px;
  backdrop-filter: blur(10px);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28),
    rgba(0, 0, 0, 0.12) 55%,
    rgba(0, 0, 0, 0)
  );
}

.hud-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand {
  font-weight: 900;
  letter-spacing: 0.6px;
  font-size: 15px;
  opacity: 0.86;
}

.counter {
  font-size: 13px;
  opacity: 0.78;
}

.hud-right {
  position: absolute;
  right: 16px;
  top: 12px;
}

.progress {
  margin-top: 10px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hot), var(--hot2), var(--hot3));
  transition: width 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.btn-ghost {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.stage {
  height: calc(var(--vh) * 100);
  width: 100%;
  will-change: transform;
  transition: transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide {
  height: calc(var(--vh) * 100);
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    18px
    calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.card {
  position: relative;
  overflow: hidden;
  --rx: 0deg;
  --ry: 0deg;
  --mx: 12%;
  --my: 8%;
  width: min(720px, 100%);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid transparent;
  background:
    radial-gradient(960px 420px at var(--mx) var(--my), rgba(255, 255, 255, 0.18), transparent 62%)
      padding-box,
    radial-gradient(760px 360px at 90% 0%, rgba(50, 211, 255, 0.12), transparent 62%) padding-box,
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.30)) padding-box,
    linear-gradient(
        135deg,
        rgba(255, 215, 128, 0.46),
        rgba(255, 45, 109, 0.30),
        rgba(50, 211, 255, 0.24)
      )
      border-box;
  box-shadow:
    var(--shadow-deep),
    0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  padding: 24px 20px;
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  transform-style: preserve-3d;
  transform: translate3d(0, 10px, 0) rotateX(var(--rx)) rotateY(var(--ry)) scale(0.985);
  transition:
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 680ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 680ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow, filter;
}

.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(520px 280px at var(--mx) var(--my), rgba(255, 255, 255, 0.38), transparent 62%),
    radial-gradient(520px 280px at 86% 12%, rgba(50, 211, 255, 0.18), transparent 65%),
    radial-gradient(640px 320px at 30% 96%, rgba(255, 45, 109, 0.16), transparent 65%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent 9px
    );
  mix-blend-mode: screen;
}

.slide.is-active .card {
  transform: translate3d(0, 0, 0) rotateX(var(--rx)) rotateY(var(--ry)) scale(1);
  filter: saturate(1.05) contrast(1.02);
  box-shadow:
    0 68px 160px rgba(0, 0, 0, 0.58),
    0 28px 70px rgba(0, 0, 0, 0.34),
    0 10px 26px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.paper {
  position: relative;
  --rx: 0deg;
  --ry: 0deg;
  --mx: 18%;
  --my: 0%;
  width: min(720px, 100%);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background:
    radial-gradient(1200px 520px at var(--mx) var(--my), rgba(255, 255, 255, 0.85), transparent 60%)
      padding-box,
    radial-gradient(900px 420px at 92% 10%, rgba(255, 255, 255, 0.46), transparent 62%) padding-box,
    linear-gradient(135deg, var(--paper0), var(--paper1)) padding-box,
    linear-gradient(
        135deg,
        rgba(255, 215, 128, 0.90),
        rgba(255, 45, 109, 0.40),
        rgba(50, 211, 255, 0.32)
      )
      border-box;
  box-shadow:
    0 58px 140px rgba(0, 0, 0, 0.34),
    0 22px 60px rgba(0, 0, 0, 0.20),
    0 8px 20px rgba(0, 0, 0, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.92) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05) inset;
  padding: 26px 22px;
  color: var(--ink);
  overflow: hidden;
  transform-style: preserve-3d;
  transform: translate3d(0, 12px, 0) rotateX(var(--rx)) rotateY(var(--ry)) scale(0.985);
  transition:
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 680ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

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

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(920px 320px at 8% 12%, rgba(255, 45, 109, 0.10), transparent 60%),
    radial-gradient(860px 320px at 92% 18%, rgba(140, 108, 255, 0.08), transparent 62%),
    radial-gradient(900px 340px at 70% 95%, rgba(50, 211, 255, 0.06), transparent 60%),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.018),
      rgba(0, 0, 0, 0.018) 1px,
      transparent 1px,
      transparent 7px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.012),
      rgba(0, 0, 0, 0.012) 1px,
      transparent 1px,
      transparent 10px
    );
  mix-blend-mode: multiply;
}

.paper::after {
  content: "";
  position: absolute;
  inset: -45%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 38%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 62%
  );
  transform: translateX(-60%) rotate(12deg);
}

.slide.is-active .paper::after {
  animation: sheen 1.35s ease-out 0.15s;
}

.slide.is-active .paper {
  transform: translate3d(0, 0, 0) rotateX(var(--rx)) rotateY(var(--ry)) scale(1);
  box-shadow:
    0 70px 170px rgba(0, 0, 0, 0.38),
    0 26px 70px rgba(0, 0, 0, 0.22),
    0 10px 26px rgba(0, 0, 0, 0.16),
    0 2px 0 rgba(255, 255, 255, 0.92) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

@keyframes sheen {
  0% {
    opacity: 0;
    transform: translateX(-60%) rotate(12deg);
  }
  14% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translateX(60%) rotate(12deg);
  }
}

.kicker {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.72;
}

.title {
  margin: 10px 0 8px;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: 0.5px;
}

.title .hot {
  background: linear-gradient(90deg, var(--hot), var(--hot2), var(--hot3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  opacity: 0.78;
}

.paper .subtitle {
  color: var(--muted);
  opacity: 1;
}

.paper .title {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.lines {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.line {
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0.2px;
}

.paper .line {
  color: rgba(26, 27, 31, 0.88);
}

.list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  gap: 10px;
  line-height: 1.45;
}

.bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 7px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.75), transparent 46%),
    conic-gradient(from 180deg, var(--hot), var(--hot2), var(--hot3), var(--hot));
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  flex: 0 0 auto;
}

.paper .bullet {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), transparent 46%),
    conic-gradient(from 180deg, #ff2d6d, #8c6cff, #32d3ff, #ff2d6d);
}

.signature {
  margin-top: 18px;
  text-align: right;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.app[data-page="cake"] .hud {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.app[data-page="cake"] .hint {
  opacity: 0;
  pointer-events: none;
}

.slide.cover-3d {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.cover-scene {
  position: relative;
  width: 100%;
  height: calc(var(--vh) * 100);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.cover-scene:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: -6px;
}

.cover-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 50% 45%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55) 78%),
    radial-gradient(900px 700px at 50% 0%, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 60%);
  opacity: 0.85;
  transition: opacity 520ms ease;
}

.envelope-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  transition: opacity 420ms ease;
}

.cover-scene.is-cake::after {
  opacity: 0;
}

.cover-scene.is-cake .envelope-canvas {
  opacity: 0;
}

.cake-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
  z-index: 3;
}

.cover-scene.is-cake .cake-layer {
  opacity: 1;
  pointer-events: auto;
}

.cake-layer .cake-scene {
  height: calc(var(--vh) * 100);
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.cake-layer .cake-overlay {
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    16px
    calc(16px + env(safe-area-inset-bottom, 0px));
}

.cake-layer .cake-overlay-top {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
}

.cake-layer .cake-hero {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 56%;
  transform: translateY(-50%);
  max-width: min(860px, 100%);
}

.cake-layer .avatar-row {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(820px, calc(100% - 0px));
  margin: 0 auto;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    18px
    calc(18px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  z-index: 2;
}

.cover-top {
  max-width: min(920px, 100%);
  margin: 0 auto;
  text-align: center;
}

.cover-bottom {
  display: grid;
  place-items: center;
}

.cover-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
}

.cover-scene.is-opening .cover-top,
.cover-scene.is-opening .cover-bottom,
.cover-scene.is-cake .cover-top,
.cover-scene.is-cake .cover-bottom,
.cover-scene.is-opened .cover-top,
.cover-scene.is-opened .cover-bottom {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.slide.cake-full {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.slide.cake-full .cake-scene {
  height: calc(var(--vh) * 100);
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.slide.cake-full .cake-overlay {
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    16px
    calc(16px + env(safe-area-inset-bottom, 0px));
}

.slide.cake-full .cake-overlay-top {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
}

.slide.cake-full .cake-hero {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 56%;
  transform: translateY(-50%);
  max-width: min(860px, 100%);
}

.slide.cake-full .avatar-row {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

.cake-wrap {
  margin-top: 18px;
}

.cake-scene {
  position: relative;
  height: clamp(240px, 34vh, 340px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.65) inset;
  background:
    radial-gradient(740px 240px at 12% 10%, rgba(255, 45, 109, 0.22), transparent 60%),
    radial-gradient(640px 240px at 92% 18%, rgba(140, 108, 255, 0.18), transparent 60%),
    radial-gradient(700px 260px at 60% 92%, rgba(50, 211, 255, 0.14), transparent 62%),
    linear-gradient(135deg, rgba(11, 16, 36, 0.96), rgba(18, 10, 27, 0.92));
}

.cake-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.cake-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 12px 10px;
  pointer-events: none;
}

.cake-overlay-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cake-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cake-back {
  pointer-events: auto;
  padding: 10px 12px;
}

.cake-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.cake-tip {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cake-hero {
  pointer-events: none;
  max-width: min(820px, 100%);
  margin: 0 auto;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.16));
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

.cake-hero .kicker {
  opacity: 0.86;
}

.cake-hero .title {
  margin: 10px 0 6px;
  text-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.cake-hero .subtitle {
  opacity: 0.82;
}

.avatar-row {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px) saturate(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
}

.slide.cake-full .avatar-row {
  width: min(820px, calc(100% - 0px));
  margin: 0 auto;
}

.avatar-upload {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.avatar-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(255, 45, 109, 0.40), rgba(140, 108, 255, 0.35));
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-name {
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 12px;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.cake-note {
  pointer-events: none;
  align-self: center;
  max-width: 90%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.cake-note.show {
  opacity: 1;
  transform: translateY(0);
}

.cake-scene.cake-fallback .cake-canvas {
  display: none;
}

.cake-scene.cake-fallback::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 168px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  background:
    radial-gradient(70px 40px at 30% 22%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(70px 40px at 70% 18%, rgba(255, 255, 255, 0.28), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.24) inset;
}

.cake-scene.cake-fallback::after {
  content: "3D 蛋糕未启用";
  position: absolute;
  left: 50%;
  top: calc(50% + 80px);
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.2px;
  opacity: 0.78;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

.hint.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

.hint-arrow {
  display: inline-block;
  margin-left: 6px;
  animation: bob 1.2s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.slide.is-active .reveal {
  opacity: 1;
  transform: translateY(0);
}

.slide.is-active .reveal.delay-1 {
  transition-delay: 70ms;
}
.slide.is-active .reveal.delay-2 {
  transition-delay: 140ms;
}
.slide.is-active .reveal.delay-3 {
  transition-delay: 210ms;
}

.envelope {
  width: min(520px, 100%);
  height: 280px;
  position: relative;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
}

.envelope:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 260px at 15% 25%, rgba(255, 45, 109, 0.22), transparent 60%),
    radial-gradient(600px 260px at 85% 35%, rgba(140, 108, 255, 0.18), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.envelope-flap {
  position: absolute;
  left: -10%;
  right: -10%;
  top: -36%;
  height: 60%;
  transform-origin: 50% 100%;
  transform: perspective(900px) rotateX(0deg);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.04)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.envelope-letter {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 44px;
  height: 200px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--paper0), var(--paper1));
  transform: translateY(64px);
  transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.envelope-letter-inner {
  padding: 16px 14px;
  color: rgba(26, 27, 31, 0.86);
}

.envelope-letter-inner .mini-title {
  font-weight: 950;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.envelope-letter-inner .mini-text {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(26, 27, 31, 0.72);
}

.slide.cover.opening .envelope-flap {
  transform: perspective(900px) rotateX(-128deg);
}

.slide.cover.opening .envelope-letter {
  transform: translateY(-6px);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .stage,
  .reveal,
  .progress-bar,
  .card,
  .paper,
  .envelope-flap,
  .envelope-letter,
  .hint-arrow {
    transition: none !important;
    animation: none !important;
  }
}
