:root {
  --bg-1: #fffdfd;
  --bg-2: #fff6fa;
  --bg-3: #fff1f4;
  --bg-4: #fff5eb;
  --site-background-image: url("images/fon.jpg");
  --card: rgba(255, 255, 255, 0.7);
  --card-strong: rgba(255, 255, 255, 0.84);
  --card-border: rgba(255, 255, 255, 0.62);
  --text: #5c4552;
  --text-soft: #876979;
  --text-muted: #a68997;
  --accent: #eea2bf;
  --accent-2: #dd7ba1;
  --accent-3: #f7c4d8;
  --accent-warm: #ffe0bd;
  --shadow:
    0 34px 90px rgba(170, 101, 129, 0.16), 0 14px 34px rgba(108, 72, 88, 0.09);
  --shadow-soft: 0 24px 60px rgba(204, 155, 178, 0.14);
  --radius-2xl: 36px;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --card-shell-width: 396px;
  --card-shell-aspect: 9 / 16;
  --card-shell-min-height: 704px;
  --card-shell-mobile-width: min(100vw - 24px, 400px);
  --card-shell-mobile-min-height: min(calc(100dvh - 26px), 760px);
  --font-body:
    "Avenir Next", "SF Pro Text", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display:
    "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-ui:
    "Avenir Next", "SF Pro Display", "Segoe UI", "Helvetica Neue", sans-serif;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --enter-duration: 820ms;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(
      circle at 16% 18%,
      rgba(255, 228, 239, 0.88),
      transparent 34%
    ),
    radial-gradient(
      circle at 82% 16%,
      rgba(255, 239, 214, 0.8),
      transparent 30%
    ),
    radial-gradient(
      circle at 50% 78%,
      rgba(255, 233, 241, 0.74),
      transparent 36%
    ),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-4) 100%);
}

body {
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before,
body::after,
.app-shell::before,
.bg-glow,
.app::before {
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    filter 0.8s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -18vmax;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(
      180deg,
      rgba(255, 251, 253, 0.72),
      rgba(255, 245, 249, 0.56) 36%,
      rgba(255, 239, 228, 0.62) 100%
    ),
    radial-gradient(
      circle at 20% 22%,
      rgba(255, 233, 242, 0.7),
      transparent 18%
    ),
    radial-gradient(
      circle at 78% 18%,
      rgba(255, 235, 206, 0.5),
      transparent 16%
    ),
    radial-gradient(
      circle at 52% 46%,
      rgba(255, 255, 255, 0.48),
      transparent 22%
    ),
    var(--site-background-image) center center / cover no-repeat;
  filter: blur(24px) saturate(0.9) brightness(0.96);
  transform: scale(1.08);
  opacity: 0.78;
  animation: ambientFloat 18s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(
      circle at 28% 34%,
      rgba(255, 255, 255, 0.7),
      transparent 7%
    ),
    radial-gradient(
      circle at 68% 30%,
      rgba(255, 247, 250, 0.44),
      transparent 9%
    ),
    radial-gradient(
      circle at 62% 68%,
      rgba(255, 242, 223, 0.42),
      transparent 8%
    ),
    radial-gradient(
      circle at 34% 78%,
      rgba(250, 213, 228, 0.38),
      transparent 10%
    );
  filter: blur(8px);
  opacity: 0.75;
  animation: ambientLift 22s ease-in-out infinite alternate;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  isolation: isolate;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(84vw, 880px);
  height: min(72vw, 760px);
  transform: translate(-50%, -48%);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 247, 250, 0.78) 34%,
    rgba(255, 236, 215, 0.4) 58%,
    transparent 86%
  );
  filter: blur(28px);
  opacity: 0.94;
  pointer-events: none;
  z-index: 0;
}

.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #030303;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.app-shell.intro-preparing::after {
  animation: introOverlayFadeIn 760ms var(--ease-soft) forwards;
}

.app-shell.story-entering::after {
  animation: storyOverlayFade 1680ms var(--ease-soft) forwards;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(56px);
  opacity: 0.52;
  pointer-events: none;
  z-index: 0;
  animation: glowDrift 14s ease-in-out infinite alternate;
}

.bg-glow-1 {
  width: 320px;
  height: 320px;
  background: rgba(255, 214, 231, 0.84);
  top: 4%;
  left: -50px;
}

.bg-glow-2 {
  width: 380px;
  height: 380px;
  background: rgba(255, 235, 196, 0.76);
  right: -90px;
  bottom: 0;
  animation-duration: 17s;
  animation-delay: -4s;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--card-shell-width);
}

.app::before {
  content: "";
  position: absolute;
  inset: 8% 5%;
  border-radius: 48px;
  background: radial-gradient(
    circle at 50% 14%,
    rgba(255, 255, 255, 0.68) 0%,
    rgba(255, 245, 249, 0.48) 48%,
    transparent 100%
  );
  filter: blur(34px);
  opacity: 0.78;
  pointer-events: none;
  z-index: -1;
}

body.intro-active {
  background: #030303;
  color: #fffafc;
}

body.intro-active::before,
body.intro-active::after,
.app-shell.intro-active::before,
.app-shell.intro-active .bg-glow,
.app-shell.intro-active .app::before {
  opacity: 0;
}

.app-shell.intro-active {
  padding: 0;
  align-items: stretch;
}

.app-shell.intro-active .app {
  max-width: none;
  min-height: 100vh;
  display: flex;
}

.intro-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 36%,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 221, 235, 0.04) 20%,
      rgba(0, 0, 0, 0) 42%
    ),
    radial-gradient(
      circle at 50% 72%,
      rgba(255, 208, 227, 0.06) 0%,
      rgba(0, 0, 0, 0) 32%
    ),
    linear-gradient(180deg, #050505 0%, #020202 100%);
}

.intro-screen::before,
.intro-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.intro-screen::before {
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(255, 255, 255, 0.06),
      rgba(255, 233, 242, 0.018) 18%,
      transparent 42%
    ),
    radial-gradient(
      circle at 50% 65%,
      rgba(255, 228, 204, 0.028),
      transparent 36%
    );
  filter: blur(18px);
  opacity: 0.56;
}

.intro-screen::after {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.008),
    rgba(0, 0, 0, 0) 26%,
    rgba(0, 0, 0, 0.34) 100%
  );
}

.intro-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.22;
  pointer-events: none;
  animation: introOrbFloat 14s ease-in-out infinite alternate;
}

.intro-orb-left {
  width: 320px;
  height: 320px;
  left: -80px;
  top: 12%;
  background: rgba(255, 188, 219, 0.5);
}

.intro-orb-right {
  width: 360px;
  height: 360px;
  right: -110px;
  bottom: 8%;
  background: rgba(255, 220, 177, 0.34);
  animation-duration: 17s;
}

.intro-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 860px);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
}

.intro-title {
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 78px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: rgba(255, 250, 252, 0.98);
  text-shadow:
    0 0 22px rgba(255, 236, 244, 0.12),
    0 0 56px rgba(255, 214, 230, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.42);
}

.intro-word {
  display: inline-block;
  white-space: nowrap;
}

.intro-char {
  display: inline-block;
  opacity: 0;
  filter: blur(18px);
  transform: translateY(22px) scale(0.82) rotate(-4deg);
  will-change: transform, opacity, filter;
}

.intro-space {
  white-space: break-spaces;
}

.intro-screen.is-text-visible .intro-char {
  animation: introCharReveal 1280ms var(--ease-soft) forwards;
  animation-delay: calc(var(--char-index, 0) * 38ms);
}

.intro-cta {
  min-width: 168px;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 224, 236, 0.08)
    );
  color: rgba(255, 248, 251, 0.96);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  pointer-events: none;
  transition:
    opacity 0.8s var(--ease-soft),
    transform 0.8s var(--ease-soft),
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.intro-cta.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.intro-cta:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18),
      rgba(255, 224, 236, 0.12)
    );
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.intro-cta:active {
  transform: translateY(1px) scale(0.985);
}

.intro-cta.is-leaving {
  opacity: 0;
  transform: translateY(14px) scale(0.94);
}

.intro-screen.is-exiting .intro-content {
  opacity: 0;
  transform: scale(0.72);
  filter: blur(8px);
  transition:
    opacity 1.22s ease,
    transform 1.22s var(--ease-soft),
    filter 1.22s ease;
}

.app.is-intro-preparing {
  pointer-events: none;
}

.access-card.is-exiting-to-intro {
  animation: accessCardFadeOut 760ms var(--ease-soft) forwards;
}

.card {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: var(--card-shell-aspect);
  min-height: var(--card-shell-min-height);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 248, 251, 0.72) 62%,
    rgba(255, 245, 248, 0.78) 100%
  );
  backdrop-filter: blur(28px) saturate(1.14);
  -webkit-backdrop-filter: blur(28px) saturate(1.14);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardFloatIn var(--enter-duration) var(--ease-soft);
}

.card-screen {
  width: min(100%, var(--card-shell-width), calc(85dvh * 9 / 16));
  height: min(var(--card-shell-min-height), 85vh, 85dvh);
  max-height: 85vh;
  max-height: 85dvh;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.48) 0%,
    rgba(255, 255, 255, 0.16) 38%,
    rgba(255, 240, 245, 0.18) 100%
  );
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-2xl) - 1px);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: minmax(0, 40%) minmax(0, 1fr);
  min-height: 100%;
  overflow: hidden;
}

.card-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 18px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.card-story-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.card-header {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.card-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  text-align: center;
}

.card-footer {
  flex: 0 0 auto;
  padding-top: 14px;
  margin-top: 8px;
}

.card-footer:empty {
  display: none;
}

.card-layout-compact .card-content {
  padding: 10px 16px 14px;
}

.card-layout-compact .card-body {
  gap: 8px;
}

.card-layout-compact .title {
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.22;
  max-height: calc(1.22em * 4);
}

.card-layout-compact .text {
  font-size: clamp(13px, 1.75vw, 15px);
  line-height: 1.38;
  max-height: calc(1.38em * 4);
}

.card-layout-compact .memory-card {
  margin-top: 6px;
  padding: 10px 12px;
}

.card-layout-compact .memory-label {
  margin-bottom: 4px;
  font-size: 10px;
}

.card-layout-compact .card-footer {
  padding-top: 10px;
  margin-top: 6px;
}

.card-layout-compact .actions {
  gap: 8px;
}

.card-layout-compact .btn {
  padding: 12px 14px;
  font-size: 13px;
}

.card-stage {
  opacity: 0;
  transform: translateY(18px);
  animation: contentReveal 860ms var(--ease-soft) forwards;
  animation-delay: calc(40ms + var(--stage-order, 0) * 76ms);
}

.card-photo-slot {
  --card-photo-position: 50% 36%;
  --card-photo-mobile-position: var(--card-photo-position);
  --card-photo-height: 250px;
  --card-photo-mobile-height: 210px;
  position: relative;
  min-height: 0;
  padding: 14px 14px 0;
  z-index: 1;
}

.card-photo-glow {
  position: absolute;
  inset: 22px 40px 0;
  border-radius: 32px;
  background: radial-gradient(
    circle at 50% 30%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(247, 196, 216, 0.46) 44%,
    rgba(255, 224, 189, 0.3) 72%,
    transparent 100%
  );
  filter: blur(28px);
  opacity: 0.82;
  animation: haloPulse 8s ease-in-out infinite alternate;
}

.card-photo-frame {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 243, 248, 0.94)
  );
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(18px) scale(0.984);
  animation: heroFrameReveal 1300ms var(--ease-soft) forwards;
}

.card-photo-frame::before {
  display: none;
}

.card-photo-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 3;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  pointer-events: none;
}

.card-photo-image,
.card-photo-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-photo-image {
  display: block;
  object-fit: cover;
  object-position: var(--card-photo-position);
  opacity: 0;
  transform: scale(1.08);
  filter: saturate(0.92) brightness(1.02) contrast(0.98);
  transition:
    opacity 820ms ease,
    transform 2400ms var(--ease-soft),
    filter 1400ms ease;
}

.card-photo-placeholder {
  background:
    radial-gradient(
      circle at 32% 26%,
      rgba(255, 255, 255, 0.92),
      rgba(255, 235, 243, 0.78) 42%,
      rgba(255, 224, 189, 0.42) 86%
    ),
    linear-gradient(
      135deg,
      rgba(255, 247, 250, 0.98),
      rgba(255, 236, 242, 0.94)
    );
  transition: opacity 420ms ease;
}

.card-photo-shimmer {
  position: absolute;
  top: -16%;
  bottom: -16%;
  left: -34%;
  z-index: 4;
  width: 34%;
  opacity: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 18%,
    rgba(255, 255, 255, 0.84) 48%,
    rgba(255, 255, 255, 0.06) 74%,
    transparent 100%
  );
  transform: translateX(-150%) skewX(-20deg);
  pointer-events: none;
  display: none;
}

.card-photo-slot.is-loaded .card-photo-image {
  opacity: 1;
  transform: scale(1.015);
  filter: saturate(1) brightness(1.01) contrast(1);
  animation: heroDrift 17s ease-in-out 1.1s infinite alternate;
}

.card-photo-slot.is-loaded .card-photo-placeholder {
  opacity: 0;
}

.card-photo-slot.is-loaded .card-photo-shimmer {
  opacity: 0;
  animation: none;
}

.card-photo-slot.is-missing .card-photo-frame {
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 242, 246, 0.94) 48%,
      rgba(255, 231, 191, 0.72) 100%
    ),
    linear-gradient(
      140deg,
      rgba(255, 247, 250, 0.98),
      rgba(255, 235, 241, 0.96)
    );
}

.card-photo-slot.has-gallery .card-photo-frame {
  touch-action: pan-y;
  user-select: none;
}

.card-photo-slot.has-gallery .card-photo-image {
  opacity: 0;
  transform: scale(1.035);
  filter: saturate(0.96) brightness(1) contrast(0.99);
  transition:
    opacity 380ms ease,
    transform 420ms var(--ease-soft),
    filter 620ms ease;
  animation: none;
}

.card-photo-slot.has-gallery .card-photo-image.is-visible {
  opacity: 1;
  transform: scale(1.015);
  filter: saturate(1) brightness(1.01) contrast(1);
  animation: heroDrift 17s ease-in-out 1s infinite alternate;
}

.card-photo-gallery-controls {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
}

.card-photo-gallery-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: rgba(92, 69, 82, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  backdrop-filter: blur(14px) saturate(1.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  box-shadow:
    0 12px 30px rgba(120, 84, 101, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.card-photo-gallery-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.38);
  box-shadow:
    0 14px 34px rgba(120, 84, 101, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.card-photo-gallery-btn:active {
  transform: scale(0.96);
}

.card-photo-gallery-btn:focus-visible,
.card-photo-gallery-dot:focus-visible {
  outline: 2px solid rgba(232, 157, 191, 0.9);
  outline-offset: 2px;
}

.card-photo-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.card-photo-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 4px 14px rgba(118, 82, 99, 0.16);
  cursor: pointer;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    opacity 0.22s ease;
}

.card-photo-gallery-dot:hover {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.72);
}

.card-photo-gallery-dot.is-active {
  background: linear-gradient(
    135deg,
    rgba(245, 167, 198, 0.98),
    rgba(255, 215, 170, 0.98)
  );
  transform: scale(1.25);
}

.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.nav-spacer {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.nav-back,
.nav-logout {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 246, 249, 0.8)
  );
  color: var(--accent-2);
  box-shadow:
    0 14px 28px rgba(139, 92, 113, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-family: var(--font-ui);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.nav-back:hover,
.nav-logout:hover {
  border-color: rgba(238, 162, 191, 0.36);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 246, 249, 0.9)
  );
  box-shadow:
    0 18px 32px rgba(139, 92, 113, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.nav-back:active,
.nav-logout:active,
.btn:active {
  transform: translateY(1px) scale(0.985);
}

.nav-back {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.nav-logout {
  min-width: 70px;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(233, 168, 194, 0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.55);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(247, 196, 216, 0.96),
    rgba(238, 162, 191, 0.96) 58%,
    rgba(255, 223, 183, 0.96)
  );
  box-shadow: 0 0 18px rgba(238, 162, 191, 0.32);
  transition: width 0.45s var(--ease-soft);
}

.progress-text {
  min-width: 46px;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 28px;
  padding: 5px 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 248, 251, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: #694d5b;
  white-space: pre-line;
  text-wrap: balance;
  text-shadow: 0 10px 30px rgba(173, 123, 145, 0.08);
  max-height: calc(1.3em * 4);
  overflow: hidden;
}

.title.center,
.text.center {
  text-align: center;
}

.text {
  margin: 0;
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--text-soft);
  white-space: pre-line;
  max-height: calc(1.5em * 4);
  overflow: hidden;
}

.text.center {
  max-width: 28ch;
  margin-inline: auto;
}

.text + .text {
  margin-top: 10px;
}

.reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-line-inner {
  display: block;
  opacity: 0;
  transform: translateX(-18px);
  clip-path: inset(0 100% 0 0);
  animation: textSweepIn 1880ms var(--ease-soft) forwards;
  animation-delay: calc(240ms + var(--line-index, 0) * 150ms);
  will-change: transform, opacity, clip-path;
}

.title .reveal-line + .reveal-line {
  margin-top: 0.08em;
}

.title .reveal-line-inner {
  transform: translateX(-22px);
  animation-duration: 2080ms;
  animation-delay: calc(320ms + var(--line-index, 0) * 170ms);
}

.text .reveal-line-inner {
  animation-duration: 1760ms;
  animation-delay: calc(520ms + var(--line-index, 0) * 140ms);
}

.text .reveal-line + .reveal-line {
  margin-top: 0.24em;
}

.modal-caption h3 .reveal-line-inner {
  animation-duration: 980ms;
  animation-delay: calc(90ms + var(--line-index, 0) * 80ms);
}

.modal-caption p .reveal-line-inner {
  animation-duration: 960ms;
  animation-delay: calc(180ms + var(--line-index, 0) * 78ms);
}

.actions {
  margin-top: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.26),
    rgba(255, 255, 255, 0)
  );
  opacity: 0.85;
  pointer-events: none;
}

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

.btn:disabled,
.access-input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(247, 181, 207, 0.98),
    rgba(228, 126, 167, 0.98) 56%,
    rgba(255, 203, 143, 0.98)
  );
  box-shadow:
    0 18px 38px rgba(228, 126, 167, 0.24),
    0 8px 16px rgba(255, 214, 169, 0.14);
}

.btn-primary:hover {
  box-shadow:
    0 22px 44px rgba(228, 126, 167, 0.28),
    0 10px 18px rgba(255, 214, 169, 0.18);
}

.btn-secondary {
  color: var(--accent-2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88),
    rgba(255, 245, 249, 0.76)
  );
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 12px 28px rgba(139, 92, 113, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.btn-secondary:hover {
  border-color: rgba(238, 162, 191, 0.34);
}

.btn-ghost {
  color: var(--text-soft);
  background: transparent;
  font-weight: 600;
}

.access-card {
  max-width: 560px;
}

.access-form {
  margin-top: auto;
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.access-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.access-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 247, 250, 0.82)
  );
  color: var(--text);
  padding: 17px 18px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(196, 144, 166, 0.08);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.access-input:focus {
  border-color: rgba(238, 162, 191, 0.52);
  box-shadow:
    0 0 0 4px rgba(244, 182, 206, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 26px rgba(196, 144, 166, 0.1);
}

.access-message {
  min-height: 22px;
  font-size: 14px;
  color: var(--text-soft);
}

.access-message.error {
  color: #b15a79;
}

.access-meta {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  color: var(--text-soft);
}

.access-steps {
  margin-top: 14px;
}

.access-steps .access-meta {
  margin-top: 10px;
}

.access-code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 243, 248, 0.86)
  );
  border: 1px solid rgba(255, 255, 255, 0.68);
  color: #6d4d5a;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.memory-card,
.final-place {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.76),
    rgba(255, 246, 249, 0.66)
  );
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 14px 32px rgba(161, 114, 136, 0.08);
}

.memory-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.quiz-options {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  padding: 12px 13px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 245, 249, 0.72)
  );
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.quiz-option:hover {
  transform: translateY(-1px);
  border-color: rgba(238, 162, 191, 0.42);
  box-shadow:
    0 16px 28px rgba(161, 114, 136, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  background: linear-gradient(
    180deg,
    rgba(224, 250, 235, 0.9),
    rgba(205, 243, 221, 0.8)
  );
  border-color: rgba(110, 187, 144, 0.44);
}

.quiz-option.wrong {
  background: linear-gradient(
    180deg,
    rgba(255, 231, 236, 0.94),
    rgba(255, 218, 225, 0.86)
  );
  border-color: rgba(224, 89, 112, 0.3);
}

.hint {
  margin-top: 8px;
  min-height: 20px;
  font-size: 13px;
  text-align: center;
  color: var(--text-soft);
}

.final-place {
  color: var(--accent-2);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  text-align: center;
}

.muted {
  color: var(--text-soft);
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(78, 49, 63, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: 88vh;
  overflow: auto;
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 30px 80px rgba(91, 68, 80, 0.24);
  animation: modalBloom 420ms var(--ease-soft);
}

.modal-card.modal-card-celebrate {
  animation: birthdayMemoryOpen 760ms var(--ease-soft);
}

.modal-card.is-photo-memory {
  box-shadow:
    0 34px 92px rgba(118, 78, 97, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

.modal-card.is-audio-memory {
  background:
    radial-gradient(
      circle at top,
      rgba(76, 63, 82, 0.36),
      transparent 44%
    ),
    linear-gradient(
      180deg,
      rgba(28, 31, 42, 0.96),
      rgba(14, 16, 24, 0.98)
    );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 34px 92px rgba(5, 7, 12, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.modal-card.is-audio-memory .modal-close {
  top: 12px;
  right: 12px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(6, 8, 14, 0.28);
  color: rgba(255, 240, 244, 0.92);
}

.modal-card:focus {
  outline: none;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  z-index: 6;
  border: none;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-2);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(91, 68, 80, 0.12);
}

.modal-media-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(
    circle at top,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(255, 246, 250, 0.98) 48%,
    rgba(253, 238, 244, 0.98) 100%
  );
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-media-wrap > * {
  position: relative;
  z-index: 1;
}

.modal-media-wrap.is-photo-media {
  background: radial-gradient(
    circle at 50% 0%,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(255, 247, 251, 0.98) 44%,
    rgba(255, 238, 245, 0.98) 100%
  );
}

.modal-media-wrap.is-photo-media::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 0;
  border-radius: 24px;
  background: radial-gradient(
    circle at 50% 18%,
    rgba(255, 255, 255, 0.92),
    rgba(247, 191, 212, 0.3) 44%,
    rgba(255, 231, 184, 0.18) 68%,
    transparent 100%
  );
  filter: blur(28px);
  opacity: 0.95;
}

.modal-media-wrap.is-audio-media {
  min-height: 0;
  background: transparent;
  border-radius: 28px;
  overflow: visible;
}

.modal-card.is-audio-memory .modal-caption {
  display: none;
}

.memory-celebration {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.memory-particle {
  position: absolute;
  top: -14%;
  left: var(--particle-left);
  width: var(--particle-size);
  height: calc(var(--particle-size) * 1.45);
  opacity: 0;
  background: var(--particle-color);
  border-radius: 65% 65% 72% 72% / 84% 84% 46% 46%;
  box-shadow: 0 10px 18px rgba(217, 107, 151, 0.18);
  transform: translate3d(0, -18px, 0) rotate(var(--particle-rotate)) scale(0.82);
  animation: petalCascade var(--particle-duration) linear forwards;
  animation-delay: var(--particle-delay);
}

.memory-particle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  width: 28%;
  height: 36%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  transform: translateX(-50%);
}

.memory-particle.is-sparkle {
  width: calc(var(--particle-size) * 0.55);
  height: calc(var(--particle-size) * 0.55);
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.96),
    var(--particle-color) 72%
  );
  box-shadow: 0 0 18px rgba(255, 235, 196, 0.48);
  animation-name: sparkleCascade;
}

.memory-particle.is-sparkle::after {
  display: none;
}

.modal-photo-stage {
  position: relative;
  width: 100%;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-photo-aura {
  position: absolute;
  inset: 12% 13% 10%;
  border-radius: 34px;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(247, 191, 212, 0.38) 42%,
    rgba(232, 142, 177, 0.16) 72%,
    transparent 100%
  );
  filter: blur(30px);
  opacity: 0.78;
  transform: scale(0.9);
  transition:
    opacity 1180ms ease,
    transform 1680ms var(--ease-soft);
}

.modal-photo-frame {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 246, 250, 0.9)
  );
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 26px 56px rgba(118, 78, 97, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.955) rotate(-1.2deg);
  transition:
    opacity 860ms ease,
    transform 1480ms var(--ease-soft),
    box-shadow 1480ms ease;
}

.modal-photo-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

.modal-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  opacity: 0;
  clip-path: inset(0 0 100% 0 round 18px);
  transform: scale(1.08);
  filter: saturate(0.92) brightness(1.05) contrast(0.98);
  transition:
    opacity 680ms ease 140ms,
    clip-path 1760ms var(--ease-soft) 140ms,
    transform 1880ms var(--ease-soft) 140ms,
    filter 1620ms ease 210ms;
}

.modal-photo-veil {
  position: absolute;
  inset: 10px;
  z-index: 2;
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 247, 251, 0.72) 42%,
    rgba(255, 255, 255, 0) 100%
  );
  transform-origin: top;
  transition:
    opacity 980ms ease 220ms,
    transform 1520ms var(--ease-soft) 220ms;
}

.modal-photo-shine {
  position: absolute;
  top: -14%;
  bottom: -14%;
  left: -30%;
  z-index: 3;
  width: 36%;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 18%,
    rgba(255, 255, 255, 0.72) 48%,
    rgba(255, 255, 255, 0.08) 76%,
    transparent 100%
  );
  transform: translateX(-140%) skewX(-18deg);
  pointer-events: none;
}

.modal-photo-stage.is-loaded .modal-photo-aura {
  opacity: 1;
  transform: scale(1.03);
  animation: photoAuraPulse 2800ms ease-in-out infinite alternate;
}

.modal-photo-stage.is-loaded .modal-photo-frame {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(-0.45deg);
  box-shadow:
    0 30px 64px rgba(118, 78, 97, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.modal-photo-stage.is-loaded .modal-photo {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 18px);
  transform: scale(1);
  filter: saturate(1.02) brightness(1.02) contrast(1);
}

.modal-photo-stage.is-loaded .modal-photo-veil {
  opacity: 0;
  transform: translateY(-108%);
}

.modal-photo-stage.is-loaded .modal-photo-shine {
  opacity: 1;
  animation: photoShineSweep 1980ms ease 760ms forwards;
}

.modal-media-wrap img:not(.modal-photo):not(.modal-audio-cover),
.modal-media-wrap video {
  display: block;
  width: 100%;
  height: auto;
  animation: mediaReveal 520ms var(--ease-soft);
}

.modal-media-wrap audio {
  width: 100%;
  margin: 26px 0;
  animation: contentReveal 520ms var(--ease-soft) both;
}

.modal-audio-stage {
  position: relative;
  width: 100%;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalBloom 620ms var(--ease-soft) both;
}

.modal-audio-aura {
  position: absolute;
  inset: 0 4% 12%;
  border-radius: 42px;
  background:
    radial-gradient(
      circle at 50% 16%,
      rgba(255, 230, 238, 0.18),
      rgba(255, 186, 211, 0.08) 38%,
      transparent 72%
    ),
    radial-gradient(
      circle at 50% 70%,
      rgba(125, 103, 211, 0.16),
      transparent 56%
    );
  filter: blur(42px);
  opacity: 0.88;
  animation: haloPulse 8s ease-in-out infinite alternate;
}

.modal-audio-cover-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(25, 28, 38, 0.98),
      rgba(16, 18, 25, 0.98)
    );
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 18px 40px rgba(5, 7, 12, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-audio-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  filter: saturate(0.9) brightness(0.78) contrast(1.04);
  transition:
    opacity 720ms ease,
    transform 2200ms var(--ease-soft),
    filter 1200ms ease;
}

.modal-audio-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(255, 215, 227, 0.18),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(34, 38, 49, 0.98),
      rgba(16, 19, 27, 0.98)
    );
  color: rgba(255, 236, 242, 0.9);
  transition: opacity 420ms ease;
}

.modal-audio-cover-placeholder-icon {
  font-size: 38px;
  line-height: 1;
  opacity: 0.9;
}

.modal-audio-cover-placeholder-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-audio-cover-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(5, 8, 16, 0.16) 0%,
      rgba(6, 9, 14, 0.06) 28%,
      rgba(5, 8, 14, 0.42) 100%
    ),
    radial-gradient(
      circle at 50% 34%,
      transparent 0%,
      rgba(0, 0, 0, 0.12) 68%,
      rgba(0, 0, 0, 0.24) 100%
    );
  pointer-events: none;
}

.modal-audio-cover-border {
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.modal-audio-cover-label {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 235, 241, 0.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-audio-stage.is-cover-loaded .modal-audio-cover {
  opacity: 1;
  transform: scale(1);
  filter: saturate(0.98) brightness(0.88) contrast(1.02);
}

.modal-audio-stage.is-cover-loaded .modal-audio-cover-placeholder {
  opacity: 0;
}

.modal-audio-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 14px;
  padding: 18px 18px 16px;
  border-radius: 30px;
  background:
    linear-gradient(
      180deg,
      rgba(37, 40, 52, 0.96),
      rgba(24, 27, 36, 0.98)
    );
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 18px 40px rgba(5, 7, 12, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.modal-audio-shell-glow {
  position: absolute;
  inset: auto -8% -34% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(255, 173, 202, 0.18),
    transparent 66%
  );
  filter: blur(12px);
  pointer-events: none;
}

.modal-audio-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 228, 236, 0.78);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modal-audio-meta {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-audio-meta.is-compact {
  gap: 0;
}

.modal-audio-title {
  color: rgba(255, 247, 249, 0.98);
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.modal-audio-subtitle {
  color: rgba(233, 220, 228, 0.72);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: balance;
}

.modal-audio-timeline {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.modal-audio-time {
  min-width: 42px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 234, 240, 0.7);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modal-audio-progress-wrap {
  width: 100%;
}

.modal-audio-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.modal-audio-progress-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 210, 222, 0.98),
    rgba(241, 147, 183, 0.98) 54%,
    rgba(255, 214, 160, 0.96)
  );
  transform-origin: left center;
  transform: scaleX(0);
  box-shadow: 0 0 18px rgba(241, 147, 183, 0.36);
}

.modal-audio-progress-input {
  position: absolute;
  inset: -10px 0;
  width: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.modal-audio-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.modal-audio-seek,
.modal-audio-play {
  position: relative;
  border: none;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    filter 0.24s ease,
    background 0.24s ease;
}

.modal-audio-seek {
  width: 58px;
  height: 58px;
  flex-direction: column;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 241, 246, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(6, 9, 16, 0.24);
}

.modal-audio-seek:hover,
.modal-audio-play:hover {
  transform: translateY(-1px) scale(1.02);
}

.modal-audio-seek:active,
.modal-audio-play:active {
  transform: scale(0.97);
}

.modal-audio-seek-icon {
  font-size: 17px;
  line-height: 1;
}

.modal-audio-seek-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-audio-play {
  width: 92px;
  height: 92px;
  background: linear-gradient(
    135deg,
    rgba(255, 228, 235, 0.98),
    rgba(242, 160, 191, 0.98) 56%,
    rgba(255, 205, 151, 0.98)
  );
  color: #fff;
  box-shadow:
    0 22px 52px rgba(247, 152, 185, 0.32),
    0 12px 22px rgba(255, 216, 171, 0.18);
}

.modal-audio-play-glow {
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: radial-gradient(
    circle at 40% 30%,
    rgba(255, 255, 255, 0.88),
    transparent 72%
  );
  opacity: 0.88;
}

.modal-audio-play.is-paused {
  filter: saturate(0.95) brightness(0.98);
}

.modal-audio-play-icon {
  position: relative;
  z-index: 1;
  font-size: 30px;
  line-height: 1;
  color: rgba(54, 33, 43, 0.92);
  transform: translateX(1px);
}

.modal-audio-play.is-paused .modal-audio-play-icon {
  transform: translateX(4px);
}

.modal-audio-visualizer {
  width: 100%;
  height: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  opacity: 0.84;
}

.modal-audio-bar {
  width: 4px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 244, 247, 0.72),
    rgba(255, 182, 206, 0.82) 52%,
    rgba(255, 213, 160, 0.68)
  );
  transform-origin: center bottom;
  transform: scaleY(0.14);
  opacity: 0.52;
}

.modal-audio-shell.is-playing .modal-audio-bar {
  animation: audioBarDance 980ms ease-in-out infinite alternate;
  animation-delay: calc(var(--bar-index, 0) * 48ms);
  opacity: 0.9;
}

.modal-audio-shell.is-playing .modal-audio-play {
  box-shadow:
    0 24px 56px rgba(247, 152, 185, 0.34),
    0 12px 24px rgba(255, 216, 171, 0.2),
    0 0 28px rgba(255, 227, 237, 0.18);
}

.modal-audio-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.modal-caption {
  margin-top: 14px;
  animation: contentReveal 560ms var(--ease-soft) both;
  animation-delay: 80ms;
}

.modal-caption h3 {
  margin: 0 0 6px;
  color: #6d4d5a;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.modal-caption p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-soft);
  white-space: pre-line;
}

@keyframes ambientFloat {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.06);
  }
}

@keyframes ambientLift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2%, -2%, 0) scale(1.04);
  }
}

@keyframes glowDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(16px, -12px, 0) scale(1.08);
  }
}

@keyframes introOverlayFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes storyOverlayFade {
  0% {
    opacity: 1;
  }
  42% {
    opacity: 0.84;
  }
  100% {
    opacity: 0;
  }
}

@keyframes accessCardFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.965);
    filter: blur(10px);
  }
}

@keyframes haloPulse {
  from {
    transform: scale(0.98);
    opacity: 0.7;
  }
  to {
    transform: scale(1.05);
    opacity: 0.92;
  }
}

@keyframes cardFloatIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroFrameReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.982);
  }
  62% {
    opacity: 1;
    transform: translateY(-2px) scale(1.003);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes modalBloom {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mediaReveal {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.015) translate3d(-0.4%, -0.4%, 0);
  }
  to {
    transform: scale(1.05) translate3d(1.2%, 1%, 0);
  }
}

@keyframes heroShineSweep {
  0% {
    opacity: 0;
    transform: translateX(-150%) skewX(-20deg);
  }
  18% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    transform: translateX(330%) skewX(-20deg);
  }
}

@keyframes photoAuraPulse {
  from {
    transform: scale(1);
    opacity: 0.82;
  }
  to {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes textSweepIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes introCharReveal {
  0% {
    opacity: 0;
    filter: blur(18px);
    transform: translateY(22px) scale(0.82) rotate(-4deg);
  }
  58% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-2px) scale(1.02) rotate(0deg);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes introOrbFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -18px, 0) scale(1.08);
  }
}

@keyframes audioBarDance {
  0% {
    transform: scaleY(0.16);
  }
  25% {
    transform: scaleY(calc(var(--bar-scale, 0.7) * 0.74));
  }
  55% {
    transform: scaleY(var(--bar-scale, 0.7));
  }
  100% {
    transform: scaleY(0.24);
  }
}

@keyframes photoShineSweep {
  0% {
    opacity: 0;
    transform: translateX(-140%) skewX(-18deg);
  }
  18% {
    opacity: 0.96;
  }
  100% {
    opacity: 0;
    transform: translateX(340%) skewX(-18deg);
  }
}

@keyframes birthdayMemoryOpen {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.95);
  }
  58% {
    opacity: 1;
    transform: translateY(-6px) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes petalCascade {
  0% {
    opacity: 0;
    transform: translate3d(0, -28px, 0) rotate(var(--particle-rotate))
      scale(0.78);
  }
  12% {
    opacity: 0.96;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--particle-drift), var(--particle-fall), 0)
      rotate(calc(var(--particle-rotate) + 180deg)) scale(1.03);
  }
}

@keyframes sparkleCascade {
  0% {
    opacity: 0;
    transform: translate3d(0, -18px, 0) scale(0.4);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(
        var(--particle-drift),
        calc(var(--particle-fall) * 0.82),
        0
      )
      scale(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-char,
  .intro-screen.is-text-visible .intro-char,
  .intro-orb,
  .intro-cta,
  .intro-screen.is-exiting .intro-content {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .app-shell.intro-active {
    padding: 0;
  }

  .app {
    max-width: var(--card-shell-mobile-width);
  }

  .app-shell {
    padding: 18px 12px 22px;
  }

  .bg-glow {
    filter: blur(48px);
    opacity: 0.44;
  }

  .bg-glow-1 {
    width: 220px;
    height: 220px;
    left: -68px;
  }

  .bg-glow-2 {
    width: 260px;
    height: 260px;
    right: -88px;
    bottom: 8%;
  }

  body::before {
    background-position:
      center center,
      20% 22%,
      78% 18%,
      52% 46%,
      center 24%;
    filter: blur(20px) saturate(0.88) brightness(0.98);
    transform: scale(1.1);
  }

  .card {
    border-radius: 30px;
    min-height: var(--card-shell-mobile-min-height);
  }

  .card-screen {
    width: min(100%, var(--card-shell-mobile-width), calc(86dvh * 9 / 16));
    height: min(var(--card-shell-mobile-min-height), 86dvh);
    max-height: 86dvh;
  }

  .card-photo-slot {
    padding: 14px 14px 0;
    z-index: 1;
  }

  .card-photo-frame {
    height: 100%;
    border-radius: 24px;
  }

  .card-photo-gallery-controls {
    padding: 0 10px;
  }

  .card-photo-gallery-btn {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .card-photo-gallery-dots {
    bottom: 12px;
    gap: 7px;
  }

  .card-photo-frame::after {
    inset: 8px;
    border-radius: 18px;
  }

  .card-photo-image {
    object-position: var(--card-photo-mobile-position);
  }

  .card-content {
    padding: 10px 14px 14px;
  }

  .card-footer {
    padding-top: 16px;
  }

  .nav-spacer,
  .nav-back {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .nav-logout {
    min-width: 64px;
    height: 32px;
    padding-inline: 12px;
  }

  .title {
    font-size: clamp(18px, 5vw, 24px);
  }

  .text {
    font-size: clamp(14px, 3.7vw, 16px);
    line-height: 1.45;
  }

  .btn,
  .access-input {
    border-radius: 16px;
    padding: 12px 14px;
  }

  .memory-card,
  .quiz-option,
  .final-place,
  .access-code {
    border-radius: 16px;
  }

  .final-place {
    font-size: 18px;
  }

  .intro-content {
    width: min(92vw, 440px);
    padding: 34px 18px;
    gap: 24px;
  }

  .intro-title {
    max-width: 10.5ch;
    font-size: clamp(30px, 9vw, 48px);
    line-height: 1.12;
  }

  .intro-orb-left {
    width: 220px;
    height: 220px;
    left: -72px;
    top: 10%;
  }

  .intro-orb-right {
    width: 250px;
    height: 250px;
    right: -82px;
    bottom: 10%;
  }

  .intro-cta {
    min-width: 156px;
    padding: 13px 18px;
    font-size: 14px;
  }

  .modal-audio-stage {
    padding: 6px 4px 10px;
  }

  .modal-card.is-audio-memory {
    padding: 14px;
  }

  .modal-card.is-audio-memory .modal-close {
    top: 10px;
    right: 10px;
    width: 46px;
    height: 46px;
  }

  .modal-audio-cover-frame {
    border-radius: 26px;
  }

  .modal-audio-cover-border {
    inset: 12px;
    border-radius: 20px;
  }

  .modal-audio-cover-label {
    top: 14px;
    left: 14px;
    padding: 6px 10px;
    font-size: 9px;
  }

  .modal-audio-shell {
    width: 100%;
    margin-top: 12px;
    padding: 16px 14px 14px;
    border-radius: 24px;
    gap: 12px;
  }

  .modal-audio-title {
    font-size: clamp(22px, 7vw, 28px);
  }

  .modal-audio-subtitle {
    font-size: 13px;
  }

  .modal-audio-play {
    width: 80px;
    height: 80px;
  }

  .modal-audio-play-icon {
    font-size: 26px;
  }

  .modal-audio-seek {
    width: 52px;
    height: 52px;
  }

  .modal-audio-seek-icon {
    font-size: 15px;
  }

  .modal-audio-timeline {
    gap: 9px;
  }

  .modal-audio-time {
    font-size: 12px;
    min-width: 38px;
  }

  .modal-audio-visualizer {
    height: 24px;
    gap: 3px;
  }

  .modal-audio-bar {
    width: 3px;
  }
}

@media (min-width: 640px) {
  .title {
    font-size: clamp(18px, 2.4vw, 26px);
  }

  .card-content {
    padding: 20px 30px 30px;
  }

  .card-photo-slot {
    padding: 20px 20px 0;
  }

  .actions.row {
    flex-direction: row;
  }

  .actions.row .btn {
    width: auto;
    flex: 1;
  }
}
