* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(160deg, #ffe4ec 0%, #ffd3e0 40%, #ffc2d4 100%);
  overflow-x: hidden;
  position: relative;
}

#hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.falling-heart {
  position: absolute;
  top: -40px;
  font-size: 22px;
  opacity: 0.7;
  animation: fall linear forwards;
  user-select: none;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 420px;
  width: 100%;
  background: #fff;
  isolation: isolate;
  border-radius: 32px;
  padding: 36px 28px 32px;
  box-shadow: 0 18px 50px rgba(214, 51, 108, 0.16);
  animation: screenIn 0.5s ease;
}

.screen.active { display: flex; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.screen-image {
  width: 78%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  margin: 4px 0 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  mix-blend-mode: multiply;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  color: #7a1f3d;
  margin: 0 0 12px;
  white-space: pre-line;
  line-height: 1.3;
}

.screen-subtitle {
  font-size: 16px;
  color: #a1456b;
  margin: 0 0 24px;
}

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-yes {
  background: linear-gradient(135deg, #ff6b9d, #ff3e78);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 62, 120, 0.4);
}

.btn-yes:hover { transform: translateY(-2px) scale(1.03); }
.btn-yes:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-no {
  background: #fff;
  color: #a1456b;
  border: 2px solid #ffc2d4;
}

.btn-no:hover { transform: scale(0.97); }

.btn.shake-explode {
  animation: shakeExplode 0.5s ease;
}
@keyframes shakeExplode {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15) rotate(-4deg); }
  50% { transform: scale(1.3) rotate(4deg); }
  75% { transform: scale(1.1) rotate(-2deg); }
}

.btn.shrink {
  animation: shrink 0.4s ease forwards;
}
@keyframes shrink {
  to { transform: scale(0.3); opacity: 0.3; }
}

.field-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.field-row label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #a1456b;
  gap: 6px;
}

.field-row input {
  border: 2px solid #ffc2d4;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  background: #fff;
}

.choice-steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.choice-steps span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd3e0;
}

.choice-steps span.on { background: #ff3e78; }

.choice-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff3e78;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-bottom: 24px;
}

.choice-item {
  background: #fff;
  border: 2px solid #ffd3e0;
  border-radius: 18px;
  padding: 18px 10px;
  font-size: 15px;
  font-weight: 600;
  color: #7a1f3d;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-item .emoji { font-size: 30px; display: block; margin-bottom: 6px; }

.choice-item.selected {
  background: linear-gradient(135deg, #ff6b9d, #ff3e78);
  color: #fff;
  border-color: transparent;
  transform: scale(1.04);
}

.kiss-overlay {
  position: fixed;
  font-size: 80px;
  pointer-events: none;
  z-index: 50;
  animation: kissPop 0.8s ease forwards;
}
@keyframes kissPop {
  0% { transform: scale(0.3); opacity: 0; }
  40% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1) translateY(-40px); opacity: 0; }
}

.lock-code-input {
  width: 200px;
  text-align: center;
  font-size: 26px;
  letter-spacing: 8px;
  padding: 12px;
  border: 2px solid #ffc2d4;
  border-radius: 14px;
  margin: 10px 0;
  background: #fff;
}

.hint-text {
  font-size: 13px;
  color: #e05c86;
  min-height: 18px;
  margin: 4px 0;
}

.no-counter {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e05c86;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(122, 31, 61, 0.35);
}

.modal[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 28px;
  padding: 32px 26px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(214, 51, 108, 0.22);
  animation: screenIn 0.35s ease;
}

.modal-text {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.45;
  color: #7a1f3d;
  white-space: pre-line;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.archive-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px solid #ffd3e0;
  border-radius: 18px;
  padding: 22px 10px;
  background: #fff;
  color: #7a1f3d;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.archive-card .emoji { font-size: 30px; }

.archive-card:hover {
  transform: translateY(-2px);
  border-color: #ff6b9d;
}

.empty-note { margin-bottom: 8px; }

.envelope {
  font-size: 90px;
  cursor: pointer;
  transition: transform 0.2s ease;
  animation: envelopeFloat 2s ease-in-out infinite;
}

.envelope:hover { transform: scale(1.1); }

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@media (max-width: 480px) {
  .screen-title { font-size: 22px; }
  .btn { padding: 14px 26px; font-size: 16px; }
}

.screen-back {
  align-self: flex-start;
  padding: 8px 18px;
  font-size: 14px;
  margin-bottom: 10px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 22px;
}

.memory-item {
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #ffe4ec;
  cursor: zoom-in;
  box-shadow: 0 6px 16px rgba(214, 51, 108, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.memory-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 22px rgba(214, 51, 108, 0.24);
}

.reels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 22px;
}

.reel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ffd3e0;
  border-radius: 18px;
  background: #fff;
  text-decoration: none;
  color: #7a1f3d;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.reel-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ff3e78);
  box-shadow: 0 6px 16px rgba(255, 62, 120, 0.35);
}

.reel-label {
  flex: 1;
  text-align: left;
}

.reel-arrow {
  flex: none;
  font-size: 16px;
  color: #ff3e78;
}

.reel-item:hover {
  transform: translateY(-2px);
  border-color: #ff6b9d;
}

body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 6, 16, 0.92);
  animation: lightboxIn 0.2s ease;
}

.lightbox[hidden] { display: none; }

@keyframes lightboxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: screenIn 0.25s ease;
}

.lightbox-counter {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffe4ec;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }

.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 480px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 24px; }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
}
