/* =============================================================
   ABテスト Bパターン - トップ（/roleplay/）限定スタイル
   - page-landing.php のみで読み込み
   - 担当要素:
     ③ リニューアルお知らせ（非表示）
     ④ ヒーローCTA（装飾＋パルスアニメーション）
     ⑤ 追従ボタン（スタイル＋ホバー演出）
     body.menu-open 時の ⑤ 退避処理
   - ナビ（①②）は ab-test-b-pattern-nav.css に分離
   - html.ab-variant-b クラスが付いている時のみ発火
   - Aパターンは一切触らない
   - ブランチ: feature/roleplay-ab-test-fv
   - テスト期間: 2026/05/01〜2026/05/31（予定、デプロイ日により前後）
   ============================================================= */

/* ③ リニューアルお知らせ(NEWバッジ含む): 非表示 */
html.ab-variant-b aside.renewal-text {
    display: none;
}

/* ④ ヒーローCTA: bronze bg + forest-dark text + sage-lightC6 border */
html.ab-variant-b .hero .btn-primary.extra-large {
    background: var(--color-bronze);
    color: var(--color-forest-dark);
    border: 7px solid var(--color-sage-lightC6);
    animation: ab-b-hero-cta-pulse 1.6s ease-out infinite;
}
html.ab-variant-b .hero .btn-primary.extra-large:hover {
    background: #D4962E;
    color: var(--color-forest-dark);
    border-color: var(--color-sage-lightC6);
}

@keyframes ab-b-hero-cta-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--color-sage-lightC6);
    }
    100% {
        box-shadow: 0 0 0 16px transparent;
    }
}

/* アクセシビリティ：OSで「視差効果を減らす」を有効にしているユーザーには止める */
@media (prefers-reduced-motion: reduce) {
    html.ab-variant-b .hero .btn-primary.extra-large {
        animation: none;
    }
}

/* ===========================
 * 追従ボタン (⑤) - Bパターン限定
 * =========================== */

html.ab-variant-b .ab-b-sticky-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  background-color: #BD8639;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(calc(100% + 32px));
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

html.ab-variant-b .ab-b-sticky-cta[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ステージ別背景色 */
html.ab-variant-b .ab-b-sticky-cta[data-stage="1"] { background-color: #BD8639; }
html.ab-variant-b .ab-b-sticky-cta[data-stage="2"] { background-color: #00302B; }
html.ab-variant-b .ab-b-sticky-cta[data-stage="3"] { background-color: #D62D2D; }

/* ステージ別 矢印色（通常時）*/
html.ab-variant-b .ab-b-sticky-cta[data-stage="1"] .ab-b-sticky-cta__arrow { color: #BD8639; }
html.ab-variant-b .ab-b-sticky-cta[data-stage="2"] .ab-b-sticky-cta__arrow { color: #00302B; }
html.ab-variant-b .ab-b-sticky-cta[data-stage="3"] .ab-b-sticky-cta__arrow { color: #D62D2D; }

html.ab-variant-b .ab-b-sticky-cta__text {
  flex: 1;
  line-height: 1.4;
  text-align: center;
}

/* 矢印（白丸 + 矢印アイコン） */
html.ab-variant-b .ab-b-sticky-cta__arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-left: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
}

html.ab-variant-b .ab-b-sticky-cta__arrow svg {
  width: 20px;
  height: 20px;
}

/* PC: 350px固定幅、角丸16px、画面左下配置、2行表示 */
@media (min-width: 768px) {
  html.ab-variant-b .ab-b-sticky-cta {
    left: auto;
    right: 16px;
    width: auto;
    padding: 10px 72px 12px 16px;
    border-radius: 16px;
    font-size: 20px;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    border: 8px solid transparent;
    transition: 
      opacity 0.35s ease,
      transform 0.35s ease,
      background-color 0.35s ease,
      border-color 0.35s ease;
  }

  /* 白い層を疑似要素で生成（初期は幅0、右端起点） */
  html.ab-variant-b .ab-b-sticky-cta::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0;
    background-color: #ffffff;
    transition: width 0.35s ease;
    z-index: -1;
  }

  /* ホバー時: 白層が全幅に広がる（右→左） */
  html.ab-variant-b .ab-b-sticky-cta:hover::before {
    width: 100%;
  }

  html.ab-variant-b .ab-b-sticky-cta__line1,
  html.ab-variant-b .ab-b-sticky-cta__line2 {
    display: block;
  }

  /* テキスト色のtransition */
  html.ab-variant-b .ab-b-sticky-cta__text {
    transition: color 0.35s ease;
  }

  /* 矢印アイコンを絶対配置（位置は固定のまま） */
  html.ab-variant-b .ab-b-sticky-cta__arrow {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    width: 48px;
    height: 48px;
    background-color: #ffffff;
    border-radius: 50%;
    color: #000000;
    transition: color 0.35s ease;
  }
  html.ab-variant-b .ab-b-sticky-cta__arrow svg {
    width: 24px;
    height: 24px;
  }

  /* ===== ホバー時: テキスト・矢印色＋ボーダー色をステージ色に ===== */
  html.ab-variant-b .ab-b-sticky-cta[data-stage="1"]:hover {
    border-color: #BD8639;
  }
  html.ab-variant-b .ab-b-sticky-cta[data-stage="1"]:hover .ab-b-sticky-cta__text,
  html.ab-variant-b .ab-b-sticky-cta[data-stage="1"]:hover .ab-b-sticky-cta__arrow {
    color: #BD8639;
  }
  html.ab-variant-b .ab-b-sticky-cta[data-stage="2"]:hover {
    border-color: #00302B;
  }
  html.ab-variant-b .ab-b-sticky-cta[data-stage="2"]:hover .ab-b-sticky-cta__text,
  html.ab-variant-b .ab-b-sticky-cta[data-stage="2"]:hover .ab-b-sticky-cta__arrow {
    color: #00302B;
  }
  html.ab-variant-b .ab-b-sticky-cta[data-stage="3"]:hover {
    border-color: #D62D2D;
  }
  html.ab-variant-b .ab-b-sticky-cta[data-stage="3"]:hover .ab-b-sticky-cta__text,
  html.ab-variant-b .ab-b-sticky-cta[data-stage="3"]:hover .ab-b-sticky-cta__arrow {
    color: #D62D2D;
  }

  /* タッチデバイス（iPadなど）ではホバー無効化 */
  @media (hover: none) {
    html.ab-variant-b .ab-b-sticky-cta:hover {
      border-color: transparent;
    }
    html.ab-variant-b .ab-b-sticky-cta:hover::before {
      width: 0;
    }
    html.ab-variant-b .ab-b-sticky-cta:hover .ab-b-sticky-cta__text,
    html.ab-variant-b .ab-b-sticky-cta:hover .ab-b-sticky-cta__arrow {
      color: inherit;
    }
    html.ab-variant-b .ab-b-sticky-cta[data-stage="1"]:hover .ab-b-sticky-cta__arrow,
    html.ab-variant-b .ab-b-sticky-cta[data-stage="2"]:hover .ab-b-sticky-cta__arrow,
    html.ab-variant-b .ab-b-sticky-cta[data-stage="3"]:hover .ab-b-sticky-cta__arrow {
      color: #000000;
    }
  }
}

/* SP: 1行表示 */
@media (max-width: 767px) {
  html.ab-variant-b .ab-b-sticky-cta {
    font-size: 15px;
    padding-top: 8px;
    padding-bottom: 12px;
  }
  html.ab-variant-b .ab-b-sticky-cta__line1,
  html.ab-variant-b .ab-b-sticky-cta__line2 {
    display: inline;
  }
  html.ab-variant-b .ab-b-sticky-cta__text {
    font-size: 16px;
  }
}

/* ---------------------------------------------
   モバイルメニュー展開時の Sticky CTA 退避
   - main.js が body に付ける .menu-open クラスを利用
   - z-index 9998 のままだとメニューに被るため
--------------------------------------------- */
html.ab-variant-b body.menu-open .ab-b-sticky-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 32px));
}
