/* ═══════════════════════════════════════════════════════════════
   Секретное письмо — эксклюзивный стиль
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg-void: #3d3832;
  --bg-deep: #4a443c;
  --bg-warm: #524b43;
  --gold: #b8954a;
  --gold-light: #dfc88a;
  --gold-dim: rgba(184, 149, 74, 0.45);
  --burgundy: #8b3a4f;
  --paper: #d0c4b0;
  --paper-light: #d8cdb9;
  --paper-deep: #c5b9a5;
  --paper-shadow: #b5a894;
  --ink: #332e28;
  --ink-muted: #5e564c;
  --cream: #f8f4ec;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', Times, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-soft: 0 12px 40px rgba(42, 38, 34, 0.14);
  --shadow-card: 0 16px 48px rgba(42, 38, 34, 0.18);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-serif);
  background: var(--bg-void);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Фон ── */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(223, 200, 138, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(184, 149, 74, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 45% at 10% 80%, rgba(139, 58, 79, 0.08) 0%, transparent 45%),
    linear-gradient(175deg, #5c554c 0%, var(--bg-void) 45%, #35302b 100%);
}

.bg-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(42, 38, 34, 0.25) 100%);
  pointer-events: none;
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 1px;
  height: 1px;
  background: var(--gold-light);
  border-radius: 50%;
  animation: twinkle var(--duration, 4s) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: var(--opacity, 0.5); }
}

.hearts-container { display: none; }

/* ── Контейнер ── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ── Карточка входа ── */
.gate-card {
  width: 100%;
  text-align: center;
  padding: 3rem 2.5rem;
  border: 1px solid rgba(184, 149, 74, 0.35);
  background: linear-gradient(165deg, var(--paper-light) 0%, var(--paper-deep) 100%);
  color: var(--ink);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeInUp 1s ease-out;
  position: relative;
}

.gate-card::before,
.gate-card::after {
  content: '— ✦ —';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  opacity: 0.55;
}

.gate-card::before { top: 1.25rem; }
.gate-card::after { bottom: 1.25rem; }

/* ── Личная страница ── */
.personal-page .container.personal-container {
  padding: 2rem 1.25rem 2.5rem;
  min-height: 100vh;
  min-height: 100dvh;
  justify-content: center;
}

.personal-letter {
  width: 100%;
  max-width: 560px;
  text-align: left;
  padding: 2.5rem 2rem 2.25rem;
  animation: letterUnfold 1s ease-out;
}

.personal-greeting {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.personal-divider {
  width: 52px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(201, 169, 98, 0.15));
  margin-bottom: 1.75rem;
  border-radius: 1px;
}

.personal-body {
  margin-bottom: 0;
}

.personal-body .personal-text {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--ink-muted);
  font-style: normal;
  font-weight: 400;
  margin-bottom: 1.45rem;
  text-align: left;
  letter-spacing: 0.01em;
  animation: fadeInUp 0.75s ease-out backwards;
}

.personal-body .personal-text:nth-child(1) { animation-delay: 0.1s; }
.personal-body .personal-text:nth-child(2) { animation-delay: 0.22s; }
.personal-body .personal-text:nth-child(3) { animation-delay: 0.34s; }
.personal-body .personal-text:nth-child(4) { animation-delay: 0.46s; }

.personal-body .personal-text:last-child {
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  padding-top: 0.35rem;
}

.personal-actions {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(201, 169, 98, 0.22);
  text-align: center;
}

.personal-continue {
  width: 100%;
  max-width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.72rem;
}

.personal-continue:hover {
  background: rgba(201, 169, 98, 0.15);
}

/* ── Письмо (пергамент) ── */
.letter-card {
  width: 100%;
  background: linear-gradient(168deg, var(--paper-light) 0%, var(--paper) 50%, var(--paper-deep) 100%);
  color: var(--ink);
  padding: 3rem 2.5rem;
  box-shadow:
    0 1px 0 var(--paper-shadow),
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(184, 149, 74, 0.2);
  animation: letterUnfold 1s ease-out;
  position: relative;
}

.letter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.letter-card::after {
  content: attr(data-chapter);
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--font-sans);
}

@keyframes letterUnfold {
  from { opacity: 0; transform: translateY(20px) rotateX(4deg); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* ── Типографика ── */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.gate-card h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--ink);
  font-style: italic;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.letter-card h2 {
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  color: var(--ink);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  font-weight: 400;
  margin-bottom: 2rem;
}

.gate-card .subtitle { color: var(--gold); opacity: 0.85; }
.letter-card .subtitle { color: var(--gold); }

.text-body {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.9;
  font-style: italic;
}

.text-body .text-paragraph {
  margin-bottom: 1.15rem;
}

.text-body .text-paragraph:last-child {
  margin-bottom: 0;
}

.gate-divider {
  width: 40px;
  height: 1px;
  background: var(--gold-dim);
  margin: 1.5rem auto;
}

.gate-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3.6vw, 1.14rem);
  line-height: 1.55;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  max-width: 19rem;
  margin: 0 auto 1.85rem;
  padding: 0 0.75rem;
  text-align: center;
  text-wrap: balance;
}

.gate-hint-line {
  display: block;
}

.gate-hint-line:last-child {
  color: var(--ink);
  opacity: 0.78;
}

/* ── Конверт / печать ── */
.envelope-icon {
  width: 72px;
  height: 52px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.envelope-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(184, 149, 74, 0.4);
  background: rgba(184, 149, 74, 0.06);
}

.envelope-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  border-left: 36px solid transparent;
  border-right: 36px solid transparent;
  border-top: 28px solid rgba(184, 149, 74, 0.18);
}

.wax-seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  background:
    radial-gradient(circle at 38% 32%, #d4956a 0%, #8b2942 45%, #4a1225 100%);
  box-shadow:
    0 6px 24px rgba(107, 28, 46, 0.45),
    inset 0 2px 6px rgba(255,200,150,0.25),
    inset 0 -3px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: rgba(255, 220, 170, 0.7);
  user-select: none;
  position: relative;
}

.wax-seal:hover { transform: scale(1.06); box-shadow: 0 8px 32px rgba(107,28,46,0.6); }
.wax-seal.clicked { animation: sealBreak 0.9s ease-out forwards; }

@keyframes sealBreak {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.2); }
  100% { transform: scale(0.6); opacity: 0; }
}

.gate-label {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  font-family: var(--font-sans);
  margin-bottom: 0.5rem;
}

/* ── Форма ── */
.date-inputs {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0 1.5rem;
  flex-wrap: wrap;
}

.date-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.date-field label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0.75;
  font-family: var(--font-sans);
}

.date-field input,
.date-field select {
  width: 76px;
  padding: 0.75rem 0.4rem;
  border: 1px solid rgba(184, 149, 74, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.date-field select { width: 128px; cursor: pointer; }

.date-field input:focus,
.date-field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,98,0.1);
}

.date-field select option {
  background: var(--paper);
  color: var(--ink);
}

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--gold);
}

.btn-primary:hover {
  background: rgba(184, 149, 74, 0.12);
  box-shadow: 0 0 24px rgba(184, 149, 74, 0.18);
}

.gate-card .btn-primary,
.letter-card .btn-primary {
  color: var(--ink);
  border-color: var(--gold);
}

.gate-card .btn-primary:hover,
.letter-card .btn-primary:hover {
  background: rgba(184, 149, 74, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid rgba(184, 149, 74, 0.35);
  font-size: 0.65rem;
}

.btn-ghost:hover { color: var(--ink); border-color: var(--gold); }

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

/* ── Сообщения ── */
.message {
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
  font-family: var(--font-serif);
}

.message.show { opacity: 1; transform: none; }
.message.error { color: #c97878; }
.message.success { color: var(--gold); }

/* ── Навигация ── */
.page-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(62, 56, 50, 0.88);
  border-top: 1px solid rgba(184, 149, 74, 0.35);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 100;
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 32px rgba(42, 38, 34, 0.08);
}

.page-nav .nav-prev { justify-self: start; }
.page-nav .nav-next { justify-self: end; }

.nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.progress-dots { display: flex; gap: 0.6rem; }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(201,169,98,0.2);
  transition: var(--transition);
}

.dot.active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201,169,98,0.5);
}

.dot.done { background: rgba(201,169,98,0.5); }

.page-counter {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  font-family: var(--font-sans);
}

/* ── Воспоминания ── */
.memory-grid { display: grid; gap: 0; margin: 2rem 0; }

.memory-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(201,169,98,0.2);
  animation: fadeInUp 0.7s ease-out backwards;
}

.memory-card:last-child { border-bottom: none; }
.memory-card:nth-child(1) { animation-delay: 0.15s; }
.memory-card:nth-child(2) { animation-delay: 0.3s; }
.memory-card:nth-child(3) { animation-delay: 0.45s; }
.memory-card:nth-child(4) { animation-delay: 0.6s; }

.memory-num {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-family: var(--font-sans);
  margin-bottom: 0.5rem;
}

.memory-card h3 {
  font-size: 1.15rem;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.memory-card p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.8;
}

/* ── Пожелания ── */
.wish-list { list-style: none; margin: 1.5rem 0; }

.wish-item {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(201,169,98,0.15);
  animation: fadeInUp 0.6s ease-out backwards;
}

.wish-item:nth-child(1) { animation-delay: 0.1s; }
.wish-item:nth-child(2) { animation-delay: 0.2s; }
.wish-item:nth-child(3) { animation-delay: 0.3s; }
.wish-item:nth-child(4) { animation-delay: 0.4s; }
.wish-item:nth-child(5) { animation-delay: 0.5s; }
.wish-item:nth-child(6) { animation-delay: 0.6s; }

.wish-num {
  font-size: 0.75rem;
  color: var(--gold);
  font-family: var(--font-sans);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.wish-item p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.75;
}

.personal-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201,169,98,0.25);
  text-align: center;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.8;
}

.personal-note::before {
  content: '—';
  display: block;
  color: var(--gold);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5em;
}

.signature {
  margin-top: 1.5rem;
  text-align: right;
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ── Секретное послание ── */
.secret-message {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.secret-message.revealed {
  max-height: 400px;
  opacity: 1;
  margin-top: 1rem;
}

.secret-message p {
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.9;
  font-style: italic;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(201,169,98,0.3);
}

/* ── Загрузка ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(175deg, #5c554c 0%, var(--bg-void) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-spinner {
  width: 32px; height: 32px;
  border: 1px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.page-with-nav .container { padding-bottom: 5.5rem; }

/* ── Эмоции ── */
:root {
  --emotion-accent: #c9a962;
  --emotion-glow: rgba(201, 169, 98, 0.2);
}

.emotion-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.emotion-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleDrift var(--float-duration, 6s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes particleDrift {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 0.5; }
  80% { opacity: 0.2; }
  50% { transform: translateY(-30px) scale(1); }
}

.emotion-scene {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.emotion-heart {
  width: 76px;
  height: 68px;
  margin-bottom: -34px;
  z-index: 2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: heartBeat 2.6s ease-in-out infinite;
}

.emotion-heart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: heartFloat 5s ease-in-out infinite;
}

.emotion-heart-body {
  transition: fill 0.6s ease;
}

.emotion-word {
  display: none;
}

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

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.09); }
  16% { transform: scale(1); }
  28% { transform: scale(1.05); }
  36% { transform: scale(1); }
}

@keyframes heartPulseFire {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.1); }
  16% { transform: scale(1); }
  28% { transform: scale(1.06); }
  36% { transform: scale(1); }
}

.emotion-scene .letter-card {
  position: relative;
  z-index: 1;
  padding-top: 3rem;
  border-top: 3px solid var(--emotion-accent);
}

.emotion-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--emotion-accent);
  border: 1px solid var(--emotion-glow);
  padding: 0.35rem 0.9rem;
  margin-bottom: 0.75rem;
}

.emotion-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 6vw, 2.6rem);
  font-style: italic;
  font-weight: 400;
  color: var(--emotion-accent);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.emotion-heading--blur {
  filter: blur(10px);
  opacity: 0.35;
  user-select: none;
  transition: filter 0.9s ease, opacity 0.9s ease, text-shadow 0.9s ease;
}

.emotion-scene.revealed .emotion-heading--blur,
.emotion-heading--blur.revealed {
  filter: blur(0);
  opacity: 1;
}

.emotion-quote {
  font-size: 1.15rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(184, 149, 74, 0.18);
}

.emotion-scene .letter-card h2 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: 0.75rem;
}

.dot.active {
  background: var(--emotion-accent, var(--gold));
  box-shadow: 0 0 8px var(--emotion-glow);
}

.page-nav .btn-primary:hover {
  border-color: var(--emotion-accent, var(--gold));
}

/* ── 18+ размытая эмоция ── */
.emotion-word.blurred-reveal {
  filter: blur(14px);
  opacity: 0.35;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  z-index: 3;
  transition: filter 0.8s ease, opacity 0.8s ease;
}

.emotion-word.blurred-reveal.revealed {
  filter: blur(0);
  opacity: 0.07;
  cursor: default;
  pointer-events: none;
}

.emotion-tag.age-gate {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  padding: 0.4rem 1rem;
  background: rgba(139, 41, 66, 0.15);
  border-color: rgba(139, 41, 66, 0.4);
  color: #c97888;
}

.emotion-tag.revealed-tag {
  background: rgba(139, 41, 66, 0.08);
  border-color: rgba(139, 41, 66, 0.3);
  color: #8b2942;
}

.blur-hint {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(139, 41, 66, 0.55);
  text-align: center;
  margin: -0.5rem 0 1rem;
  animation: hintPulse 2s ease-in-out infinite;
  cursor: pointer;
}

.emotion-tag.age-gate {
  cursor: pointer;
}

.reveal-btn.hidden {
  display: none;
}

.blur-hint.hidden {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.letter-content.content-locked .emotion-quote,
.letter-content.content-locked .text-body {
  filter: blur(6px);
  opacity: 0.35;
  pointer-events: none;
  transition: filter 0.8s ease 0.2s, opacity 0.8s ease 0.2s;
}

.letter-content:not(.content-locked) .emotion-quote,
.letter-content:not(.content-locked) .text-body {
  filter: blur(0);
  opacity: 1;
}

/* ── Меню эмоций ── */
.menu-page { overflow-x: hidden; }

.menu-container {
  max-width: 720px;
  padding: 2rem 1.25rem 3rem;
  justify-content: flex-start;
}

.menu-header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.9s ease-out;
}

.menu-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}

.menu-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-style: italic;
  color: var(--cream);
  font-weight: 400;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(42, 38, 34, 0.2);
}

.menu-greeting {
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.menu-greeting span {
  font-style: italic;
  font-size: 1.2rem;
}

.menu-subtitle {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(248, 244, 236, 0.72);
  margin-bottom: 0.75rem;
}

.menu-intro {
  max-width: 420px;
  margin: 0 auto;
}

.menu-intro-text {
  font-size: 0.95rem;
  color: rgba(248, 244, 236, 0.88);
  font-style: italic;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.menu-intro-text:last-child {
  margin-bottom: 0;
}

.menu-intro-cta {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.65;
  color: var(--gold-light);
  margin-top: 1.65rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(184, 149, 74, 0.28);
  text-wrap: balance;
}

.menu-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 1.75rem auto 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
}

.menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.15rem 1.15rem;
  text-decoration: none;
  color: var(--cream);
  background: linear-gradient(152deg, #4f4a44 0%, #423d38 100%);
  border: 1px solid rgba(184, 149, 74, 0.22);
  border-left: 3px solid var(--card-accent, var(--gold));
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.45s ease,
              border-color 0.45s ease;
  animation: fadeInUp 0.7s ease-out backwards;
  box-shadow: var(--shadow-soft);
}

.menu-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow:
    var(--shadow-card),
    0 0 32px color-mix(in srgb, var(--card-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--card-accent) 45%, transparent);
}

.menu-card-glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--card-accent, var(--gold));
  opacity: 0.08;
  filter: blur(25px);
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.menu-card:hover .menu-card-glow { opacity: 0.2; }

.menu-card-chapter {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--card-accent, var(--gold));
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.menu-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.menu-card-title--blur {
  filter: blur(6px);
  user-select: none;
  letter-spacing: 0.2em;
}

.menu-card-desc {
  font-size: 0.75rem;
  color: rgba(248, 244, 236, 0.58);
  font-style: italic;
  line-height: 1.5;
  flex-grow: 1;
}

.menu-card-arrow {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.9rem;
  color: var(--card-accent, var(--gold));
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.menu-card:hover .menu-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.menu-card-dot {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-accent, var(--gold));
  box-shadow: 0 0 8px var(--card-accent, var(--gold));
}

.menu-card--visited {
  border-left-width: 3px;
}

.menu-card--secret {
  border-left-color: #8b2942;
}

.menu-card--secret .menu-card-title {
  color: #c97888;
}

/* ── Огоньки · 18+ секция ── */
.fire-embers,
.menu-card-embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.fire-embers {
  position: fixed;
  z-index: -1;
}

.fire-ember {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
  animation: emberRise var(--rise-duration, 4s) ease-out infinite;
  animation-delay: var(--rise-delay, 0s);
  opacity: 0;
}

@keyframes emberRise {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.4);
  }
  15% { opacity: 0.9; }
  100% {
    opacity: 0;
    transform: translateY(var(--rise-height, -120px)) translateX(var(--drift, 0px)) scale(0.1);
  }
}

.fire-ember--hot {
  box-shadow: 0 0 10px #ff4500, 0 0 20px rgba(255, 0, 0, 0.4);
}

.fire-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 60% at 50% 110%, rgba(255, 60, 0, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(255, 0, 60, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 80% 70%, rgba(255, 100, 0, 0.08) 0%, transparent 50%);
  animation: fireGlowPulse 4s ease-in-out infinite;
}

@keyframes fireGlowPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.secret-page .bg-gradient {
  background:
    radial-gradient(ellipse 100% 70% at 50% 100%, rgba(255, 120, 80, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(180, 60, 80, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 50%, rgba(255, 140, 60, 0.08) 0%, transparent 50%),
    linear-gradient(175deg, #5a3040 0%, #3d2430 50%, #452838 100%) !important;
}

.emotion-heart--fire {
  width: 84px;
  height: 74px;
  margin-bottom: -37px;
  animation: heartPulseFire 2s ease-in-out infinite;
}

.emotion-heart--fire .emotion-heart-svg {
  animation: heartFloat 4.5s ease-in-out infinite;
}

.letter-card--secret {
  background: linear-gradient(165deg, #5c2838 0%, #452030 50%, #4a2435 100%) !important;
  color: #fce8ec;
  border: 1px solid rgba(255, 120, 90, 0.35) !important;
  border-top: 3px solid #e86a45 !important;
  box-shadow:
    0 0 0 1px rgba(255, 100, 70, 0.15),
    0 12px 48px rgba(90, 40, 55, 0.35),
    0 0 60px rgba(255, 80, 50, 0.12),
    inset 0 0 60px rgba(255, 80, 50, 0.04);
  animation: secretCardGlow 2s ease-in-out infinite;
}

.secret-page .emotion-heading {
  color: #ff5533;
  text-shadow: 0 0 30px rgba(255, 60, 30, 0.5);
}

.emotion-scene.revealed .emotion-heading,
.secret-page .emotion-heading:not(.emotion-heading--blur) {
  animation: headingFlame 3s ease-in-out infinite;
}

@keyframes headingFlame {
  0%, 100% { text-shadow: 0 0 20px rgba(255,80,30,0.4), 0 0 40px rgba(255,0,50,0.2); }
  50% { text-shadow: 0 0 35px rgba(255,100,40,0.7), 0 0 60px rgba(255,0,60,0.35); }
}

.secret-page .emotion-quote {
  color: #ffb8c0;
  border-bottom-color: rgba(255, 80, 60, 0.25);
  font-size: 1.2rem;
}

.secret-page .text-body {
  color: #e8a0a8;
}

.secret-page .emotion-tag.revealed-tag {
  background: rgba(255, 40, 0, 0.15);
  border-color: rgba(255, 80, 40, 0.5);
  color: #ff8060;
  box-shadow: 0 0 15px rgba(255, 60, 0, 0.3);
}

.reveal-btn {
  display: block;
  width: 100%;
  margin: 0 0 1.25rem;
  background: linear-gradient(135deg, rgba(180, 20, 40, 0.4), rgba(255, 60, 0, 0.25));
  border-color: rgba(255, 80, 40, 0.6) !important;
  color: #ffb090 !important;
  letter-spacing: 0.15em;
  animation: revealBtnPulse 2s ease-in-out infinite;
}

@keyframes revealBtnPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 60, 0, 0.2); }
  50% { box-shadow: 0 0 30px rgba(255, 80, 0, 0.45); }
}

.reveal-btn:hover {
  background: linear-gradient(135deg, rgba(200, 30, 50, 0.55), rgba(255, 80, 0, 0.4));
  box-shadow: 0 0 40px rgba(255, 60, 0, 0.5) !important;
}

.page-nav--fire {
  border-top-color: rgba(255, 100, 70, 0.3);
  background: rgba(74, 36, 48, 0.94);
}

@keyframes secretCardGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255,60,0,0.15), 0 0 40px rgba(255,40,0,0.15), 0 0 80px rgba(139,0,40,0.1), inset 0 0 60px rgba(255,30,0,0.04);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255,80,0,0.35), 0 0 70px rgba(255,60,0,0.3), 0 0 120px rgba(180,0,40,0.2), inset 0 0 80px rgba(255,40,0,0.08);
  }
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(-5deg); opacity: 0.85; }
  25% { transform: scale(1.1) rotate(5deg); opacity: 1; }
  50% { transform: scale(0.95) rotate(-3deg); opacity: 0.9; }
  75% { transform: scale(1.05) rotate(3deg); opacity: 1; }
}

.menu-card--fire {
  grid-column: 1 / -1;
  text-align: center;
  border: 1px solid rgba(220, 70, 90, 0.38) !important;
  border-left: none !important;
  background:
    radial-gradient(ellipse 90% 70% at 50% 115%, rgba(255, 70, 50, 0.22) 0%, transparent 58%),
    linear-gradient(168deg, #3a1522 0%, #2a0e18 52%, #34121f 100%) !important;
  color: #fce4e8;
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
  animation: passionGlow 4.5s ease-in-out infinite;
}

.menu-card--fire::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 90, 70, 0.06) 0%, transparent 38%, rgba(180, 30, 50, 0.1) 100%);
  pointer-events: none;
}

.menu-card--fire .menu-card-embers {
  opacity: 0.55;
}

.menu-card--fire .menu-card-glow {
  background: #ff5040;
  opacity: 0.28;
  bottom: -45%;
  top: auto;
  right: 50%;
  transform: translateX(50%);
  width: 160px;
  height: 110px;
  filter: blur(38px);
}

.menu-card--fire .menu-card-chapter {
  color: rgba(255, 160, 150, 0.55);
  position: relative;
  z-index: 1;
}

.menu-card-age-icon {
  display: block;
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1;
  margin: 0.15rem auto 0;
  filter: drop-shadow(0 0 18px rgba(255, 90, 60, 0.4));
  transition: transform 0.45s ease, filter 0.45s ease;
}

.menu-card--fire:hover .menu-card-age-icon {
  transform: scale(1.06);
  filter: drop-shadow(0 0 26px rgba(255, 100, 70, 0.55));
}

.menu-card--fire:hover {
  border-color: rgba(255, 100, 80, 0.55) !important;
  box-shadow:
    0 0 48px rgba(200, 40, 60, 0.28),
    0 16px 40px rgba(20, 8, 12, 0.45) !important;
  transform: translateY(-4px) scale(1.008);
}

@keyframes passionGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 80, 60, 0.08),
      0 12px 36px rgba(20, 8, 12, 0.35),
      inset 0 -30px 50px rgba(255, 60, 40, 0.06);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 100, 70, 0.18),
      0 0 42px rgba(200, 40, 60, 0.22),
      0 16px 40px rgba(20, 8, 12, 0.4),
      inset 0 -30px 50px rgba(255, 70, 50, 0.1);
  }
}

.menu-card--fire .menu-card-title {
  display: none;
}

.letter-card--finale .text-body .text-paragraph:last-child {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(184, 149, 74, 0.22);
  text-align: center;
  color: var(--ink);
  font-size: 1.2rem;
  font-style: italic;
}

.menu-card--finale {
  grid-column: 1 / -1;
  text-align: center;
  border-left: none;
  border-top: 2px solid var(--gold);
  padding: 1.75rem;
  background: linear-gradient(165deg, #504c46 0%, #43403a 100%);
}

.menu-card--finale .menu-card-title {
  font-size: 1.35rem;
}

.menu-card--finale .menu-card-arrow {
  position: static;
  opacity: 0.5;
  transform: none;
  margin-top: 0.5rem;
  display: block;
}

.menu-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  font-family: var(--font-sans);
}

.nav-emotion-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-light);
  text-align: center;
}

/* ── Кнопка «В меню» ── */
.page-nav .nav-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.2rem 0.55rem 0.55rem;
  background: linear-gradient(135deg, rgba(184, 149, 74, 0.18) 0%, rgba(184, 149, 74, 0.06) 100%);
  border: 1px solid rgba(184, 149, 74, 0.42);
  border-radius: 100px;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  justify-self: start;
  position: relative;
  overflow: hidden;
  transition:
    color 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease,
    transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: var(--shadow-soft);
}

.page-nav .nav-menu::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.page-nav .nav-menu:hover {
  color: var(--cream);
  border-color: rgba(184, 149, 74, 0.65);
  box-shadow:
    0 0 0 1px rgba(184, 149, 74, 0.12),
    0 0 24px rgba(184, 149, 74, 0.16),
    var(--shadow-soft);
  transform: translateY(-1px);
}

.page-nav .nav-menu:hover::after {
  transform: translateX(120%);
}

.page-nav .nav-menu:active {
  transform: translateY(0);
}

.nav-menu-arrow {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(184, 149, 74, 0.12);
  border: 1px solid rgba(184, 149, 74, 0.4);
  font-size: 0.9rem;
  line-height: 1;
  color: var(--gold);
  transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.page-nav .nav-menu:hover .nav-menu-arrow {
  transform: translateX(-3px);
  background: rgba(184, 149, 74, 0.2);
  border-color: rgba(184, 149, 74, 0.55);
}

.nav-menu-label {
  padding-right: 0.15rem;
  white-space: nowrap;
}

.page-nav--fire .nav-menu {
  background: linear-gradient(135deg, rgba(255, 60, 30, 0.12) 0%, rgba(139, 0, 40, 0.06) 100%);
  border-color: rgba(255, 80, 40, 0.4);
  color: #ffd4cc;
  box-shadow:
    0 0 0 1px rgba(255, 60, 0, 0.08),
    0 4px 18px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(255, 40, 0, 0.08);
}

.page-nav--fire .nav-menu:hover {
  border-color: rgba(255, 100, 50, 0.65);
  color: #fff0ec;
  box-shadow:
    0 0 0 1px rgba(255, 80, 0, 0.2),
    0 0 32px rgba(255, 60, 0, 0.22),
    0 6px 24px rgba(0, 0, 0, 0.5);
}

.page-nav--fire .nav-menu::after {
  background: linear-gradient(105deg, transparent 35%, rgba(255, 140, 100, 0.14) 50%, transparent 65%);
}

.page-nav--fire .nav-menu-arrow {
  background: rgba(255, 60, 30, 0.15);
  border-color: rgba(255, 80, 40, 0.45);
  color: #ff8060;
}

.page-nav--fire .nav-menu:hover .nav-menu-arrow {
  background: rgba(255, 60, 30, 0.28);
  border-color: rgba(255, 100, 50, 0.65);
}

@media (max-width: 380px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .menu-card--finale,
  .menu-card--fire {
    grid-column: 1;
  }

  .gate-hint {
    font-size: 0.97rem;
    max-width: 14.5rem;
    line-height: 1.58;
  }
}

@media (min-width: 600px) {
  .menu-grid {
    gap: 1.25rem;
  }
  .menu-card {
    padding: 1.5rem 1.35rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.75rem 1.1rem;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .page-with-nav .container {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }

  .gate-card, .letter-card {
    padding: 2rem 1.25rem;
  }

  .gate-card h1 {
    font-size: clamp(1.45rem, 6.2vw, 1.9rem);
    margin-bottom: 0.65rem;
  }

  .gate-divider {
    margin: 1.15rem auto;
  }

  .gate-hint {
    font-size: clamp(1.02rem, 4.2vw, 1.1rem);
    line-height: 1.62;
    max-width: min(17.5rem, 90vw);
    margin-bottom: 1.6rem;
    gap: 0.3rem;
    padding: 0 0.35rem;
  }

  .date-inputs {
    gap: 0.75rem;
    margin-top: 0.25rem;
  }

  .personal-letter {
    padding: 2rem 1.35rem 1.85rem;
  }

  .personal-body .personal-text {
    font-size: 1.1rem;
    line-height: 1.85;
    margin-bottom: 1.3rem;
  }

  .personal-greeting {
    font-size: 1.45rem;
  }

  .emotion-scene .letter-card {
    padding-top: 2.75rem;
  }

  .emotion-heart {
    width: 68px;
    height: 60px;
    margin-bottom: -30px;
  }

  .emotion-heart--fire {
    width: 74px;
    height: 66px;
    margin-bottom: -33px;
  }

  .emotion-heading {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 0.85rem;
  }

  .emotion-scene .letter-card h2.emotion-heading {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .emotion-quote {
    font-size: 1.12rem;
    line-height: 1.65;
  }

  .text-body {
    font-size: 1.12rem;
    line-height: 1.85;
  }

  .emotion-tag {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    padding: 0.4rem 0.85rem;
  }

  .menu-title {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .menu-intro {
    font-size: 1.05rem;
  }

  .menu-intro-cta {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    margin-top: 1.45rem;
    padding-top: 1.2rem;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
  }

  .menu-card-title {
    font-size: 1.2rem;
  }

  .menu-card-desc {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .menu-label,
  .menu-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
  }

  .nav-emotion-name {
    font-size: 0.9rem;
  }

  .secret-page .emotion-quote {
    font-size: 1.1rem;
  }

  .secret-page .text-body {
    font-size: 1.1rem;
    line-height: 1.85;
  }

  .page-nav {
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .page-nav .nav-menu {
    font-size: 0.92rem;
    padding: 0.5rem 1rem 0.5rem 0.45rem;
    gap: 0.5rem;
  }

  .nav-menu-arrow {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
  }
}
