/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Outfit:wght@400;600;800&display=swap');

:root {
  --bg-gradient-start: #0f0c1b;
  --bg-gradient-end: #05020a;
  --primary-color: #2ecc71; /* みまもりグリーン */
  --primary-hover: #27ae60;
  --accent-color: #ff3366; /* TikTokピンク */
  --accent-blue: #00f2fe; /* TikTokシアン */
  --text-light: #ffffff;
  --text-dark: #111111;
  --font-main: 'Noto Sans JP', sans-serif;
  --font-accent: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* PC等での表示用の背景装飾 */
.background-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.circle-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.circle-light-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-color);
  top: -10%;
  left: -10%;
}

.circle-light-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-blue);
  bottom: -15%;
  right: -10%;
}

/* スマホモックアップフレーム (9:16) */
.phone-container {
  position: relative;
  width: 100%;
  max-width: 410px; /* TikTok動画アスペクト比 */
  height: 100vh;
  max-height: 820px;
  background-color: #000;
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8),
              0 0 0 12px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* スマホノッチ・スピーカーの表現 */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 25px;
  background-color: #000;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-notch::before {
  content: '';
  width: 40px;
  height: 4px;
  background-color: #222;
  border-radius: 2px;
}

/* レスポンシブ対応：スマホ表示の時はフレームを消して全画面に */
@media (max-width: 500px) {
  body {
    background: #000;
  }
  .phone-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-notch {
    display: none;
  }
}

/* スライドショーエリア */
.slideshow-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 各スライド */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  z-index: 10;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 20;
}

/* スライドの背景画像 (Ken Burns アニメーション) */
.slide-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 6s linear;
}

.slide.active .slide-bg {
  transform: scale(1.1);
}

/* グラデーションオーバーレイ（下部の文字を読みやすくするため） */
.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(0,0,0,0.3) 0%, 
              rgba(0,0,0,0.1) 40%, 
              rgba(0,0,0,0.6) 75%, 
              rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}

/* 上部ヘッダー（サービス名など） */
.slideshow-header {
  position: absolute;
  top: 35px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.service-logo {
  font-family: var(--font-accent);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--primary-color);
}

/* 右側コントロール（BGMなど） */
.header-controls {
  pointer-events: auto;
  display: flex;
  gap: 10px;
}

.btn-control {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  pointer-events: auto; /* 親要素のpointer-events: noneを上書きしてクリック可能にする */
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.btn-control svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 字幕・セリフ表示エリア */
.slide-caption-container {
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 100%;
  padding: 0 24px;
  z-index: 40;
  pointer-events: none;
}

/* セリフのフキダシ */
.speech-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border-radius: 20px;
  padding: 14px 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  margin-bottom: 16px;
  position: relative;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide.active .speech-bubble {
  transform: translateY(0);
  opacity: 1;
}

.speaker-tag {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary-hover);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.speech-text {
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 500;
}

/* TikTok風の動画解説テロップ（ナレーション） */
.narration-box {
  background: rgba(0, 0, 0, 0.6);
  border-left: 4px solid var(--accent-color);
  padding: 10px 16px;
  border-radius: 4px;
  backdrop-filter: blur(5px);
  font-size: 0.9rem;
  line-height: 1.4;
  color: #eee;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s ease 0.2s;
}

.slide.active .narration-box {
  transform: translateY(0);
  opacity: 1;
}

/* プログレスバー（上部に配置されるTikTok風のタイムライン） */
.progress-bar-container {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  z-index: 50;
}

.progress-bar-segment {
  flex: 1;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--text-light);
  border-radius: 2px;
}

.progress-bar-segment.completed .progress-bar-fill {
  width: 100%;
}

.progress-bar-segment.active .progress-bar-fill {
  /* スクリプトから動的に制御 */
}

/* スライド操作のための左右タップエリア */
.tap-nav-left, .tap-nav-right {
  position: absolute;
  top: 0;
  width: 25%;
  height: 80%;
  z-index: 30;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tap-nav-left {
  left: 0;
}

.tap-nav-right {
  right: 0;
}

/* イントロ・スタート画面（ユーザー操作開始のためのオーバーレイ） */
.intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1b0a2a, #07020d);
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.intro-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-badge {
  background: linear-gradient(90deg, var(--accent-color), var(--accent-blue));
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
}

.intro-title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 12px;
  background: linear-gradient(to right, #fff, #bbb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 40px;
  line-height: 1.5;
}

.btn-start {
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(46, 204, 113, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-start:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(46, 204, 113, 0.6);
}

.btn-start svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 最終コンバージョン画面 */
.cta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.cta-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cta-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}

.cta-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
  line-height: 1.6;
}

.cta-badge {
  background: rgba(46, 204, 113, 0.15);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: inline-block;
}

.btn-cta {
  background: linear-gradient(135deg, var(--primary-color), #27ae60);
  color: white;
  text-decoration: none;
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(46, 204, 113, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: pulse-button 2s infinite;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(46, 204, 113, 0.6);
}

@keyframes pulse-button {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 10px 35px rgba(46, 204, 113, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.4);
  }
}

.btn-replay {
  margin-top: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 20px;
  font-size: 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-replay:hover {
  color: #fff;
  border-color: #fff;
}

/* 音声波形表示（BGM再生中に動く小さなアニメーション） */
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.wave-bar {
  width: 2px;
  height: 4px;
  background-color: var(--text-light);
  border-radius: 1px;
}

.audio-playing .wave-bar {
  animation: bounce-wave 0.8s ease-in-out infinite alternate;
}

.audio-playing .wave-bar:nth-child(2) { animation-delay: 0.15s; }
.audio-playing .wave-bar:nth-child(3) { animation-delay: 0.3s; }
.audio-playing .wave-bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes bounce-wave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* 音符のパーティクル（画面上にふわふわ浮かぶ） */
.note-particle {
  position: absolute;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 45;
  animation: float-note 3s ease-out forwards;
}

@keyframes float-note {
  0% {
    transform: translateY(0) scale(0.8) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-80px) scale(1.2) rotate(30deg);
    opacity: 0;
  }
}

/* アプリ内デモスマホのモックアップ表示（Scene 4用） */
.app-demo-container {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 290px;
  height: 52%;
  z-index: 25;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-demo-phone {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 0 8px #222;
  overflow: hidden;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #333333;
}

.app-demo-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.app-demo-header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 4px;
}

.app-demo-logo {
  height: 2.2rem;
  width: auto;
  object-fit: contain;
}

.app-demo-instructions {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #4b5563;
  margin: 6px 0;
}

.app-demo-instructions strong {
  color: #10b981;
}

.app-demo-btn-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.app-demo-btn {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  animation: demo-btn-pulse 2s infinite;
}

.app-demo-btn-icon {
  font-size: 1.6rem;
  margin-bottom: 2px;
}

.app-demo-btn-text {
  font-size: 0.85rem;
  font-weight: bold;
  line-height: 1.2;
}

.app-demo-footer {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 500;
  margin-top: 4px;
}

@keyframes demo-btn-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  }
}

/* 閉じるボタンのスタイル */
.btn-close-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
  text-decoration: none;
  pointer-events: auto !important; /* 親要素のpointer-events: noneを無効化してタップ可能にする */
}
.btn-close-promo:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.pc-btn-close-promo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2000;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.pc-btn-close-promo:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* モバイル時にはPC用の巨大閉じるボタンを非表示にする */
@media (max-width: 900px) {
  .pc-btn-close-promo {
    display: none;
  }
}

/* リンクフリー ＆ コピーパーツのスタイル */
.promo-link-free-container {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 0.85rem;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  text-align: left;
}

.link-free-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #10b981;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.link-free-desc {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.link-copy-box {
  margin-bottom: 0.5rem;
}

.link-copy-box:last-child {
  margin-bottom: 0;
}

.link-copy-tag {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  display: block;
  margin-bottom: 0.15rem;
}

.link-code-row {
  display: flex;
  gap: 0.3rem;
  width: 100%;
}

.link-code-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: monospace;
  outline: none;
}

.link-code-row button {
  background: #10b981;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.link-code-row button:hover {
  background: #059669;
}

.link-code-row button.copied {
  background: #2563eb;
}

