/* ============================================================
   common/promo.css
   無料ユーザー向けプロモ表示（Phase 1）のスタイル。
   (1) 紙芝居オーバーレイ .storyboard-*
       - writing/index.html の該当 CSS をそのままコピー（クラス名統一で流用）。
         writing 側にも残しているため、どちらから呼んでも同じ見た目になる。
   (2) カードタップ時のプロモモーダル .promo-modal-*
       - play.html の _showRoomLockedHint を雛形に、スクショ表示用モーダル。
   z-index 棲み分け: storyboard=10010, promo-modal=9999,
                    #pono-return-greet=9998, _room-locked-hint=99999 (既存)
   ============================================================ */

/* ===== 紙芝居 (storyboard) ===== */
.storyboard-overlay {
  position: fixed; inset: 0;
  z-index: 10010;
  display: block;
  cursor: pointer;
  opacity: 1;
  background: #000;
  transition: opacity 0.5s ease, background 0.6s ease;
  overflow: hidden;
}
.storyboard-overlay.fade-out { opacity: 0; pointer-events: none; }

.storyboard-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(4rem, 30vmin, 14rem);
  overflow: hidden;
}
.storyboard-art img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
@media (orientation: landscape) {
  .storyboard-art img {
    object-fit: cover;
    object-position: center 35%;
  }
}

.storyboard-art img.sb-pan-down {
  object-fit: cover;
  object-position: center 0%;
  animation: sbPanDown 9s linear forwards;
}
@media (orientation: landscape) {
  .storyboard-art img.sb-pan-down {
    object-fit: cover;
    animation: sbPanDown 9s linear forwards;
  }
}
@keyframes sbPanDown {
  from { object-position: center 0%; }
  to   { object-position: center 100%; }
}

.storyboard-text {
  position: absolute;
  left: 0; right: 0;
  margin: 0 auto;
  bottom: clamp(10px, 3.5vh, 40px);
  width: min(92vw, 900px);
  box-sizing: border-box;
  padding: 12px 22px 18px 22px;
  background: rgba(0, 0, 0, 0.78);
  border: 3px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.9), 0 6px 20px rgba(0,0,0,0.7);
  color: #fff;
  font-family: 'DotGothic16', 'Zen Maru Gothic', sans-serif;
  font-weight: 400;
  font-size: clamp(1.1rem, 4.2vw, 1.55rem);
  line-height: 1.55;
  letter-spacing: 0.06em;
  text-align: left;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smoothing: none;
  transition: min-height 0.2s ease;
}
.storyboard-hint {
  position: absolute;
  right: 14px;
  bottom: 6px;
  color: #ffd84d;
  font-family: 'DotGothic16', 'Zen Maru Gothic', sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.storyboard-hint.visible {
  opacity: 1;
  animation: sbHintBlink 0.7s steps(2, end) infinite;
}
@keyframes sbHintBlink {
  0%, 49%  { opacity: 1; transform: translateY(0); }
  50%,100% { opacity: 0.3; transform: translateY(2px); }
}
.storyboard-art.sb-in { animation: sbArtIn 0.85s ease-out both; }
.storyboard-text.sb-in { animation: sbContentIn 0.6s ease-out both; animation-delay: 0.25s; }
.storyboard-art.sb-out { animation: sbArtOut 0.55s ease-in both; }
.storyboard-text.sb-out { animation: sbContentOut 0.35s ease-in both; }
@keyframes sbArtIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes sbArtOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.02); }
}
@keyframes sbContentIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sbContentOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ===== カードタップ時のプロモモーダル ===== */
.promo-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.promo-modal.is-visible { opacity: 1; }

.promo-modal-box {
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px 20px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 10px 36px rgba(0,0,0,0.35);
  transform: scale(0.8);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.promo-modal.is-visible .promo-modal-box { transform: scale(1); }

.promo-modal-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #F2915A, #EB6A3B);
  padding: 4px 12px;
  border-radius: 50px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.promo-modal-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #5D4E37;
  margin-bottom: 10px;
  line-height: 1.35;
}
.promo-modal-screenshot {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: #f3ede2;
  margin: 0 auto 12px;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.promo-modal-caption {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5D4E37;
  line-height: 1.6;
  margin-bottom: 14px;
}
.promo-modal-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: #A89880;
  margin-bottom: 12px;
  line-height: 1.5;
}
.promo-modal-close {
  padding: 10px 32px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59,130,246,0.4);
}
.promo-modal-close:active { transform: translateY(1px); }
