/* ============================================ */
/* Stories cards (js/storycard.js), sc-*        */
/* «📸» buttons in the love-language result and */
/* the pair report + preview modal               */
/* #storyCardModal. Self-contained: quiz.html    */
/* has no style.css.                             */
/* ============================================ */

/* Button (lovelang result: next to .ll-btn-retake look; pair report: next to .pr-btn-ghost look) */
button.sc-story-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  width: 100%;
  min-height: 48px;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.45);
  background: rgba(236, 72, 153, 0.12);
  color: #fbcfe8;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
button.sc-story-btn.sc-story-pair { margin: 14px 0 0; }
button.sc-story-btn:disabled,
button.sc-story-btn.sc-busy { opacity: 0.6; cursor: progress; }

@media (hover: hover) and (pointer: fine) {
  button.sc-story-btn:hover { background: rgba(236, 72, 153, 0.22); border-color: rgba(244, 114, 182, 0.75); }
  .sc-close:hover { background: rgba(255, 82, 82, 0.2); color: #ff5252; }
  .sc-btn-main:hover { filter: brightness(1.08); }
  .sc-btn-ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.3); }
}

/* ---------- Preview modal (above #loveLangModal / #pairModal, z-index 10000) ---------- */
.sc-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10060;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sc-overlay *, .sc-overlay *::before, .sc-overlay *::after { box-sizing: border-box; }

.sc-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 12px auto;
  padding: 18px 20px 20px;
  background: #16161e;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
  animation: scSlideIn 0.25s ease;
}
@keyframes scSlideIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.sc-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.sc-title {
  margin: 8px 48px 14px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: #c084fc;
  text-align: left;
}

.sc-img-wrap { display: flex; justify-content: center; }
.sc-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 60vh;
  max-height: min(60vh, 560px);
  border-radius: 14px;
  background: #0b0b12;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

.sc-hint {
  margin: 14px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #94a3b8;
}

.sc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.sc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-btn-main {
  border: none;
  background: linear-gradient(135deg, #be185d, #ec4899 55%, #a855f7);
  color: #fff;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.35);
}
.sc-btn-main:visited { color: #fff; }
.sc-btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}
.sc-btn:disabled, .sc-btn.sc-busy { opacity: 0.6; cursor: progress; }

.sc-error {
  margin: 8px 0 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .sc-overlay { padding: 10px; }
  .sc-modal { margin: 6px auto; padding: 14px 14px 16px; border-radius: 16px; }
  .sc-close { top: 6px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-modal { animation: none; }
}
