/* ============================================================
   Сайт-поздравление для Арины — основные стили
   ============================================================ */

:root {
  --pink-50:  #fff5f0;
  --pink-100: #ffe6f0;
  --pink-200: #ffd9c5;
  --pink-300: #f5a6b9;
  --pink-400: #e87a9a;
  --pink-500: #d45a7a;
  --pink-600: #c45a7a;
  --pink-700: #a13e5e;
  --bordo:    #5a2e3e;

  --portal-1: #8b5cf6;
  --portal-2: #3b82f6;
  --portal-3: #ec4899;

  --night-1:  #0a0a1a;
  --night-2:  #1a0a2a;
  --night-3:  #0d0d1a;

  --skin-1: #ffdba6;
  --skin-2: #f5c28e;
  --hair:   #3a2a1a;
  --eye:    #2d1b2d;
  --mouth:  #c45a7a;
  --shirt:  #6ba5c4;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--bordo);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body {
  background: linear-gradient(180deg, #ffe6f0 0%, #ffd9c5 100%);
  min-height: 100vh;
}
.serif { font-family: 'Caveat', cursive; }

/* ===========================================================
   ЗАСТАВКА — подарочная коробка
   =========================================================== */
.gift-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #ffd9c5 0%, #f5a6b9 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s ease;
}
.gift-overlay.fading { opacity: 0; pointer-events: none; }
.gift-overlay .tap-hint {
  position: absolute; bottom: 8vh; left: 0; right: 0;
  text-align: center;
  color: #5a2e3e;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}
.gift-wrap {
  position: relative;
  cursor: pointer;
  animation: gift-idle 3.4s ease-in-out infinite;
  user-select: none;
}
.gift-wrap.opening { animation: none; }
@keyframes gift-idle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
.gift-shadow {
  position: absolute;
  bottom: -28px; left: 50%;
  transform: translateX(-50%);
  width: 320px; height: 28px;
  background: radial-gradient(ellipse at center, rgba(90,46,62,0.35), rgba(90,46,62,0));
  filter: blur(2px);
}
.gift-base {
  width: 320px; height: 220px;
  background: linear-gradient(180deg, #d45a7a 0%, #b94363 100%);
  border-radius: 18px;
  position: relative;
  box-shadow:
    inset 0 -12px 24px rgba(90,20,35,0.35),
    inset 0 12px 18px rgba(255,255,255,0.18),
    0 24px 50px rgba(196, 90, 122, 0.45);
}
.gift-base::before {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 32px; transform: translateX(-50%);
  background: linear-gradient(180deg, #fff5f0, #ffe1d4);
  box-shadow: inset -4px 0 8px rgba(196,90,122,0.25), inset 4px 0 8px rgba(196,90,122,0.25);
}
.gift-lid {
  width: 360px; height: 80px;
  background: linear-gradient(180deg, #f08fae 0%, #e87a9a 60%, #d45a7a 100%);
  border-radius: 14px;
  position: absolute;
  left: 50%; top: -56px;
  transform: translateX(-50%);
  box-shadow:
    inset 0 -8px 16px rgba(90,20,35,0.3),
    inset 0 6px 12px rgba(255,255,255,0.35),
    0 16px 28px rgba(196,90,122,0.35);
  transition: transform 0.7s cubic-bezier(.4,0,.2,1), opacity 0.7s;
}
.gift-lid::before {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 32px; transform: translateX(-50%);
  background: linear-gradient(180deg, #fff5f0, #ffe1d4);
  box-shadow: inset -4px 0 8px rgba(196,90,122,0.25), inset 4px 0 8px rgba(196,90,122,0.25);
}
.gift-wrap.opening .gift-lid {
  transform: translate(-50%, -240px) rotate(-18deg);
  opacity: 0;
}
.bow {
  position: absolute;
  left: 50%; top: -110px;
  transform: translateX(-50%);
  width: 200px; height: 90px;
  pointer-events: none;
  transition: transform 0.5s, opacity 0.5s;
}
.gift-wrap.opening .bow { transform: translate(-50%, -60px) scale(0.6); opacity: 0; }
.bow svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(196,90,122,0.4)); }
.gift-label {
  position: absolute;
  left: 0; right: 0; top: 95px;
  text-align: center;
  color: #fff5f0;
  font-family: 'Caveat', cursive;
  font-size: 38px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(90,20,35,0.4);
  z-index: 2;
  pointer-events: none;
}
.sparkle-tw {
  position: absolute;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 12px 2px #fff, 0 0 24px 4px rgba(255,255,255,0.6);
  animation: sparkle-twinkle 2.4s ease-in-out infinite;
}
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50%      { opacity: 1; transform: scale(1); }
}

/* ===========================================================
   Основной сайт — общий каркас
   =========================================================== */
main { display: block; }
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  position: relative;
}
@supports (content-visibility: auto) {
  .screen {
    content-visibility: auto;
    contain-intrinsic-size: 100vh 900px;
  }
}
.screen-inner { max-width: 880px; width: 100%; text-align: center; }
.screen h1 {
  font-family: 'Caveat', cursive;
  font-size: clamp(40px, 8vw, 92px);
  color: var(--pink-700);
  margin: 0 0 14px;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(255,255,255,0.4);
}
.screen h2 {
  font-family: 'Caveat', cursive;
  font-size: clamp(34px, 6vw, 64px);
  color: var(--pink-700);
  margin: 0 0 20px;
  line-height: 1.05;
}
.screen p.lead {
  font-size: clamp(16px, 1.8vw, 22px);
  color: var(--bordo);
  opacity: 0.85;
  margin: 0 auto 32px;
  max-width: 620px;
  line-height: 1.55;
  text-wrap: pretty;
}
.kicker {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.7);
  color: var(--pink-700);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 24px;
}
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.fade-up.in { opacity: 1; transform: none; }

/* music toggle */
.music-btn {
  position: fixed; top: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(196,90,122,0.3);
  color: var(--pink-700);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 50;
  font-size: 18px;
  transition: transform 0.2s, background 0.2s;
}
.music-btn:hover { transform: scale(1.06); background: rgba(255,255,255,0.9); }

/* ===========================================================
   Экран 2 — суперсилы
   =========================================================== */
.powers {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 28px;
}
.power-btn {
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}
.power-btn:hover { background: var(--pink-400); color: white; transform: translateY(-2px); }
.power-btn.active {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: white;
  box-shadow: 0 8px 24px rgba(196,90,122,0.4);
}
.power-message {
  font-family: 'Caveat', cursive;
  font-size: clamp(24px, 3.4vw, 36px);
  color: var(--pink-700);
  margin: 8px auto 28px;
  min-height: 44px;
  text-wrap: pretty;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.photo-card {
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffd1de 0%, #f5a6b9 100%);
  position: relative;
  box-shadow: 0 10px 30px rgba(196,90,122,0.25);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}
.photo-card:hover { transform: scale(1.04); box-shadow: 0 14px 40px rgba(196,90,122,0.4); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.3) 0 12px,
      rgba(255,255,255,0.1) 12px 24px);
  color: var(--pink-700);
  font-family: 'Inter', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}

/* ===========================================================
   Экран 3 — письмо
   =========================================================== */
.letter-wrap {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  perspective: 1200px;
}
.letter {
  position: relative;
  width: 100%;
  min-height: 320px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fff8f0 0%, #fff1ea 100%);
  box-shadow: 0 18px 50px rgba(196,90,122,0.3);
  padding: 36px 32px;
  cursor: pointer;
  transition: transform 0.45s ease, box-shadow 0.45s ease;
  overflow: hidden;
  border: 1px solid rgba(196,90,122,0.2);
}
.letter:hover { transform: translateY(-3px); box-shadow: 0 24px 60px rgba(196,90,122,0.4); }
.letter.opened { cursor: default; }
.letter-closed-content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  min-height: 240px;
  font-family: 'Caveat', cursive;
  font-size: 32px;
  color: var(--pink-700);
}
.letter-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg, #f08fae, #e87a9a);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 0.7s cubic-bezier(.4,0,.2,1), opacity 0.5s;
  transform-origin: top center;
  pointer-events: none;
  box-shadow: inset 0 -2px 4px rgba(90,20,35,0.2);
}
.letter.opened .letter-flap {
  transform: rotateX(-180deg);
  opacity: 0;
}
.letter-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--bordo);
  white-space: pre-line;
  text-wrap: pretty;
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s 0.4s ease, transform 0.7s 0.4s ease;
}
.letter.opened .letter-text { opacity: 1; transform: none; }

/* ===========================================================
   Экран 4 — открытки
   =========================================================== */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}
.flip-card {
  aspect-ratio: 3 / 4;
  perspective: 1200px;
  cursor: pointer;
}
.flip-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform 0.7s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 22px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 14px 40px rgba(196,90,122,0.3);
}
.flip-front {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: white;
  font-family: 'Caveat', cursive;
  font-size: 64px;
}
.flip-back {
  background: linear-gradient(160deg, #fff5f0 0%, #ffe6f0 100%);
  color: var(--bordo);
  transform: rotateY(180deg);
  font-family: 'Caveat', cursive;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.3;
  border: 2px solid rgba(196,90,122,0.25);
  text-wrap: pretty;
}

/* ===========================================================
   Экран 5 — настроение
   =========================================================== */
.mood-row {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin-bottom: 28px;
}
.mood-btn {
  padding: 14px 26px;
  border-radius: 14px;
  border: none;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  color: white;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 20px rgba(196,90,122,0.3);
}
.mood-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(196,90,122,0.45); }
.mood-btn.b1 { background: linear-gradient(135deg, #f48fb1, #e87a9a); }
.mood-btn.b2 { background: linear-gradient(135deg, #ce93d8, #ba68c8); }
.mood-btn.b3 { background: linear-gradient(135deg, #ff8a80, #ff5252); }
.mood-message {
  font-family: 'Caveat', cursive;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--pink-700);
  min-height: 60px;
  text-wrap: pretty;
}

/* ===========================================================
   Экран 6 — финал
   =========================================================== */
.hug-btn {
  padding: 16px 36px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: white;
  font-size: 18px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(196,90,122,0.4);
  transition: transform 0.25s;
}
.hug-btn:hover { transform: translateY(-3px) scale(1.03); }
.final-msg {
  font-family: 'Caveat', cursive;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--pink-700);
  margin-top: 28px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
  text-wrap: pretty;
}
.final-msg.in { opacity: 1; transform: none; }

/* ===========================================================
   Экран 7 — портал
   =========================================================== */
.portal-screen {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(236, 72, 153, 0.16), transparent 60%),
    linear-gradient(180deg, #ffe6f0 0%, #ffd9c5 100%);
}
.portal-wrap { position: relative; width: 360px; height: 360px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.portal-wrap.is-lite {
  width: 240px;
  height: 240px;
}
.portal {
  width: 250px; height: 250px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0%, #f5d0ff 8%, #a78bfa 22%, #6b21a5 45%, #1e1145 75%, #06031a 100%);
  position: relative;
  box-shadow:
    0 0 60px 8px rgba(139, 92, 246, 0.55),
    0 0 120px 24px rgba(236, 72, 153, 0.35),
    inset 0 0 60px rgba(0,0,0,0.45);
  animation: portal-pulse 3.2s ease-in-out infinite;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.portal.is-lite {
  width: 168px;
  height: 168px;
  box-shadow:
    0 0 18px 3px rgba(139, 92, 246, 0.24),
    0 0 32px 8px rgba(236, 72, 153, 0.14),
    inset 0 0 22px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.portal.is-lite::before {
  display: none;
}
.portal.is-lite::after {
  inset: 30%;
  filter: none;
  animation: none;
  opacity: 0.85;
}
.portal.activating { transform: scale(1.6); }
.portal.is-lite.activating { transform: scale(1.08); }
@keyframes portal-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.portal::before {
  content: '';
  position: absolute; inset: 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,0.0) 60deg, rgba(255,255,255,0.5) 120deg, transparent 180deg, rgba(236,72,153,0.4) 240deg, transparent 300deg, transparent 360deg);
  animation: portal-spin 6s linear infinite;
  mix-blend-mode: screen;
  border-radius: 50%;
}
.portal::after {
  content: '';
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,200,255,0.6) 30%, rgba(167,139,250,0.4) 60%, transparent 100%);
  filter: blur(4px);
  animation: portal-core 2.6s ease-in-out infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }
@keyframes portal-core {
  0%, 100% { opacity: 0.7; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
.orbit {
  position: absolute; inset: 0;
  animation: orbit-spin 14s linear infinite;
  pointer-events: none;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.orbit-star {
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: white;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px #ffd1ff);
  animation: star-twinkle 2s ease-in-out infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ===========================================================
   СЕКРЕТНАЯ КОМНАТА
   =========================================================== */
.secret-room {
  position: fixed; inset: 0;
  z-index: 8000;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.25), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.18), transparent 60%),
    linear-gradient(180deg, #0a0a1a 0%, #1a0a2a 50%, #0d0d1a 100%);
  color: #ffe0f0;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.secret-room.open { opacity: 1; pointer-events: auto; }
.secret-stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.secret-star {
  position: absolute;
  width: 2px; height: 2px;
  background: white; border-radius: 50%;
  opacity: 0.7;
  animation: secret-twinkle 3s ease-in-out infinite;
}
@keyframes secret-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
.secret-close {
  position: fixed; top: 18px; right: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,224,240,0.3);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  color: #ffe0f0;
  font-size: 20px;
  cursor: pointer;
  z-index: 8100;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.secret-close:hover { background: rgba(255,255,255,0.18); transform: scale(1.05) rotate(90deg); }

.secret-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  position: relative;
  z-index: 1;
}
.secret-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,224,240,0.18);
  border-radius: 24px;
  padding: 36px 32px;
  margin-bottom: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.secret-card h2 {
  font-family: 'Caveat', cursive;
  font-size: clamp(36px, 6vw, 56px);
  margin: 0 0 18px;
  color: #ffd1f0;
}
.secret-card p {
  font-size: 16px;
  line-height: 1.75;
  color: #ffe0f0;
  text-wrap: pretty;
  margin: 0 0 14px;
}
.secret-question {
  text-align: center;
}
.secret-question h2 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 28px;
}
.secret-actions {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  position: relative;
  min-height: 80px;
}
.btn-yes, .btn-no {
  padding: 16px 38px;
  border-radius: 999px;
  border: none;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-yes {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  box-shadow: 0 12px 30px rgba(236,72,153,0.45);
}
.btn-yes:hover { transform: translateY(-3px) scale(1.05); }
.btn-no {
  position: absolute;
  background: rgba(102,102,102,0.6);
  color: rgba(255,255,255,0.85);
  transition: transform 0.18s ease, left 0.18s ease, top 0.18s ease;
}
.celebration {
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: clamp(36px, 6vw, 64px);
  color: #ffd1f0;
  margin-top: 24px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s, transform 0.7s;
}
.celebration.in { opacity: 1; transform: none; }

/* ===========================================================
   СЕРДЕЧНОЕ ПИСЬМО — секция "Письмо тебе"
   =========================================================== */
.heart-screen {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(245,166,185,0.3), transparent 60%);
}
.heart-screen .screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.heart-photo {
  width: min(360px, 100%);
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 24px 50px -10px rgba(196, 90, 122, 0.45),
    0 0 0 8px rgba(255,255,255,0.7),
    0 0 0 9px rgba(196, 90, 122, 0.2);
  transform: rotate(-1.5deg);
  transition: transform 0.4s ease;
}
.heart-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.heart-photo:hover { transform: rotate(0deg) scale(1.02); }
.heart-photo-top    { transform: rotate(-2deg); margin-top: 8px; }
.heart-photo-bottom { transform: rotate(2deg);  margin-bottom: 8px; }

.heart-letter-body {
  max-width: 580px;
  background: linear-gradient(180deg, #fffaf3 0%, #fff1ea 100%);
  border: 1px solid rgba(196,90,122,0.22);
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow:
    0 20px 50px rgba(196, 90, 122, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.6);
  text-align: left;
  position: relative;
}
.heart-letter-body::before,
.heart-letter-body::after {
  content: '';
  position: absolute;
  width: 26px; height: 26px;
  background:
    radial-gradient(circle at center, #ec4899 0%, #be185d 60%, transparent 70%);
  border-radius: 50%;
  top: -10px;
  filter: drop-shadow(0 4px 6px rgba(196,90,122,0.4));
  opacity: 0.9;
}
.heart-letter-body::before { left: 24px; transform: rotate(-12deg); }
.heart-letter-body::after  { right: 24px; transform: rotate(12deg);  }
.heart-letter-body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--bordo);
  margin: 0 0 14px;
  text-wrap: pretty;
}
.heart-letter-body p:last-child { margin-bottom: 0; }
.heart-final {
  font-family: 'Caveat', cursive;
  font-size: 28px !important;
  line-height: 1.2 !important;
  color: var(--pink-700) !important;
  text-align: center;
  margin-top: 22px !important;
}

/* ===========================================================
   ЛИЧНЫЕ ПИСЬМА — мобильно-первый аккордеон
   Список карточек на всю ширину, раскрываются inline.
   =========================================================== */
.letters-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 540px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.letter-row {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 32px -10px rgba(196, 90, 122, 0.35);
  transition:
    box-shadow 0.24s ease,
    transform 0.24s cubic-bezier(.2,.7,.2,1);
  background: linear-gradient(160deg, #fda4af 0%, #e87a9a 100%); /* fallback */
}
.letter-row::before {
  /* лёгкая бумажная текстура */
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.18) 1px, transparent 0);
  background-size: 12px 12px;
  opacity: 0.45;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.letter-row.is-open {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px -10px rgba(196, 90, 122, 0.55);
}

/* Цветные конверты */
.letter-row.envelope-pink  { background: linear-gradient(135deg, #ffb7c5 0%, #e87a9a 100%); }
.letter-row.envelope-rose  { background: linear-gradient(135deg, #f9a8d4 0%, #db2777 100%); }
.letter-row.envelope-lilac { background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 100%); }
.letter-row.envelope-peach { background: linear-gradient(135deg, #ffd0a8 0%, #fb7185 100%); }

.letter-row-trigger {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr 28px;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  min-height: 88px; /* большая тап-зона */
  transition: background 0.2s ease;
}
.letter-row-trigger:hover { background: rgba(255,255,255,0.06); }
.letter-row-trigger:active { background: rgba(255,255,255,0.12); }

/* «Марка» слева */
.letter-row-stamp {
  width: 56px;
  height: 64px;
  background: rgba(255,255,255,0.16);
  border: 1px dashed rgba(255,255,255,0.6);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform: rotate(-4deg);
  flex-shrink: 0;
  backdrop-filter: blur(2px);
}
.letter-row-stamp-no {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,255,255,0.95);
}
.letter-row-stamp-icon {
  font-size: 22px;
  line-height: 1;
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.letter-row.is-open .letter-row-stamp { transform: rotate(0deg) scale(0.95); }

/* Заголовок и анонс */
.letter-row-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.letter-row-title {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.letter-row-short {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255,255,255,0.88);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Стрелка раскрытия */
.letter-row-arrow {
  font-size: 32px;
  line-height: 1;
  color: rgba(255,255,255,0.85);
  transition: transform 0.28s cubic-bezier(.4,1.2,.6,1);
  text-align: center;
  font-weight: 300;
}
.letter-row.is-open .letter-row-arrow {
  transform: rotate(90deg);
}

/* Тело письма — раскрывается через max-height */
.letter-row-content {
  position: relative;
  z-index: 1;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.28s cubic-bezier(.25,.7,.2,1),
    opacity 0.16s ease;
}
.letter-row.is-open .letter-row-content {
  opacity: 1;
}
.letter-row-content-inner {
  background: linear-gradient(180deg, #fffaf3 0%, #fff1ea 100%);
  margin: 0 12px 12px;
  border-radius: 14px;
  padding: 22px;
  color: var(--bordo);
  font-size: 15.5px;
  line-height: 1.7;
  overflow: hidden;
  contain: layout paint;
}

/* Фото внутри раскрытого письма */
.letter-row-photo {
  margin: -22px -22px 18px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.letter-row-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.28s ease;
}
.letter-row.is-open .letter-row-photo img { transform: none; }
.letter-row-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(255,250,243,0.4) 100%);
  pointer-events: none;
}
.letter-row-content-inner p {
  margin: 0 0 12px;
  text-wrap: pretty;
}
.letter-row-content-inner p:last-child { margin-bottom: 0; }

/* Тач-фокус для доступности */
.letter-row-trigger:focus-visible {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: -4px;
  border-radius: 18px;
}

/* ===========================================================
   ФОТО ПОД СЕКЦИЯМИ — «section-photo»
   =========================================================== */
.section-photo {
  width: min(420px, 100%);
  aspect-ratio: 16 / 11;
  margin: 36px auto 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 22px 50px -8px rgba(196, 90, 122, 0.4),
    0 0 0 6px rgba(255,255,255,0.7);
  transform: rotate(-1deg);
  transition: transform 0.4s ease;
}
.section-photo:hover { transform: rotate(0deg) scale(1.02); }
.section-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===========================================================
   СЕКРЕТНОЕ ПИСЬМО В ПОРТАЛЕ — letter_5
   =========================================================== */
.secret-letter-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(167,139,250,0.10));
}
.secret-letter-body p {
  font-size: 16px;
  line-height: 1.85;
  color: #ffe0f0;
  margin: 0 0 14px;
  text-wrap: pretty;
}
.secret-letter-final {
  font-family: 'Caveat', cursive;
  font-size: 24px !important;
  line-height: 1.4 !important;
  color: #ffd1f0 !important;
  text-align: center;
  margin-top: 22px !important;
  padding-top: 22px;
  border-top: 1px dashed rgba(255,224,240,0.3);
}
.secret-letter-final em { color: #f9a8d4; font-style: italic; }

/* ===========================================================
   ЭЛЕКТРОННЫЙ СЕРТИФИКАТ (в секретной комнате)
   =========================================================== */
.cert-host {
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(236,72,153,0.10));
  border: 1px solid rgba(255,224,240,0.22);
}
.cert-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 700;
  color: #ffd1f0;
  opacity: 0.9;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.cert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ec4899;
  box-shadow: 0 0 12px #ec4899;
  animation: cert-pulse 1.8s ease-in-out infinite;
}
@keyframes cert-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

.cert-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.6 / 1;
  max-width: 560px;
  margin: 0 auto;
  perspective: 1400px;
  -webkit-perspective: 1400px;
  cursor: pointer;
  isolation: isolate;
}
.cert-card-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.cert-card.flipped .cert-card-inner { transform: rotateY(180deg); }
.cert-face {
  position: absolute; inset: 0;
  border-radius: 22px;
  padding: 26px 28px;
  display: flex; flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.12) inset;
  color: #fff;
  font-family: 'Inter', sans-serif;
  text-align: left;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ----- ЛИЦЕВАЯ СТОРОНА ----- */
.cert-front {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(255,255,255,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(236,72,153,0.45) 0%, transparent 60%),
    linear-gradient(135deg, #f0abfc 0%, #ec4899 35%, #a855f7 75%, #4c1d95 100%);
}
.cert-shine {
  position: absolute;
  inset: -50% -10% auto auto;
  width: 60%;
  height: 200%;
  background: linear-gradient(115deg,
    transparent 35%,
    rgba(255,255,255,0.18) 45%,
    rgba(255,255,255,0.45) 50%,
    rgba(255,255,255,0.18) 55%,
    transparent 65%);
  transform: rotate(15deg);
  pointer-events: none;
  animation: cert-shine-roll 5s ease-in-out infinite;
}
@keyframes cert-shine-roll {
  0%, 100% { transform: translateX(0) rotate(15deg); }
  50%      { transform: translateX(-30%) rotate(15deg); }
}
.cert-grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
  background-size: 4px 4px;
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.cert-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 2;
}
.cert-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.cert-brand-mark {
  font-size: 18px;
  color: #fde68a;
  filter: drop-shadow(0 0 6px #fbbf24);
}
.cert-chip {
  width: 44px; height: 34px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 50%, #b45309 100%);
  padding: 4px;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
}
.cert-chip-grid {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.cert-chip-grid span {
  background: rgba(0,0,0,0.25);
  border-radius: 1px;
}

.cert-amount {
  position: relative; z-index: 2;
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Caveat', cursive;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0,0,0,0.35);
  line-height: 1;
}
.cert-currency { font-size: clamp(28px, 4vw, 40px); opacity: 0.95; }
.cert-amount-value {
  font-size: clamp(54px, 8vw, 84px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cert-amount-sub {
  position: relative; z-index: 2;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}
.cert-bottom {
  position: relative; z-index: 2;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.cert-label {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
  font-weight: 600;
}
.cert-value {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cert-name {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0;
}
.cert-tap-hint {
  position: absolute;
  bottom: 10px;
  right: 26px;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  z-index: 2;
}

/* ----- ОБОРОТНАЯ СТОРОНА ----- */
.cert-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(140deg, #1e1b4b 0%, #4c1d95 50%, #831843 100%);
  padding-top: 0;
}
.cert-magstripe {
  height: 42px;
  margin: 20px -28px 18px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.cert-back-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.cert-code-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px dashed rgba(255,224,240,0.4);
  border-radius: 10px;
  padding: 10px 12px;
}
.cert-code {
  flex: 1;
  font-family: 'Inter', ui-monospace, monospace;
  font-size: clamp(13px, 2vw, 17px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #ffd1f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cert-copy {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 14px rgba(236,72,153,0.4);
}
.cert-copy:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(236,72,153,0.5); }
.cert-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.cert-signature {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 4px;
  align-items: flex-end;
}
.cert-sig-line {
  width: 140px;
  height: 1px;
  background: rgba(255,224,240,0.5);
}
.cert-signature span {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: #ffd1f0;
}

.cert-note {
  font-size: 13px;
  color: rgba(255,224,240,0.75);
  margin-top: 18px;
  text-align: center;
  line-height: 1.5;
}

/* Мобильно для сертификата */
@media (max-width: 520px) {
  .cert-card {
    perspective: none;
    -webkit-perspective: none;
    aspect-ratio: 1.32 / 1;
  }
  .cert-card-inner {
    transform: none !important;
    -webkit-transform: none !important;
    transform-style: flat;
    -webkit-transform-style: flat;
    will-change: auto;
  }
  .cert-face { padding: 16px 16px 18px; border-radius: 18px; }
  .cert-front,
  .cert-back {
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .cert-front {
    z-index: 2;
    opacity: 1;
    visibility: visible;
  }
  .cert-back {
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none !important;
    -webkit-transform: none !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }
  .cert-card.flipped .cert-front {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .cert-card.flipped .cert-back {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .cert-chip { width: 38px; height: 28px; }
  .cert-magstripe { margin: 10px -16px 10px; height: 28px; }
  .cert-bottom { flex-direction: row; gap: 8px; }
  .cert-back-body {
    gap: 8px;
  }
  .cert-label {
    font-size: 8px;
    letter-spacing: 0.24em;
    margin-bottom: 3px;
  }
  .cert-code-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 10px;
  }
  .cert-code {
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-align: center;
    white-space: normal;
    word-break: break-word;
  }
  .cert-copy {
    width: 100%;
    padding: 9px 12px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-align: center;
  }
  .cert-meta-row {
    margin-top: auto;
    align-items: flex-end;
    gap: 10px;
  }
  .cert-value { font-size: 12px; }
  .cert-signature { display: none; }
  .cert-note {
    margin-top: 14px;
    font-size: 12px;
    max-width: 30ch;
  }
  .cert-tap-hint { display: none; }
  .cert-name { font-size: 22px; }
.cert-amount-value { font-size: clamp(46px, 14vw, 64px); }
}

@media (pointer: coarse), (max-width: 600px) {
  html.mobile-scrolling .music-btn,
  html.mobile-scrolling .secret-close,
  html.mobile-scrolling .guide-root {
    opacity: 0.58;
  }

  html.mobile-scrolling .music-btn,
  html.mobile-scrolling .secret-close {
    transform: scale(0.94);
    box-shadow: none;
  }

  html.mobile-scrolling .guide-bubble {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }

  html.mobile-scrolling .guide-root.is-lite .guide-body,
  html.mobile-scrolling .guide-root.is-lite .guide-icon {
    transform: scale(0.96);
  }

  html.mobile-scrolling .guide-root.is-lite .guide-photo-wrap {
    box-shadow:
      0 0 0 1px rgba(196,90,122,0.14),
      0 3px 8px rgba(196,90,122,0.12);
  }

  html.mobile-scrolling .guide-root.is-lite .guide-body::before {
    opacity: 0.45;
    filter: blur(7px);
  }

  .fade-up,
  .fade-up.in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fade-up {
    transform: none;
    transition-duration: 0s;
  }

  .screen-inner {
    contain: layout paint style;
  }

  .heart-screen,
  .portal-screen {
    background: linear-gradient(180deg, #ffe6f0 0%, #ffd9c5 100%);
  }

  .heart-photo,
  .heart-photo-top,
  .heart-photo-bottom {
    transform: none;
    box-shadow:
      0 12px 24px -16px rgba(196, 90, 122, 0.28),
      0 0 0 4px rgba(255,255,255,0.72);
  }

  .heart-photo:hover {
    transform: none;
  }

  .heart-photo img {
    transform: none;
  }

  .heart-letter-body {
    box-shadow:
      0 12px 24px -18px rgba(196, 90, 122, 0.18),
      inset 0 0 0 1px rgba(255,255,255,0.56);
  }

  .heart-letter-body::before,
  .heart-letter-body::after,
  .letter-row::before {
    display: none;
  }

  .letter-row {
    box-shadow: 0 10px 24px -12px rgba(196, 90, 122, 0.28);
  }

  .letter-row::before {
    opacity: 0.2;
    mix-blend-mode: normal;
  }

  .letter-row.is-open {
    transform: none;
    box-shadow: 0 14px 30px -14px rgba(196, 90, 122, 0.34);
  }

  .letter-row-stamp {
    backdrop-filter: none;
  }

  .letter-row-content {
    transition:
      max-height 0.22s cubic-bezier(.25,.72,.25,1),
      opacity 0.12s ease;
  }

  .letter-row-photo img,
  .letter-row-arrow,
  .flip-inner,
  .mood-btn,
  .hug-btn,
  .section-photo,
  .heart-photo {
    transition-duration: 0.2s;
  }

  .letter-row-title {
    text-shadow: none;
  }

  .letter-row-stamp-icon {
    filter: none;
  }

  .kicker,
  .music-btn,
  .secret-close,
  .secret-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .guide-body,
  .guide-icon,
  .wish-star,
  .cert-dot,
  .cert-shine,
  .portal,
  .portal::before,
  .portal::after,
  .orbit,
  .orbit-star {
    animation: none !important;
  }

  .guide-body,
  .wish-star svg,
  .orbit-star,
  .cert-brand-mark {
    filter: none !important;
  }

  .flip-face {
    box-shadow: 0 8px 18px -10px rgba(196,90,122,0.26);
  }

  .mood-btn {
    box-shadow: 0 6px 14px rgba(196,90,122,0.2);
  }

  .hug-btn {
    box-shadow: 0 8px 18px rgba(196,90,122,0.22);
  }

  .guide-body {
    box-shadow: none;
  }

  .section-photo,
  .photo-card {
    transform: none;
    transition: none;
    box-shadow:
      0 12px 22px -16px rgba(196,90,122,0.25),
      0 0 0 4px rgba(255,255,255,0.7);
  }

  .section-photo:hover,
  .photo-card:hover {
    transform: none;
  }

  .section-photo:hover {
    box-shadow:
      0 12px 22px -16px rgba(196,90,122,0.25),
      0 0 0 4px rgba(255,255,255,0.7);
  }

  .photo-card:hover {
    box-shadow: 0 10px 20px rgba(196,90,122,0.18);
  }

  .portal {
    box-shadow:
      0 0 24px 4px rgba(139, 92, 246, 0.35),
      0 0 48px 12px rgba(236, 72, 153, 0.2),
      inset 0 0 32px rgba(0,0,0,0.35);
  }
}

/* ===========================================================
   2D-ГИД
   =========================================================== */
.guide-root {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 7000;
  user-select: none;
  pointer-events: none;
  contain: layout paint;
}
.guide-body, .guide-icon, .guide-bubble { pointer-events: auto; }
.guide-body {
  width: 140px; height: 140px;
  position: relative;
  cursor: pointer;
  animation: guide-bounce 2.4s ease-in-out infinite;
  filter: none;
}
.guide-body::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(196,90,122,0.28) 0%,
    rgba(196,90,122,0.2) 34%,
    rgba(90,46,62,0.1) 58%,
    rgba(90,46,62,0) 78%);
  transform: translateY(14px) scale(0.94);
  filter: blur(14px);
  z-index: 0;
  pointer-events: none;
}

/* ФОТО-АВАТАР */
.guide-photo-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ffd1de, #e87a9a);
  border: 4px solid white;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(196,90,122,0.25),
    0 12px 26px rgba(196,90,122,0.32),
    inset 0 -6px 12px rgba(90,20,35,0.15);
  z-index: 1;
}
.guide-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -12px 18px rgba(90,20,35,0.08);
  pointer-events: none;
  z-index: 2;
}
.guide-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 50%;
  transform: scale(1.08);
  transition: transform 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}
.guide-body:hover .guide-photo { transform: scale(1.12); }
.guide-photo.is-flat { filter: brightness(0.94) saturate(0.85); }
/* «Моргание» — лёгкое затемнение век (фото не поменяешь, но фидбек остался) */
.guide-blink {
  position: absolute;
  left: 0; right: 0;
  top: 32%;
  height: 16%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transform: scaleY(0.1);
  transform-origin: center;
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
}
.guide-blink.closed { opacity: 1; transform: scaleY(1); }
@keyframes guide-bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.guide-close {
  position: absolute;
  top: 2px; right: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.98);
  border: 1.5px solid rgba(196,90,122,0.5);
  color: var(--pink-700);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.2s, background 0.2s;
  line-height: 1;
  padding: 0;
}
.guide-close:hover { transform: scale(1.12); }
.guide-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd1de, #e87a9a);
  border: 2px solid white;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(196,90,122,0.4);
  animation: guide-bounce 2.4s ease-in-out infinite;
}
.guide-root.is-lite {
  bottom: 12px;
  right: 12px;
}
.guide-root.is-lite .guide-body {
  width: 88px;
  height: 88px;
  cursor: default;
}
.guide-root.is-lite .guide-photo-wrap {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.96);
  box-shadow: 0 0 0 1px rgba(196,90,122,0.14);
}
.guide-root.is-lite .guide-body::before {
  display: none;
}
.guide-root.is-lite .guide-photo-wrap::after {
  display: none;
}
.guide-root.is-lite .guide-photo {
  object-position: center 26%;
  transform: none;
  transition: none;
  border-radius: 50%;
  clip-path: circle(49.5% at 50% 50%);
}
.guide-root.is-lite .guide-bubble {
  bottom: 98px;
  width: min(220px, calc(100vw - 28px));
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  animation: none;
  box-shadow:
    0 8px 18px rgba(90,46,62,0.18),
    0 0 0 1px rgba(255,255,255,0.55) inset;
}
.guide-root.is-lite .guide-bubble::after {
  right: 16px;
  border-left-width: 8px;
  border-right-width: 8px;
  border-top-width: 10px;
  filter: none;
}
.guide-root.is-lite .guide-close {
  top: 1px;
  right: 1px;
  width: 24px;
  height: 24px;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.guide-root.is-lite .guide-icon {
  width: 46px;
  height: 46px;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(196,90,122,0.24);
}
.guide-bubble {
  position: absolute;
  bottom: 150px;     /* подняли под большой аватар (140px) */
  right: 0;
  width: min(280px, calc(100vw - 36px));
  padding: 14px 18px;
  background: white;
  border-radius: 20px;
  border-bottom-right-radius: 6px;
  color: var(--bordo);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  box-shadow:
    0 16px 36px rgba(90,46,62,0.28),
    0 0 0 1px rgba(255,255,255,0.6) inset;
  text-wrap: pretty;
  animation: bubble-in 0.35s ease;
}
.guide-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 22px;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid white;
  filter: drop-shadow(0 4px 4px rgba(90,46,62,0.12));
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

/* ===========================================================
   Капсула желаний (бонус)
   =========================================================== */
.wish-star {
  position: fixed;
  top: 78px; right: 18px;
  width: 36px; height: 36px;
  cursor: pointer;
  z-index: 50;
  animation: star-twinkle 2.4s ease-in-out infinite;
}
.wish-star svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px #ffd1ff); }
.wish-bubble {
  position: fixed;
  top: 122px; right: 18px;
  max-width: 240px;
  padding: 12px 16px;
  background: white;
  border-radius: 14px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--pink-700);
  box-shadow: 0 12px 30px rgba(90,46,62,0.25);
  z-index: 50;
  animation: bubble-in 0.35s ease;
}

/* ===========================================================
   Счётчик дней
   =========================================================== */
.day-counter {
  margin-top: 28px;
  font-family: 'Caveat', cursive;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--pink-700);
  opacity: 0.85;
}

/* ===========================================================
   Мини-галерея с swipe
   =========================================================== */
.gallery {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px 24px 22px;
  margin: 0 -24px;
  scrollbar-width: thin;
}
.gallery::-webkit-scrollbar { height: 6px; }
.gallery::-webkit-scrollbar-thumb { background: rgba(196,90,122,0.3); border-radius: 3px; }
.gallery-card {
  flex: 0 0 220px;
  aspect-ratio: 1;
  border-radius: 18px;
  scroll-snap-align: center;
  background: linear-gradient(135deg, #ffd1de, #f5a6b9);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(196,90,122,0.3);
}
.gallery-card .photo-placeholder { font-size: 11px; }

/* Большие карточки в портале — совместные фото */
.shared-gallery { padding: 18px 24px 28px; }
.shared-card {
  flex: 0 0 280px;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  background: linear-gradient(160deg, #f5a6b9 0%, #c084fc 50%, #8b5cf6 100%);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.35);
  border: 2px solid rgba(255,255,255,0.45);
}
.shared-card .photo-placeholder {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.22) 0 14px,
      rgba(255,255,255,0.06) 14px 28px);
  color: white;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.secret-gallery { margin: 0 -8px; padding: 8px 16px 18px; }
.secret-card-photo {
  flex: 0 0 240px;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(167,139,250,0.4), rgba(236,72,153,0.35));
  border: 1px solid rgba(255,224,240,0.25);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.secret-card-photo .photo-placeholder {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.18) 0 12px,
      rgba(255,255,255,0.04) 12px 24px);
  color: #ffe0f0;
  font-size: 12px;
}
@media (max-width: 600px) {
  .shared-card { flex: 0 0 220px; }
}

/* ===========================================================
   Адаптив
   =========================================================== */

/* Планшет и ниже */
@media (max-width: 900px) {
  .screen { padding: 70px 20px; min-height: auto; }
  .screen-inner { gap: 0; }
  .secret-content { padding: 60px 18px 100px; }
  .secret-card { padding: 28px 22px; border-radius: 20px; margin-bottom: 22px; }
}

/* Смартфон */
@media (max-width: 600px) {
  .screen { padding: 56px 16px; min-height: 90vh; }
  .screen h1 { line-height: 1.0; }
  .screen h2 { line-height: 1.0; margin-bottom: 14px; }
  .screen p.lead { margin-bottom: 22px; font-size: 16px; }
  .kicker { font-size: 11px; padding: 5px 12px; margin-bottom: 18px; }

  /* Heart letter секция */
  .heart-screen .screen-inner { gap: 22px; }
  .heart-photo { width: min(280px, 86%); aspect-ratio: 4 / 5; }
  .heart-letter-body { padding: 26px 22px; }
  .heart-letter-body p { font-size: 15.5px; line-height: 1.7; }
  .heart-final { font-size: 24px !important; }

  /* Конверты-письма */
  .letters-list { gap: 12px; max-width: 100%; }
  .letter-row-trigger {
    grid-template-columns: 48px 1fr 24px;
    gap: 12px;
    padding: 14px 16px;
    min-height: 84px;
  }
  .letter-row-stamp { width: 48px; height: 56px; }
  .letter-row-stamp-icon { font-size: 20px; }
  .letter-row-stamp-no { font-size: 8px; }
  .letter-row-title { font-size: 24px; }
  .letter-row-short { font-size: 12.5px; }
  .letter-row-arrow { font-size: 28px; }
  .letter-row-content-inner { margin: 0 10px 10px; padding: 18px; font-size: 15px; }
  .letter-row-photo { margin: -18px -18px 14px; aspect-ratio: 3 / 2; }

  /* Фото под секциями */
  .section-photo { width: min(320px, 92%); aspect-ratio: 4 / 3; margin-top: 26px; }

  /* Коробка и бант */
  .gift-base { width: 240px; height: 170px; }
  .gift-lid { width: 280px; height: 64px; top: -44px; }
  .gift-label { font-size: 32px; top: 70px; }
  .bow { width: 160px; height: 72px; top: -90px; }
  .gift-overlay .tap-hint { font-size: 11px; bottom: 6vh; }

  /* Портал */
  .portal-wrap { width: 240px; height: 240px; }
  .portal { width: 170px; height: 170px; }
  .orbit-star { width: 9px; height: 9px; }
  .orbit span { transform-origin: 0 0 !important; }

  /* Гид — на мобильном аватар 100пх */
  .guide-root { bottom: 12px; right: 12px; }
  .guide-body { width: 100px; height: 100px; }
  .guide-icon { width: 52px; height: 52px; font-size: 24px; }
  .guide-bubble {
    bottom: 110px;
    width: min(240px, calc(100vw - 32px));
    padding: 12px 16px;
    font-size: 14px;
  }
  .guide-bubble::after { bottom: -8px; right: 18px; border-top-width: 10px; border-left-width: 8px; border-right-width: 8px; }
  .guide-close { width: 26px; height: 26px; font-size: 12px; top: 1px; right: 1px; }

  /* Кнопки и элементы */
  .music-btn { width: 42px; height: 42px; top: 14px; right: 14px; }
  .wish-star { top: 68px; right: 14px; width: 32px; height: 32px; }
  .wish-bubble { top: 108px; right: 14px; font-size: 19px; max-width: calc(100vw - 28px); }
  .secret-close { top: 14px; right: 14px; width: 42px; height: 42px; }

  /* Суперсилы */
  .powers { gap: 8px; margin-bottom: 22px; }
  .power-btn { padding: 10px 16px; font-size: 14px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Письмо */
  .letter { padding: 28px 22px; min-height: 280px; }
  .letter-closed-content { font-size: 26px; min-height: 200px; }
  .letter-text { font-size: 16px; line-height: 1.6; }

  /* Открытки */
  .cards-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .flip-front { font-size: 48px; }
  .flip-back { font-size: 17px; padding: 14px; }

  /* Настроение */
  .mood-btn { padding: 12px 18px; font-size: 14px; }

  /* Объятия */
  .hug-btn { padding: 14px 28px; font-size: 16px; }
}

/* Совсем узкие экраны */
@media (max-width: 380px) {
  .screen { padding: 50px 14px; }
  .cards-row { grid-template-columns: 1fr; }
  .gift-base { width: 200px; height: 144px; }
  .gift-lid { width: 236px; height: 56px; top: -38px; }
  .gift-label { font-size: 26px; top: 56px; }
  .bow { width: 132px; height: 60px; top: -78px; }
  .portal-wrap { width: 200px; height: 200px; }
  .portal { width: 140px; height: 140px; }
  .photo-grid { grid-template-columns: 1fr; }
}

/* Ориентация */
@media (orientation: landscape) and (max-height: 500px) {
  .screen { min-height: auto; padding: 40px 24px; }
  .gift-base { width: 220px; height: 150px; }
  .gift-lid { width: 260px; height: 58px; top: -42px; }
  .bow { width: 150px; height: 68px; top: -86px; }
  .portal-wrap { width: 220px; height: 220px; }
  .portal { width: 160px; height: 160px; }
}

/* Безопасные отступы iPhone */
@supports (padding: max(0px)) {
  .guide-root {
    bottom: max(12px, env(safe-area-inset-bottom));
    right:  max(12px, env(safe-area-inset-right));
  }
  .music-btn {
    top:   max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }
  .wish-star {
    top:   calc(max(14px, env(safe-area-inset-top)) + 54px);
    right: max(14px, env(safe-area-inset-right));
  }
  .secret-close {
    top:   max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }
}
