/* =================================================
   キャラクター選択画面（/learn/）
   FUJITA築育サイト

   構成:
   1. 固定MVレイヤー（learn-mv）… トップページMVの装飾を流用し画面に固定
   2. スクロールパネル（learn-panels）… FV→キャラ選択をスライドのように切替
   3. キャラ選択ボタン（learn-select）
   4. 選択後モーダル（learn-modal）
   5. レスポンシブ（768px以下 = SP）
================================================= */

.site-header { background: transparent; }
.page-content { padding-top: 0; }

.is-pc-only { display: block !important; }
.is-sp-only { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden; /* .learn-panels内でのみスクロールさせ、ブラウザ本来の縦スクロールバーを出さない */
}

.learn-page {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #b1e0f8;
}

/* -----------------------------------------------
   1. 固定MVレイヤー（トップページMV流用・簡易版）
   sky/ground/frameの構造・クラス名はtop.cssのものをそのまま利用
----------------------------------------------- */
.learn-mv {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* -----------------------------------------------
   2. スクロールパネル
   scroll-snapで「MV固定・コンテンツがスライドのように切替」を実現
----------------------------------------------- */
.learn-panels {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox：スクロールバー非表示（スクロール自体は可能） */
}

.learn-panels::-webkit-scrollbar {
  display: none; /* Chrome/Safari：スクロールバー非表示 */
}

.learn-panel {
  position: relative;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent; /* 固定MVを透過して見せる */
}

/* -----------------------------------------------
   3. FVパネル
----------------------------------------------- */
.learn-fv__circle-wrap {
  position: relative;
  width: 606px;
  height: 606px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.learn-fv__circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 606px;
  height: auto;
}

.learn-fv__head {
  position: relative;
  padding: 0 40px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 41px;
  background: linear-gradient(90deg, #0E845C 0%, #0867AE 100%);
}

.learn-fv__head-badge {
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 50px;
  color: var(--color-white);
  white-space: nowrap;
}

.learn-fv__title {
  position: relative;
  margin-top: 0;
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 70px;
  text-align: center;
  background: linear-gradient(90deg, #0E845C 0%, #0867AE 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.learn-fv__read {
  position: relative;
  margin-top: -10px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-align: center;
}

.learn-fv__chara {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 395px;
  height: auto;
}

.learn-scroll-icon {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  width: 80px;
}

.learn-scroll-icon img {
  display: block;
  width: 100%;
  height: auto;
  animation: learn-scroll-loop 1.6s ease-in-out infinite;
}

@keyframes learn-scroll-loop {
  0%   { transform: translateY(-6px); opacity: 0.4; }
  50%  { transform: translateY(4px);  opacity: 1; }
  100% { transform: translateY(-6px); opacity: 0.4; }
}

/* -----------------------------------------------
   4. キャラ選択パネル
----------------------------------------------- */
.learn-select__bar {
  position: relative;
  width: 678px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learn-select__bar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.learn-select__bar-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 32px;
  color: var(--color-white);
  text-align: center;
}

/* キャラ選択バーの下に添える注意書きカード */
.learn-select__notice {
  max-width: 980px;
  margin: 20px auto 0;
  padding: 20px 32px;
  background: var(--color-white);
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.learn-select__notice-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-select__notice-list li {
  position: relative;
  padding-left: 1.2em;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
}

.learn-select__notice-list li::before {
  content: '・';
  position: absolute;
  left: 0;
}

.learn-select__notice-list li + li {
  margin-top: 6px;
}

.learn-select__list {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 42px 0 0;
  padding: 0;
  list-style: none;
}

.learn-select__list li {
  margin: 0;
  padding: 0;
}

.learn-select__btn {
  position: relative;
  width: 317px;
  height: 317px;
  border-radius: 158.5px;
  background: var(--color-white);
  border: 4px solid #009A59;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

/* Figma上にホバー指定なし。トップページのバナーと同様、オレンジボーダーで操作対象を表現 */
.learn-select__btn:hover {
  border-color: orange;
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* 選択済み再訪時のハイライト（Figma上に指定なし。半透明白をカードに重ねて表現） */
.learn-select__btn.is-selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.learn-select__btn-illust {
  width: 210px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.learn-select__btn-tag {
  width: 210px;
  height: 43px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 59px;
  background: var(--color-green);
  color: var(--color-white);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 20px;
  white-space: nowrap;
}

/* -----------------------------------------------
   5. 選択後モーダル
----------------------------------------------- */
.learn-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.learn-modal.is-active {
  display: flex;
}

.learn-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 132, 92, 0.8); /* #0E845C × opacity 80%（ハンバーガーメニューのオーバーレイと同色） */
  cursor: pointer;
}

.learn-modal__contents {
  position: relative;
  z-index: 1;
  width: 1140px;
  max-width: calc(100% - 40px);
  height: 414px;
  background: var(--color-white);
  border-radius: 40px;
  display: flex;
  align-items: center;
  padding: 8px 40px 8px 40px;
  gap: 34px;
}

.learn-modal__chara {
  flex: 0 0 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learn-modal__chara img {
  width: 280px;
  height: 400px;
  object-fit: contain;
}

.learn-modal__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.learn-modal__bar {
  width: 100%;
  max-width: 692px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  background: var(--color-blue);
}

.learn-modal__bar p {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 32px;
  color: var(--color-white);
  white-space: nowrap;
}

.learn-modal__read {
  margin-top: 20px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: #000;
  text-align: center;
  line-height: 1.6;
}

.learn-modal__start {
  margin-top: 24px;
  width: 353px;
  max-width: 100%;
  height: 81.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 46px;
  background: var(--color-green);
  color: var(--color-white);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  transition: opacity 0.2s ease;
  padding: 0 15px 0 30px;
}

.learn-modal__start:hover { opacity: 0.85; }

.learn-modal__start-icon {
  width: 50.6px;
  height: 50.6px;
  border-radius: 50%;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.learn-modal__start-icon img {
  display: block;
  width: 16px;
  height: auto;
}

/* -----------------------------------------------
   SP（768px以下）
----------------------------------------------- */
@media screen and (max-width: 768px) {
  .is-pc-only { display: none !important; }
  .is-sp-only { display: block !important; }

  .learn-fv__circle-wrap {
    width: 364.9px;
    height: 407.6px;
  }
  .learn-fv__circle { width: 364.9px; height: 407.6px; }

  .learn-fv__head {
    height: 49.4px;
    padding: 0 24px;
    border-radius: 25px;
  }
  .learn-fv__head-badge { font-size: 26px; }
  .learn-fv__title { margin-top: 8px; font-size: 32px; }
  .learn-fv__read { margin-top: 8px; font-size: 14px; padding: 0 20px; }
  .learn-fv__chara { width: 239px; }

  /* SPはキャラ選択パネルの内容が1画面に収まらない（特にルビ表示時）ため、
     上寄せ＋高さ可変にして最後のボタン（ハクと学ぶ）まで縦スクロールできるようにする。
     scroll-snap（mandatory）はパネル先頭に戻してしまい下部へ到達できないためSPでは解除。 */
  .learn-panels {
    scroll-snap-type: none;
  }
  .learn-panel--select {
    height: auto;
    min-height: 100vh;
    justify-content: flex-start;
    padding: 90px 0 40px;
    box-sizing: border-box;
  }

  .learn-select__bar {
    width: 332.8px;
    height: 81px;
  }
  .learn-select__bar-text { font-size: 18px; } /* ルビ表示で枠からはみ出さないよう縮小 */

  .learn-select__notice {
    max-width: 100%;
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 18px;
  }
  .learn-select__notice-list li { font-size: 13px; }

  .learn-select__list {
    flex-direction: column;
    gap: 22px;
    margin-top: 24px;
  }

  .learn-select__btn {
    width: 351px;
    max-width: calc(100vw - 40px);
    height: 137px;
    border-radius: 20px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-left: 12px;
  }

  .learn-select__btn-illust {
    width: 120px;
    height: 128px;
    flex-shrink: 0;
  }

  .learn-select__btn-tag {
    width: 163px;
    height: 74px;
    flex-shrink: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    font-size: 18px;
  }

  .learn-modal__contents {
    width: 356px;
    height: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    flex-direction: column;
    padding: 20px 12px;
    gap: 0;
    border-radius: 40px;
  }

  .learn-modal__chara { flex: none; margin-bottom: -20px; }
  .learn-modal__chara img { width: 170px; height: 294px; }

  .learn-modal__bar { height: 78px; border-radius: 39px; max-width: 322px; }
  .learn-modal__bar p { font-size: 22px; white-space: normal; text-align: center; }

  .learn-modal__read { margin-top: 16px; font-size: 16px; }

  .learn-modal__start { width: 248.9px; height: 52px; font-size: 18px; border-radius: 40px; margin-top: 20px; margin-bottom: 4px; }
  .learn-modal__start-icon { width: 33.4px; height: 33.4px; }
  .learn-modal__start-icon img { width: 11px; }
}

/* -----------------------------------------------
   中間幅（769px〜999px）
   キャラ選択ブロック（.learn-panel--select）とモーダル（.learn-modal__contents）
   のみSPデザインに切替。FV・MV等ページの他要素はPCデザインのまま維持する。
----------------------------------------------- */
@media screen and (min-width: 769px) and (max-width: 999px) {
  .learn-panel--select .is-pc-only,
  .learn-modal .is-pc-only {
    display: none !important;
  }
  .learn-panel--select .is-sp-only,
  .learn-modal .is-sp-only {
    display: block !important;
  }

  .learn-select__bar {
    width: 332.8px;
    height: 81px;
  }
  .learn-select__bar-text { font-size: 18px; } /* ルビ表示で枠からはみ出さないよう縮小 */

  .learn-select__notice {
    max-width: 100%;
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 18px;
  }
  .learn-select__notice-list li { font-size: 13px; }

  .learn-select__list {
    flex-direction: column;
    gap: 22px;
    margin-top: 24px;
  }

  .learn-select__btn {
    width: 351px;
    max-width: calc(100vw - 40px);
    height: 137px;
    border-radius: 20px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-left: 12px;
  }

  .learn-select__btn-illust {
    width: 120px;
    height: 128px;
    flex-shrink: 0;
  }

  .learn-select__btn-tag {
    width: 163px;
    height: 74px;
    flex-shrink: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    font-size: 18px;
  }

  .learn-modal__contents {
    width: 356px;
    height: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    flex-direction: column;
    padding: 20px 12px;
    gap: 0;
    border-radius: 40px;
  }

  .learn-modal__chara { flex: none; margin-bottom: -20px; }
  .learn-modal__chara img { width: 170px; height: 294px; }

  .learn-modal__bar { height: 78px; border-radius: 39px; max-width: 322px; }
  .learn-modal__bar p { font-size: 22px; white-space: normal; text-align: center; }

  .learn-modal__read { margin-top: 16px; font-size: 16px; }

  .learn-modal__start { width: 248.9px; height: 52px; font-size: 18px; border-radius: 40px; margin-top: 40px; margin-bottom: 4px; }
  .learn-modal__start-icon { width: 33.4px; height: 33.4px; }
  .learn-modal__start-icon img { width: 11px; }
  .learn-modal__body {
    width: 95%;
  }
}

/* -----------------------------------------------
   けんぞーくん＋戻るボタン（他ページ共通の.tobira-guideと同一実装）
   learn-modal(z-index:100)より下、MVより上に来るようz-floatを使う
----------------------------------------------- */
.tobira-guide {
  position: fixed;
  bottom: 20%;
  left: var(--space-md);
  z-index: var(--z-float);
}

.tobira-guide.is-pc-only {
  width: 115px;
  height: 216px; /* 最大の立ち絵(ハク152px)が収まる高さ：64(重なり)+152 */
}

.tobira-guide.is-sp-only {
  width: 73px;
  height: 137px; /* 40(重なり)+97 */
}

/* キャラ画像：初期は非表示、is-activeが付いたものだけ表示 */
.tobira-guide__char {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

.tobira-guide__char.is-active {
  display: block;
}

.tobira-guide.is-pc-only .tobira-guide__char {
  width: 115px;
  bottom: 64px;
}

.tobira-guide.is-sp-only .tobira-guide__char {
  width: 73px;
  bottom: 40px;
}

/* 戻るボタン（フジタコインをチェックと同じグラデーション枠の手法） */
.tobira-guide__btn {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(95deg, #0E845C 9.49%, #0867AE 94.76%) border-box;
  color: #0E845C;
  font-family: var(--font-main);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tobira-guide__btn-line {
  display: block;
}

.tobira-guide.is-pc-only .tobira-guide__btn {
  width: 108px;
  height: 108px;
  border: 4px solid transparent;
  font-size: 20px;
  line-height: 1.3;
}

.tobira-guide.is-sp-only .tobira-guide__btn {
  width: 68px;
  height: 68px;
  border: 3px solid transparent;
  font-size: 10px;
  line-height: 1.3;
}

@media screen and (max-width: 768px) {
  .tobira-guide {
    bottom: var(--space-sm);
    left: var(--space-sm);
  }
}
