/* ── Friendship Necklace Crafting modal ─────────────────────────── */
.necklace-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.necklace-modal.open {
  display: flex;
}
.necklace-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(60, 16, 80, 0.55) 0%,
    rgba(20, 6, 32, 0.78) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.necklace-card {
  position: relative;
  width: min(640px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff5fb 0%, #ffe6f3 100%);
  border: 3px solid #ff8ac0;
  border-radius: 28px;
  padding: 28px 26px 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: "Georgia", serif;
}
.necklace-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #ff8ac0;
  background: #fff;
  color: #d44e8f;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.necklace-kicker {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #d44e8f;
  font-weight: 700;
}
.necklace-friend-name {
  margin: 0;
  font-size: 26px;
  color: #5a234a;
}
.necklace-string {
  position: relative;
  min-height: 96px;
  padding: 16px 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 50%, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 88% 50%, #fff 0 8px, transparent 9px),
    linear-gradient(180deg, #fdf3fa 0%, #f7e3ee 100%);
  border: 2px dashed #ff9ed8;
  display: flex;
  align-items: center;
}
.necklace-string-empty {
  width: 100%;
  text-align: center;
  color: #b56dd9;
  font-style: italic;
  font-size: 15px;
}
.necklace-string-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
}
.necklace-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 138, 192, 0.35);
}
.necklace-bead,
.necklace-strung {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border: none;
  background: var(--bead-color, #ff9ed8);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    inset 0 4px 8px rgba(255, 255, 255, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.necklace-strung {
  width: 44px;
  height: 44px;
  min-width: 44px;
  font-size: 20px;
}
.necklace-bead:hover,
.necklace-strung:hover {
  transform: translateY(-2px) scale(1.05);
}
.necklace-bead:active,
.necklace-strung:active {
  transform: translateY(0) scale(0.96);
}
.necklace-bead-round,
.necklace-bead-ring,
.necklace-bead-spark,
.necklace-bead-gem {
  border-radius: 999px;
}
.necklace-bead-heart,
.necklace-bead-flower,
.necklace-bead-leaf,
.necklace-bead-star {
  border-radius: 18px;
}
.necklace-bead-ring {
  background: radial-gradient(circle, transparent 30%, var(--bead-color) 32%);
}
.necklace-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.necklace-clear,
.necklace-done {
  padding: 12px 22px;
  min-height: 46px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-family: "Georgia", serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.necklace-clear {
  background: #fff;
  color: #d44e8f;
  border-color: #ff8ac0;
}
.necklace-done {
  background: linear-gradient(180deg, #ff8ac0 0%, #d44e8f 100%);
  color: #fff;
  box-shadow:
    0 6px 18px rgba(212, 78, 143, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
@media (max-width: 540px) {
  .necklace-card {
    padding: 22px 16px 18px;
  }
  .necklace-bead {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
}

@media (max-width: 700px) {
  .story-modal-card {
    grid-template-columns: 1fr;
    padding: 18px 16px;
    gap: 12px;
    width: min(92vw, 360px);
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }
  .story-modal-portrait {
    min-height: 144px;
    padding: 10px;
  }
  .story-modal-img {
    max-height: 170px;
  }
  .story-modal-body {
    gap: 8px;
  }
  .story-modal-name {
    font-size: 24px;
  }
  .story-modal-text {
    font-size: 15px;
    line-height: 1.38;
  }
  .story-modal-evidence {
    padding: 8px 10px;
    font-size: 14px;
  }
  .story-modal-bridge {
    padding: 8px 10px;
    font-size: 14px;
  }
}
