/* =====================================================
   SNSキャラ選択 & シェア機能 CSS
   ポケモンサイトの .pokemon-slot スタイルに準拠
   /wp-content/themes/your-theme/css/sns-share.css
   ===================================================== */

/* ── セクション全体 ── */
.sns-share-section {
  width: 100%;
  margin: 20px auto 0;
  padding: 0;
}


/* ── 選択カウンター ── */
.sns-select-counter {
  text-align: center;
  font-size: 0.82rem;
  color: #6b6b8a;
  margin-bottom: 16px;
}

/* ── キャラグリッド（3列×2行）── */
.sns-chara-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .sns-chara-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 10px; }
}

/* ── キャラ2体のみの場合：中央寄せ（PC・モバイル共通）── */
.sns-chara-grid--col2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 66%;
  margin: 0 auto;
  gap: 32px;
}
@media (max-width: 768px) {
  .sns-chara-grid--col2 {
    gap: 16px;
  }
}

/* ── キャラカード（.pokemon-slot 準拠）── */
.sns-chara-card {
  /* aspect-ratio: 3 / 4; */
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sns-chara-card:hover {
  transform: translateY(-4px) scale(1.02);
}

/* 3体選択済み：未選択は半透明＆操作不可 */
.sns-chara-grid.max-selected .sns-chara-card:not(.selected) {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}


/* ── カード内コンテンツ（黒枠部分・.slot-content 準拠）── */
.sns-chara-content {
  border-radius: 20px;
  border: 4px solid #323232;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 選択状態：内側ボーダー */
.sns-chara-card.selected .sns-chara-content {
  border-color: #ff783c;
  box-shadow: 0 8px 24px rgba(230,57,80,0.15);
}

/* ── キャラ画像（.slot-sprite 準拠）── */
.sns-chara-img {
  width: 100%;
  /* height: 80px; */
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.14));
  animation: sns-bob 2.5s ease-in-out infinite;
  pointer-events: none;
  transform: scale(1.05);
  transition: transform 0.2s;
}

/* 未選択時は少し拡大した状態を保ったまま上下に動かし、
   端が透けて背景（コンテナの白）が見えないようにする */
@keyframes sns-bob {
  0%,100% { transform: translateY(0) scale(1.05); }
  50%      { transform: translateY(-3px) scale(1.05); }
}

/* 選択中は bob アニメ停止し、元のサイズに戻す */
.sns-chara-card.selected .sns-chara-img {
  animation: none;
  transform: scale(1);
}

/* ── キャラ名（.slot-name-jp 準拠）── */
.sns-chara-name {
  padding: 2px;
  margin: 10px auto 0;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  line-height: 1.6;
  width: 85%;
  min-width: 150px;
  color: #323232;
  background: #fff;
  border-radius: 100px;
  border: 2px solid #000;
  -webkit-text-stroke: 4px #f5f5f5;
  paint-order: stroke fill;
  text-shadow:
     2px  0px 0 #f5f5f5,
    -2px  0px 0 #f5f5f5,
     0px  2px 0 #f5f5f5,
     0px -2px 0 #f5f5f5,
     2px  2px 0 #f5f5f5,
    -2px  2px 0 #f5f5f5,
     2px -2px 0 #f5f5f5,
    -2px -2px 0 #f5f5f5;
}
@media screen and (max-width: 768px) {
  .sns-chara-name {
    font-size: 14px;
  }
}

/* ── キャラサブ名（.slot-name-en 準拠）── */
.sns-chara-sub {
  font-size: 0.65rem;
  color: #aaaacc;
  margin-top: 2px;
  font-family: 'Zen Dots', cursive, sans-serif;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ── ボールデコ（右下）── */
.sns-ball-deco {
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  opacity: 0.04;
  pointer-events: none;
}

/* ── 空スロット ── */
.sns-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.3;
  pointer-events: none;
}

.sns-slot-empty-ball { width: 48px; height: 48px; }

.sns-slot-empty-text {
  font-size: 0.78rem;
  color: #6b6b8a;
  text-align: center;
  line-height: 1.4;
}

/* ── 生成ボタン ── */
/* .btn-sns-make {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  padding: 14px 32px;
  border-radius: 50px;
  background: #ff783c;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 16px rgba(230,57,80,0.35);
}

.btn-sns-make:hover:not(:disabled) {
  background: #c9521f;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230,57,80,0.45);
}

.btn-sns-make:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
} */

/* ── モーダルオーバーレイ ── */
.sns-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sns-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── モーダルボックス ── */
.sns-modal-box {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}

.sns-modal-overlay.active .sns-modal-box { transform: translateY(0); }

.sns-modal-title {
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: #aaaacc;
  text-align: center;
  margin-bottom: 16px;
  text-transform: uppercase;
}

#snsPreviewCanvas {
  width: 100%;
  border-radius: 12px;
  display: block;
  border: 1px solid #e0e0ea;
}

@media screen and (max-width: 768px) {
  .sns-modal-box {
    padding: 10px;
  }
  .sns-modal-title {
    margin-bottom: 10px;
  }
}

/* ── ステータスメッセージ ── */
.sns-status-msg {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  display: none;
}
.sns-status-msg.show    { display: block; }
.sns-status-msg.info    { background: #e8f4fd; color: #1565c0; }
.sns-status-msg.success { background: #e8f5e9; color: #2e7d32; }
.sns-status-msg.error   { background: #fdecea; color: #c62828; }

/* ── モーダルボタン群 ── */
.sns-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-x-post {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 50px;
  background: #1a1a2e;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(26,26,46,0.25);
}

.btn-x-post:hover:not(:disabled) {
  background: #2a2a3e;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26,26,46,0.3);
}

.btn-x-post:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-sns-close {
  padding: 13px 24px;
  border-radius: 50px;
  background: transparent;
  color: #aaaacc;
  font-size: 1.2rem;
  font-family: inherit;
  border: 1.5px solid #e0e0ea;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sns-close:hover { color: #6b6b8a; border-color: #c8c8e0; }

@media screen and (max-width: 768px) {
  .sns-modal-actions {
    flex-direction: column;
  }
  .btn-x-post {
    justify-content: center;
  }
}

/* ── スピナー ── */
.sns-spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sns-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes sns-spin { to { transform: rotate(360deg); } }

.sns-share-buttons {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.sns-share-buttons > * {
  flex: 1;
}
.sns-share-buttons button {
  border: none;
  transition: all 0.3s ease;
}
.sns-share-buttons button:not(:disabled) {
  cursor: pointer;
}
.sns-share-buttons button:not(:disabled):hover {
  opacity: 0.8;
}