/* =============================================================
   Share Sheet — FAHFAHS Quiz
   ============================================================= */

/* ── Overlay ── */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 32, 48, 0);
  z-index: 100;
  transition: background 0.3s ease;
}
.share-overlay.is-visible {
  background: rgba(40, 32, 48, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── Sheet panel ── */
.share-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(102%);
  width: min(100%, 430px);
  z-index: 101;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #fffaf1 0%, #faeedd 100%);
  padding: 0 18px max(28px, env(safe-area-inset-bottom));
  border-top: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 -16px 48px rgba(55, 40, 60, 0.22);
  transition: transform 0.38s cubic-bezier(0.22, 0.96, 0.42, 1.04);
}
.share-sheet.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* ── Handle ── */
.share-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d8ccd4;
  margin: 12px auto 14px;
}

/* ── Title row ── */
.share-sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.share-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #443d49;
}
.share-x-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(141, 130, 152, 0.14);
  color: #7a718b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.share-x-close:hover { background: rgba(141, 130, 152, 0.24); }

/* ── Result image ── */
.share-img-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #e8ddef 0%, #f4e4eb 100%);
  border: 1px solid rgba(164, 142, 152, 0.2);
}
.share-big-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  /* subtle pop-in */
  animation: shareImgIn 0.4s cubic-bezier(0.22, 0.96, 0.46, 1.1) both;
}
@keyframes shareImgIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.share-img-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 14px 12px;
  background: linear-gradient(0deg, rgba(50, 35, 55, 0.55) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-img-code {
  font-family: "Century Gothic", "Avenir Next", Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
}
.share-img-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* ── No-image placeholder ── */
.share-no-img-placeholder {
  text-align: center;
  padding: 20px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(164, 142, 152, 0.3);
  margin-bottom: 14px;
}
.share-no-code {
  font-family: "Century Gothic", "Avenir Next", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b0a2a6;
}
.share-no-title { font-size: 15px; font-weight: 700; color: #443d49; margin-top: 4px; }
.share-no-name  { font-size: 12px; color: #9c7382; margin-top: 2px; }

/* ── Actions wrapper ── */
.share-actions-wrap { display: flex; flex-direction: column; gap: 10px; }

/* ── Primary share button ── */
.share-primary-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 17px;
  border: 0;
  background: linear-gradient(135deg, #8d7fa0 0%, #7a6a8e 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 20px rgba(100, 80, 120, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s;
  position: relative;
  overflow: hidden;
}
.share-primary-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.share-primary-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(100, 80, 120, 0.35); }
.share-primary-btn:active { transform: scale(0.98); box-shadow: 0 3px 10px rgba(100, 80, 120, 0.2); }
.share-primary-btn:disabled { opacity: 0.65; pointer-events: none; }
.share-primary-btn svg { flex-shrink: 0; }
.share-primary-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 1px;
}

/* ── Secondary row (save + copy) ── */
.share-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.share-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(164, 142, 152, 0.2);
  background: rgba(255, 255, 255, 0.6);
  color: #6b5a6e;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.share-secondary-btn:hover  { background: rgba(255,255,255,0.85); }
.share-secondary-btn:active { transform: scale(0.97); }

/* ── Divider ── */
.share-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c4b4b8;
  font-size: 11px;
  font-weight: 600;
}
.share-or-divider::before,
.share-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(164, 142, 152, 0.18);
}

/* ── Social pills ── */
.share-social-row {
  display: flex;
  gap: 8px;
}
.share-social-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.share-social-pill:hover  { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.share-social-pill:active { transform: scale(0.96); }

/* ── Close ── */
.share-close-btn {
  display: block;
  margin-top: 10px;
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(141, 135, 154, 0.12);
  font-size: 14px;
  font-weight: 700;
  color: #7a718b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
}
.share-close-btn:hover  { background: rgba(141, 135, 154, 0.2); }
.share-close-btn:active { transform: scale(0.98); }
