/* ---------- 写真で送る（見せ方を選ぶ画面） ----------
 * 写真を選ぶと出る全画面。上に仕上がりの絵、その下に4つの見せ方の見本、いちばん下に送るボタン。
 * ダーツの旅（夜のスタジオ）と違って、ここはアプリの下地のまま。写真の色をそのまま見てほしいので。
 * 中身は js/share-photo.js。見せ方を決めるまでの検討は docs/機能/写真カードの見せ方.html */

/* 共有カードの2つめのボタン。1つめ（地図の絵）とすき間を少しだけ空けて重ねる */
.share-card .sc-photo { margin-top: 8px; }
.share-card .sc-btn[hidden] { display: none; }

/* 開いている間は、うしろの画面を動かさない */
html.sp-open, html.sp-open body { overflow: hidden; }

.photo-share {
  position: fixed;
  inset: 0;
  z-index: 46; /* ダーツ（45）より上。両方が同時に開くことは無いが、念のため */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: sp-in 0.25s ease;
}
@keyframes sp-in { from { opacity: 0; transform: translateY(8px); } }
.photo-share[hidden] { display: none; }

.sp-top {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  flex: none;
}
.sp-title {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.sp-title span {
  margin-left: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sp-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  padding: 4px 10px;
  margin-right: -10px;
  cursor: pointer;
  font-family: inherit;
}

/* 仕上がりの絵。縦4:5。画面の高さから下の見本とボタンのぶんを引いた高さに収める */
.sp-stage {
  position: relative;
  flex: none;
  width: min(100%, 440px, calc((100dvh - 290px) * 0.8));
  min-width: 200px;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: #ECECE6;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(20, 20, 15, 0.12), 0 2px 6px rgba(20, 20, 15, 0.05);
}
.sp-preview { width: 100%; height: 100%; display: block; }
.sp-preview[hidden] { display: none; }
.sp-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.sp-msg[hidden] { display: none; }

/* 見せ方の見本。4つを1行に */
.sp-picks {
  flex: none;
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sp-pick {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sp-pick img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background: #ECECE6;
  display: block;
  object-fit: cover;
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s;
}
.sp-pick span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.sp-pick[aria-pressed="true"] img { outline-color: var(--line-color); }
.sp-pick[aria-pressed="true"] span { color: var(--ink); font-weight: 800; }

/* 送るボタン。この画面でいちばん押してほしいので、回すボタンと同じく路線色で塗る */
.sp-send {
  flex: none;
  width: 100%;
  max-width: 440px;
  padding: 13px;
  border: none;
  border-radius: 999px;
  background: var(--line-color);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--btn-shadow);
  transition: transform 0.1s, opacity 0.15s;
}
.sp-send:active { transform: scale(0.98); }
.sp-send:disabled { opacity: 0.45; cursor: default; }
.sp-retake {
  flex: none;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px 8px;
  cursor: pointer;
}
