/* ============================================
   RCeラーニング - WordPress Plugin スタイル
   テーマ：深緑 + ゴールド / 高級感
   ============================================ */

/* リセット・基本設定（#rcel-app内のみ適用） */
#rcel-app * { box-sizing: border-box; }

#rcel-app {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
  color: #333;
  line-height: 1.7;
  background: #fafaf8;
}

/* ============================================
   SWELLテーマのコンテナ制限を解除（全画面表示）
   #rcel-app が存在するページは自動的に全画面化
   ============================================ */
:has(> #rcel-app),
body:has(#rcel-app) .l-mainContent,
body:has(#rcel-app) .l-mainContent__inner,
body:has(#rcel-app) .l-content,
body:has(#rcel-app) .l-container,
body:has(#rcel-app) main,
body:has(#rcel-app) #main,
body:has(#rcel-app) #content,
body:has(#rcel-app) .site-main,
body:has(#rcel-app) article,
body:has(#rcel-app) .post_content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #fafaf8 !important;
}

body:has(#rcel-app) .l-mainContent,
body:has(#rcel-app) main,
body:has(#rcel-app) #main {
  padding-top: 0 !important;
}

/* 念のため：#rcel-app自体を全画面幅で強制 */
#rcel-app {
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  padding: 0 !important;
}

/* サイドバー・関連投稿・パンくずなど不要な要素を非表示 */
body:has(#rcel-app) .l-sidebar,
body:has(#rcel-app) .c-pageTitle,
body:has(#rcel-app) .p-breadcrumb,
body:has(#rcel-app) .p-relatedPost,
body:has(#rcel-app) .p-articleThumb,
body:has(#rcel-app) .c-postTitle,
body:has(#rcel-app) .c-postMeta,
body:has(#rcel-app) .l-footPrl,
body:has(#rcel-app) .c-gotoTopBtn,
body:has(#rcel-app) .p-snsBtns,
body:has(#rcel-app) .p-spMenu,
body:has(#rcel-app) .c-fixBtnList,
body:has(#rcel-app) .p-postList,
body:has(#rcel-app) .l-articleFoot,
body:has(#rcel-app) .post-navigation {
  display: none !important;
}

/* WPテーマのフッター余白をリセット */
body:has(#rcel-app) .l-footer__inner { padding: 0 !important; }

/* ============================================
   リンク・ボタンの下線を全面OFF
   - text-decoration だけで済ませる（gradient壊さない）
   - ::after/::before の SWELL 下線アニメは個別にブロック
   ============================================ */
#rcel-app a,
#rcel-app a:hover,
#rcel-app a:focus,
#rcel-app a:active,
#rcel-app a:visited,
#rcel-app .btn,
#rcel-app .btn:hover,
#rcel-app .btn:focus,
#rcel-app button,
#rcel-app button:hover,
#rcel-app button:focus {
  text-decoration: none !important;
}
#rcel-app a { color: #1b4332; }
/* SWELL等が ::after/::before で下線アニメを引いてくる場合のブロック */
/* ただし hero-compass 等の擬似要素装飾は除外（背景や枠線として使ってる） */
#rcel-app .btn::before,
#rcel-app .btn::after,
#rcel-app a.btn::before,
#rcel-app a.btn::after,
#rcel-app .course-card::before,
#rcel-app .ebook-card::before,
#rcel-app .rec-card::before {
  display: none !important;
  content: none !important;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-content { padding-top: 40px; padding-bottom: 60px; min-height: calc(100vh - 200px); }
.page-title { font-size: 28px; margin-bottom: 30px; color: #1b4332; font-family: 'Noto Serif JP', 'Yu Mincho', serif; }
.page-subtitle { color: #888; margin-bottom: 30px; font-size: 14px; }

/* ============================================
   日本語改行コントロール
   - .br-pc : PC用<br>（スマホでは無効）
   - .br-sp : スマホ用<br>（PCでは無効）
   - 全体に word-break: keep-all を適用 → 日本語の単語が途中で分割されない
   - overflow-wrap: anywhere で例外的に長すぎる単語にだけブレークを許可
   - line-break: strict で句読点・記号の禁則処理
   - text-wrap: balance で行のバランスを最適化
   ============================================ */
.br-pc { display: inline; }
.br-sp { display: none; }   /* デフォルト（PC）では非表示 */

/* ▼ グローバルルール：rcel-app 配下の文章コンテンツすべてに適用 ▼
   日本語の単語（「人生」「設計」「教科書」等）が単独文字で改行されるのを防ぐ */
#rcel-app h1,
#rcel-app h2,
#rcel-app h3,
#rcel-app h4,
#rcel-app h5,
#rcel-app h6,
#rcel-app p,
#rcel-app li,
#rcel-app td,
#rcel-app th,
#rcel-app figcaption,
#rcel-app blockquote,
#rcel-app .card-title,
#rcel-app .card-body,
#rcel-app .feature-card,
#rcel-app .course-card,
#rcel-app .medal-card,
#rcel-app .rank-card,
#rcel-app .rec-card,
#rcel-app .completion-content,
#rcel-app .medal-modal-content {
  word-break: keep-all;       /* CJK単語の途中で改行しない */
  overflow-wrap: anywhere;    /* どうしても入らないときだけ折る（保険） */
  line-break: strict;         /* 句読点禁則を厳格適用 */
  text-wrap: pretty;          /* 末行ぼっちを防ぐ最新CSS */
}

/* hero/section の主要テキストは「視覚バランス重視」のbalanceで上書き */
.hero-compass h1,
.hero-compass p,
.hero h1,
.hero p,
.section-title,
.section-subtitle,
.feature-card h3,
.feature-card p {
  text-wrap: balance;
}

/* ============================================
   ナビゲーションバー（eラーニング独自）
   ============================================ */
.rcel-navbar {
  background: #0a1e11;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(201, 168, 76, 0.4);
}
.rcel-navbar .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}
/* ロゴだけ左寄せ、右側コンテナ（ベル＋ハンバーガー）を右寄せ */
.rcel-navbar .nav-right {
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
/* nav-right 内のbell-wrap、hamburgerは個別の margin-left を持たない */
.rcel-navbar .nav-right .rcel-bell-wrap { margin-left: 0; }
.rcel-navbar .nav-right .nav-hamburger { margin-left: 0 !important; }

/* ============================================
   PC用：eラーニング項目をインライン表示
   ============================================ */
.nav-elearning-inline {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-elearning-inline::-webkit-scrollbar { height: 0; display: none; }
.nav-elearning-inline a {
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  opacity: 0.95;
  white-space: nowrap;
  background-image: none !important;
  border-bottom: none !important;
  flex-shrink: 0;
}
.nav-elearning-inline a:hover,
.nav-elearning-inline a:focus,
.nav-elearning-inline a.active {
  color: #c9a84c !important;
  background: rgba(201, 168, 76, 0.15) !important;
  opacity: 1;
  background-image: none !important;
}
.nav-elearning-inline a::before,
.nav-elearning-inline a::after {
  display: none !important;
  content: none !important;
}

/* SP用エラーニング項目はデフォルト非表示（ハンバーガーパネル内のみ） */
.nav-elearning-sp { display: block; }

/* PC：ハンバーガーパネル内のeラーニング項目は非表示（インラインで表示済み） */
@media (min-width: 901px) {
  .nav-elearning-sp { display: none; }
}

/* SP：インライン項目は非表示、ハンバーガー内で表示 */
@media (max-width: 900px) {
  .nav-elearning-inline { display: none; }
  /* nav-rightを画面右端まで押す */
  .rcel-navbar .nav-right { margin-left: auto; }
}
.rcel-navbar .nav-logo {
  color: #f5f5f5;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 3px;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.6);
  display: inline-block;
  padding: 4px 2px;
  background: linear-gradient(135deg, #ffffff 0%, #e8eaf0 50%, #c8ccd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rcel-navbar .nav-logo span {
  background: linear-gradient(135deg, #ffffff 0%, #d0d4dc 50%, #a8aeba 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}
.rcel-navbar .nav-logo:hover { text-decoration: none; opacity: 0.9; }

/* ============================================
   ハンバーガーメニュー（全サイズで使用）
   ============================================ */
.rcel-navbar .nav-hamburger,
.nav-hamburger {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent !important;
  border: 1px solid rgba(201, 168, 76, 0.4) !important;
  border-radius: 8px !important;
  cursor: pointer;
  padding: 0 !important;
  transition: all 0.2s;
  position: relative;
  z-index: 1002;
  flex-shrink: 0;
}
.nav-hamburger:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: #c9a84c;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #c9a84c;
  margin: 0 auto;
  transition: all 0.3s;
  border-radius: 2px;
}
.nav-hamburger:hover span { background: #f0d68d; }

/* nav-links：ハンバーガークリックで右上から開くパネル */
.rcel-navbar .nav-links {
  display: none;
  position: fixed;
  top: 72px;
  right: 16px;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #0d2818, #1b4332);
  flex-direction: column;
  padding: 14px 12px;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  margin: 0;
}
.rcel-navbar .nav-links.open { display: flex; }

/* グループラベル（eラーニング / リアライズクラブ） */
.nav-group-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #c9a84c;
  font-weight: 700;
  padding: 8px 14px 4px;
  text-transform: uppercase;
  opacity: 0.85;
}

/* 区切り線 */
.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.4), transparent);
  margin: 10px 4px;
}

/* 利用規約・プライバシーポリシー（小さく控えめに） */
.nav-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 4px;
  flex-wrap: wrap;
}
.nav-legal-links a {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 11px !important;
  padding: 4px 6px !important;
  letter-spacing: 0 !important;
  background: transparent !important;
  border-radius: 4px;
  display: inline !important;
}
.nav-legal-links a:hover {
  color: #c9a84c !important;
  background: rgba(201, 168, 76, 0.1) !important;
  transform: none !important;
}
.nav-legal-sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
}
.nav-copyright {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  padding: 4px 0 6px;
  letter-spacing: 0.3px;
}

/* メニュー項目 */
.rcel-navbar .nav-links a {
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  opacity: 0.95;
  display: block;
  /* SWELLテーマの下線アニメーション無効化 */
  background-image: none !important;
  border-bottom: none !important;
}
.rcel-navbar .nav-links a:hover,
.rcel-navbar .nav-links a:focus,
.rcel-navbar .nav-links a.active {
  color: #c9a84c !important;
  background: rgba(201, 168, 76, 0.15);
  text-decoration: none !important;
  opacity: 1;
  background-image: none !important;
  border-bottom: none !important;
  transform: translateX(4px);
}
/* SWELL等が ::after/::before で下線を引いてくる場合の対策 */
.rcel-navbar .nav-links a::before,
.rcel-navbar .nav-links a::after {
  display: none !important;
  content: none !important;
}

/* スマホ向け：ハンバーガーボタンサイズ */
@media (max-width: 480px) {
  .nav-hamburger { width: 38px; height: 38px; }
  .nav-hamburger span { width: 20px; }
  .rcel-navbar .nav-links {
    right: 10px;
    top: 68px;
    width: calc(100vw - 20px);
  }
}

/* ============================================
   🔔 通知ベル（ナビ右側）
   ============================================ */
.rcel-bell-wrap {
  position: relative;
  margin-left: 8px;
  display: flex;
  align-items: center;
}
.rcel-bell-btn {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: #c9a84c;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  padding: 0;
}
.rcel-bell-btn:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: #c9a84c;
}
.rcel-bell-btn.has-unread svg { animation: rcelBellShake 1.6s ease-in-out infinite; }
@keyframes rcelBellShake {
  0%, 70%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(12deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(3deg); }
}
.rcel-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1b4332;
  line-height: 1;
}
.rcel-bell-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  background: #fff;
  border: 1px solid #e8e6e0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rcel-bell-head {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f8f7f4, #fff);
  border-bottom: 1px solid #e8e6e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #1b4332;
}
.rcel-bell-readall {
  background: transparent;
  border: none;
  color: #2d6a4f;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.rcel-bell-readall:hover { background: rgba(45, 106, 79, 0.08); }
.rcel-bell-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fafaf8;
}
.rcel-bell-empty {
  padding: 28px 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
}
.rcel-bell-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid #eee9e0;
  text-decoration: none !important;
  color: #1b4332;
  transition: background 0.15s;
  position: relative;
}
.rcel-bell-item:hover { background: #f0efe8; text-decoration: none !important; }
.rcel-bell-item.unread { background: #fffbf0; }
.rcel-bell-item.unread::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: #c9a84c;
  border-radius: 50%;
}
.rcel-bell-item-title { font-size: 13px; font-weight: 700; margin: 0 0 4px; padding-left: 10px; }
.rcel-bell-item-msg { font-size: 12px; color: #555; margin: 0 0 4px; padding-left: 10px; line-height: 1.5; }
.rcel-bell-item-time { font-size: 10px; color: #999; padding-left: 10px; }
@media (max-width: 768px) {
  /* nav-right 内なので margin-left:auto と order は不要（順番は HTML 通り：ベル→ハンバーガー） */
  .rcel-bell-wrap { margin-left: 0; margin-right: 0; order: 0; }
  .rcel-bell-panel { right: -10px; width: calc(100vw - 24px); }
  .rcel-bell-btn { width: 34px; height: 34px; }
  .rcel-bell-btn svg { width: 18px; height: 18px; }
}

/* ============================================
   ボタン
   ============================================ */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #1b4332, #2d6a4f); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #0d2818, #1b4332); color: #fff; }
.btn-gold {
  background: linear-gradient(135deg, #c9a84c, #d4b96e);
  color: #1b4332;
  font-weight: 700;
}
.btn-gold:hover { background: linear-gradient(135deg, #b8973e, #c9a84c); color: #0d2818; }
.btn-large { padding: 14px 36px; font-size: 17px; }
.btn-full { width: 100%; }

/* ============================================
   ヒーローセクション
   ============================================ */
.hero {
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-content { max-width: 700px; margin: 0 auto; position: relative; z-index: 2; }
.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.5;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  letter-spacing: 3px;
}
.hero p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 36px;
  line-height: 1.9;
}

/* 羅針盤を手にした不死鳥ヒーロー */
.hero-compass {
  background:
    linear-gradient(180deg, rgba(13,40,24,0.82) 0%, rgba(13,40,24,0.7) 35%, rgba(13,40,24,0.75) 65%, rgba(13,40,24,0.9) 100%),
    url('../images/phoenix-compass.webp') center 30% / cover no-repeat;
  background-color: #0d2818;
  padding: 140px 20px 120px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
@media (max-width: 768px) {
  .hero-compass {
    background-size: 180% auto;
    background-position: center 15%;
  }
}
.hero-compass::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 700px; height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 50%, rgba(255,223,130,0.15) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.hero-compass::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(201,168,76,0.6) 50%, transparent 90%);
  z-index: 2;
}
.hero-compass > * { position: relative; z-index: 3; }
.hero-eyecatch {
  font-size: 13px;
  letter-spacing: 8px;
  background: linear-gradient(135deg, #ffd580 0%, #c9a84c 50%, #ffd580 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  font-weight: 700;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  display: inline-block;
  padding: 8px 24px;
  position: relative;
}
.hero-eyecatch::before,
.hero-eyecatch::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.7));
}
.hero-eyecatch::before {
  right: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.7));
}
.hero-eyecatch::after {
  left: 100%;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.7), transparent);
}
.hero-gold-line {
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a84c, transparent);
  margin: 0 auto 32px;
}
.hero-compass h1 {
  font-size: 48px;
  background: linear-gradient(135deg, #ffffff 0%, #fff5e1 40%, #ffd580 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 6px;
  margin-bottom: 32px;
  font-weight: 700;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 30px rgba(201, 168, 76, 0.25));
  line-height: 1.5;
}
.hero-compass p {
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  line-height: 2.2;
  margin-bottom: 40px;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  max-width: 560px;
  position: relative;
  padding: 0 20px;
  /* 明朝体 */
  font-family: 'Noto Serif JP', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', serif;
  font-weight: 400;
}
.hero-compass p::before,
.hero-compass p::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.5), transparent);
}
.hero-compass p::before { top: -14px; }
.hero-compass p::after { bottom: -20px; }
.hero-sub {
  font-size: 15px;
  opacity: 0.7;
  line-height: 2;
  margin-bottom: 40px;
  letter-spacing: 1px;
}

/* ============================================
   特徴セクション
   ============================================ */
.features { padding: 80px 20px; background: #fff; }
.section { padding: 80px 20px; background: #fff; }
.section-title {
  text-align: center;
  font-size: 26px;
  margin-bottom: 16px;
  color: #1b4332;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  letter-spacing: 1px;
}
.section-subtitle {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 50px;
}
.section-line {
  width: 50px;
  height: 2px;
  background: #c9a84c;
  margin: 0 auto 20px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: #fafaf8;
  padding: 40px 30px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.2s;
  border: 1px solid rgba(201, 168, 76, 0.15);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 12px; color: #1b4332; }
.feature-card p { font-size: 14px; color: #666; line-height: 1.8; }

/* ============================================
   コース一覧
   ============================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.category-tab {
  padding: 8px 20px;
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
  font-family: inherit;
}
.category-tab:hover { border-color: #1b4332; color: #1b4332; }
.category-tab.active { background: #1b4332; color: #fff; border-color: #1b4332; }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.course-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid rgba(0,0,0,0.04);
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  border-color: rgba(201, 168, 76, 0.3);
}
.course-card-thumbnail {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #1b4332;
  position: relative;
  overflow: hidden;
}
.course-card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* lazy読込中の白チラつきを抑える */
  background: #1b4332;
}
.course-card-overlay {
  /* 旧仕様：サムネ上にバッジを重ねていた。現在は使用しないが互換のため残す */
  display: none;
}
.course-card-badge-row {
  margin-bottom: 8px;
}
.course-card-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.course-card-thumbnail::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #c9a84c, transparent);
}
.course-card:hover .course-card-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.05) 100%);
}
.course-card-body { padding: 20px; }
.course-card-body h3 {
  font-size: 17px;
  margin-bottom: 10px;
  color: #1b4332;
  line-height: 1.5;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  font-weight: 600;
}
.course-card-body p {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #666;
}
.course-card-meta span { display: flex; align-items: center; gap: 4px; }

/* 称号バナー */
.rank-banner {
  background: linear-gradient(135deg, #0d2818, #1b4332);
  color: #fff;
  padding: 18px 24px;
  border-radius: 14px;
  margin-bottom: 28px;
  /* Grid に変更：左=内容サイズ / 右=残り全部 を確実に分配 */
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 24px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}
.rank-banner::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: rgba(201, 168, 76, 0.08);
  border-radius: 50%;
  pointer-events: none;
}
.rank-banner-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.rank-banner-emoji { font-size: 40px; }
.rank-banner-info { display: flex; flex-direction: column; }
.rank-banner-name { font-size: 13px; opacity: 0.75; }
.rank-banner-title {
  font-size: 17px;
  font-weight: 700;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  letter-spacing: 0.5px;
}
/* 右側：Grid 1fr で確定済み。中身を確実に横いっぱい広げる */
.rank-banner-right {
  display: flex !important;
  align-items: center;
  gap: 16px;
  min-width: 0 !important;
  width: 100% !important;
  justify-self: stretch;     /* グリッドセル内で横いっぱいに */
}
.rank-banner-progress {
  display: flex !important;
  align-items: center;
  gap: 12px;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 100% !important;
}
.rank-banner-bar {
  flex: 1 1 0% !important;
  width: 100% !important;
  min-width: 200px;
  height: 14px !important;
  background: rgba(255,255,255,0.22) !important;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
  display: block !important;
}
.rank-banner-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #c9a84c, #e8d48b) !important;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.5);
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block !important;
}
.rank-banner-pct {
  font-size: 16px;
  font-weight: 700;
  color: #c9a84c;
  flex-shrink: 0;
  min-width: 42px;
  text-align: right;
}
.rank-banner-medals { display: flex; gap: 4px; flex-shrink: 0; }
.rank-banner-medal { font-size: 22px; }

/* 最終形態：羅針盤を手にした不死鳥 */
.rank-banner-final {
  background: linear-gradient(135deg, #1a0a00 0%, #3d1a00 35%, #1a0a00 100%);
  box-shadow: 0 8px 40px rgba(255, 107, 0, 0.3), 0 0 0 1px rgba(255, 180, 80, 0.3);
  padding: 22px 28px;
}
.rank-banner-final::before {
  background: radial-gradient(circle, rgba(255, 140, 40, 0.25) 0%, transparent 70%);
  top: -30px; right: -30px;
  width: 160px; height: 160px;
  animation: phoenixGlow 3s ease-in-out infinite;
}
@keyframes phoenixGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.rank-banner-phoenix {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}
.rank-banner-phoenix-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffb450;
  box-shadow: 0 0 20px rgba(255, 140, 40, 0.6), 0 4px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.rank-banner-title-phoenix {
  background: linear-gradient(135deg, #ffd580 0%, #ffb450 50%, #ff8c28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: 17px !important;
  font-weight: 900 !important;
  letter-spacing: 1px;
  text-shadow: none;
}
.rank-banner-final .rank-banner-pct {
  color: #ffb450;
}
.rank-banner-final .rank-banner-fill {
  background: linear-gradient(90deg, #ff8c28, #ffd580);
}

/* ============================================
   コース詳細ページ
   ============================================ */
.course-back-bar {
  margin-bottom: 14px;
}
.course-back-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 20px;
  color: #1b4332 !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.course-back-link:hover {
  background: #1b4332;
  color: #fff !important;
  border-color: #1b4332;
  transform: translateX(-2px);
  box-shadow: 0 2px 8px rgba(27,67,50,0.2);
  text-decoration: none !important;
}
.course-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}
.video-player-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0d2818, #1b4332);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}
.video-active { width: 100%; background: #000; display: block; }
.video-player-wrapper video { width: 100%; display: block; }
.video-player-wrapper iframe { width: 100%; aspect-ratio: 16 / 9; border: none; display: block; }
.course-info-section h1 {
  font-size: 24px;
  margin-bottom: 12px;
  color: #1b4332;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
}
.course-info-section p { color: #666; margin-bottom: 16px; }

/* サイドバー */
.course-sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: sticky;
  top: 84px;
  border: 1px solid rgba(0,0,0,0.04);
}
.sidebar-header { padding: 20px; border-bottom: 1px solid #eee; }
.sidebar-header h2, .sidebar-header h3 { font-size: 16px; margin-bottom: 12px; color: #1b4332; }
.progress-summary { display: flex; align-items: center; gap: 12px; }
.progress-bar-container {
  flex: 1; height: 8px;
  background: #e8e6e0;
  border-radius: 4px;
  overflow: hidden;
}
.overall-progress { display: flex; align-items: center; gap: 12px; }
.progress-bar {
  flex: 1; height: 8px;
  background: #e8e6e0;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1b4332, #c9a84c);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text { font-size: 12px; color: #888; white-space: nowrap; }
.step-list { list-style: none; max-height: 500px; overflow-y: auto; padding: 0; margin: 0; }
.step-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  font-size: 14px;
  user-select: none;
}
.step-item:hover {
  background: #f0f5f2;
  transform: translateX(2px);
  box-shadow: inset 3px 0 0 #c9a84c;
}
.step-item:hover .step-check {
  border-color: #1b4332;
  color: #1b4332;
  background: #f0f5f2;
}
.step-item:hover .step-title {
  color: #1b4332;
}
.step-item:active {
  transform: translateX(1px) scale(0.99);
}
.step-item.active {
  background: #f0f5f2;
  border-left: 3px solid #1b4332;
}
.step-item.active .step-check {
  border-color: #1b4332;
  color: #1b4332;
}
.step-item.completed .step-check {
  background: #1b4332;
  color: #fff;
  border-color: #1b4332;
}
.step-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #c9a84c;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: #888;
  background: #fff;
  transition: all 0.2s;
}
.step-info { flex: 1; }
.step-info .step-title { font-weight: 500; color: #333; }
.step-info .step-duration { font-size: 12px; color: #999; }
.step-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.step-pct {
  font-size: 11px; font-weight: 600; color: #1b4332;
  background: #e8f5e9; padding: 1px 6px; border-radius: 8px;
}
.step-pct.done { background: #1b4332; color: #fff; }
.step-progress-bar {
  width: 100%; height: 3px;
  background: #e8e6e0; border-radius: 2px;
  margin-top: 4px; overflow: hidden;
}
.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1b4332, #c9a84c);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ============================================
   フォーム
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #444; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1b4332;
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1);
}
.form-group textarea { resize: vertical; }
.required { color: #dc2626; }
.error-message {
  background: #fef2f2; color: #dc2626;
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 20px; font-size: 14px;
  border: 1px solid #fecaca;
}
.success-message {
  background: #f0fdf4; color: #16a34a;
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 20px; font-size: 14px;
  border: 1px solid #bbf7d0;
}

/* ============================================
   お問い合わせページ
   ============================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}
.contact-info-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0,0,0,0.04);
}
.contact-info-card h3 { font-size: 18px; margin-bottom: 16px; color: #1b4332; }
.contact-info-card p { font-size: 14px; color: #555; margin-bottom: 8px; }

/* ============================================
   マイページ
   ============================================ */
.mypage-header {
  background: linear-gradient(135deg, #0d2818, #1b4332);
  color: #fff;
  padding: 40px;
  border-radius: 16px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}
.mypage-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(201, 168, 76, 0.1);
  border-radius: 50%;
}
.mypage-user-info { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.mypage-rank { font-size: 48px; }
.mypage-user-info h1 { font-size: 20px; font-weight: 600; font-family: 'Noto Serif JP', 'Yu Mincho', serif; margin: 0; }
.mypage-rank-title { font-size: 14px; opacity: 0.8; margin: 0; }
.mypage-overall { display: flex; align-items: center; gap: 12px; }
.progress-bar-large { flex: 1; height: 10px; background: rgba(255,255,255,0.15); border-radius: 5px; overflow: hidden; }
.progress-bar-large .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e8d48b);
  border-radius: 5px;
}
.mypage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}
.stat-number { font-size: 32px; font-weight: 700; color: #1b4332; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }
.mypage-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}
/* 旧 medal-card 定義は削除（下の透明版を使用） */
.course-progress-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
}
.course-progress-card h3 { font-size: 15px; color: #1b4332; margin-bottom: 8px; }

/* ============================================
   称号コレクション
   ============================================ */
.rank-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.rank-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 14px 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.rank-card.earned {
  border-color: rgba(201, 168, 76, 0.3);
}
.rank-card.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.15);
}
.rank-card-visual {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaf8;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(201, 168, 76, 0.2);
}
.rank-card-emoji {
  font-size: 34px;
  line-height: 1;
}
.rank-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1b4332;
  line-height: 1.5;
  margin-bottom: 6px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
  /* 日本語の単語の途中で割らない */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
  text-wrap: pretty;
}
.rank-card-min {
  font-size: 11px;
  color: #888;
  font-weight: 600;
}

/* 未獲得：完全に隠蔽（中身がわからないように） */
.rank-card.locked {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.rank-card.locked .rank-card-visual {
  background: #000;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
  position: relative;
}
.rank-card.locked .rank-card-visual > * {
  visibility: hidden;
}
.rank-card.locked .rank-card-visual::before {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.18);
  font-size: 28px;
  font-weight: 900;
}
.rank-card.locked .rank-card-title {
  color: transparent;
  text-shadow: 0 0 10px rgba(255,255,255,0.15);
  filter: blur(6px);
  user-select: none;
}
.rank-card.locked .rank-card-min {
  color: rgba(255,255,255,0.3);
}

/* 次に獲得できる称号：NEXT ラベル + わくわく感（中身はシルエットで隠す） */
.rank-card.next {
  background: linear-gradient(135deg, #1f1a08 0%, #0f0f0f 60%, #1f1a08 100%);
  border: 2px solid #c9a84c;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.35), 0 4px 16px rgba(0,0,0,0.2);
  animation: rankNextPulse 2.5s ease-in-out infinite;
}
@keyframes rankNextPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.35), 0 4px 16px rgba(0,0,0,0.2); }
  50% { box-shadow: 0 0 30px rgba(201, 168, 76, 0.55), 0 4px 20px rgba(0,0,0,0.3); }
}
.rank-card.next .rank-card-visual {
  background: #000;
  box-shadow: inset 0 0 0 2px rgba(201, 168, 76, 0.5);
  position: relative;
}
.rank-card.next .rank-card-visual > * {
  visibility: hidden;
}
.rank-card.next .rank-card-visual::before {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(201, 168, 76, 0.35);
  font-size: 28px;
  font-weight: 900;
}
.rank-card.next .rank-card-title {
  color: transparent;
  text-shadow: 0 0 14px rgba(201, 168, 76, 0.3);
  filter: blur(6px);
  user-select: none;
}
.rank-card.next .rank-card-min {
  color: rgba(201, 168, 76, 0.55);
}
.rank-card-next-label {
  position: absolute;
  top: -10px;
  right: -4px;
  background: linear-gradient(135deg, #c9a84c, #d4b96e);
  color: #1b4332;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 14px;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.5);
  transform: rotate(8deg);
}

/* 最終形態（不死鳥）の特別エフェクト */
.rank-card.earned.phoenix {
  background: linear-gradient(135deg, #1a0a00 0%, #3d1a00 50%, #1a0a00 100%);
  border-color: #ffb450;
  box-shadow: 0 0 24px rgba(255, 140, 40, 0.4), 0 4px 16px rgba(0,0,0,0.3);
}
.rank-card.earned.phoenix .rank-card-visual {
  background: transparent;
  box-shadow: inset 0 0 0 2px #ffb450, 0 0 16px rgba(255, 140, 40, 0.6);
}
.rank-card.earned.phoenix .rank-card-title {
  background: linear-gradient(135deg, #ffd580, #ff8c28);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.rank-card.earned.phoenix .rank-card-min {
  color: #ffb450;
}

/* ============================================
   メダルカード（マイページ）
   背景透過のメダル画像をそのまま大きく見せる、シンプル＆クリーン版
   ============================================ */
.mypage-medals {
  display: grid;
  /* PCで横3〜4列くらい並ぶサイズ感 */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}
.medal-card {
  /* 枠・背景・影を完全に排除：メダル画像そのものを主役に */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}
.medal-card:hover {
  transform: translateY(-6px) scale(1.03);
}
.medal-card-visual {
  /* 円や黒背景なし、画像のままの形を尊重 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto 18px;
  background: transparent;
  position: relative;
  /* 透過メダルにふんわりグロウ（より強調） */
  filter: drop-shadow(0 6px 22px rgba(201, 168, 76, 0.35));
  transition: filter 0.3s, transform 0.3s;
}
.medal-card:hover .medal-card-visual {
  filter: drop-shadow(0 10px 32px rgba(201, 168, 76, 0.6));
}
.medal-card-img {
  width: 100%;
  /* 元220→320でデカすぎ→200にバランス調整 */
  max-width: 200px;
  height: auto;
  display: block;
  /* aspect自然のまま */
}
.medal-card-emoji {
  font-size: 100px;
  line-height: 1;
}
.medal-card-title {
  color: #1b4332;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  line-height: 1.6;
  padding: 0 4px;
  /* 日本語の単語の途中で割らない */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
  text-wrap: balance;
}
.medal-card-course-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.medal-card-completion {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(27, 67, 50, 0.7);
  letter-spacing: 1px;
}

/* ============================================
   メダル獲得モーダル（コース完走時）
   ============================================ */
.medal-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(13, 40, 24, 0.85) 0%, rgba(0, 0, 0, 0.92) 100%);
  backdrop-filter: blur(6px);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: medalModalFade 0.4s ease-out;
}
@keyframes medalModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.medal-modal-content {
  background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 2px solid rgba(201, 168, 76, 0.6);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(201, 168, 76, 0.25), 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  animation: medalModalPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes medalModalPop {
  0% { transform: scale(0.8) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.medal-modal-sparkles {
  font-size: 32px;
  letter-spacing: 20px;
  margin-bottom: 8px;
  animation: sparkleBob 2s ease-in-out infinite;
}
@keyframes sparkleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.medal-modal-title {
  color: #e8d48b;
  font-size: 26px;
  font-weight: 800;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  letter-spacing: 2px;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(201, 168, 76, 0.4);
}
.medal-modal-image-wrap {
  /* 透過メダル画像をそのまま大きく見せる */
  width: 100%;
  max-width: 280px;
  margin: 0 auto 20px;
  background: transparent;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.5));
  animation: medalGlow 3s ease-in-out infinite;
}
@keyframes medalGlow {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.45)); }
  50% { filter: drop-shadow(0 0 50px rgba(201, 168, 76, 0.85)); }
}
.medal-modal-image {
  width: 100%;
  height: auto;
  display: block;
}
.medal-modal-course {
  color: #e8d48b;
  font-size: 17px;
  font-weight: 700;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  margin-bottom: 14px;
}
.medal-modal-message {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 26px;
}
.medal-modal-close {
  background: linear-gradient(135deg, #c9a84c, #e8d48b) !important;
  color: #1a1a1a !important;
  font-weight: 700 !important;
  padding: 12px 40px !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 1px;
  transition: transform 0.2s;
}
.medal-modal-close:hover {
  transform: scale(1.05);
}

/* スマホ対応 */
@media (max-width: 480px) {
  .medal-modal-content { padding: 30px 20px; }
  .medal-modal-title { font-size: 20px; letter-spacing: 1px; }
  .medal-modal-image-wrap { max-width: 220px; }
  .medal-modal-course { font-size: 15px; }
  .medal-modal-message { font-size: 13px; }
  .mypage-medals { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .medal-card-img { max-width: 160px; }
  .medal-card-emoji { font-size: 80px; }
}

/* ============================================
   おすすめセクション（コース詳細ページ下部）
   ============================================ */
.rec-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #e8e6e0;
}
.rec-section-title {
  font-size: 20px;
  color: #1b4332;
  margin-bottom: 20px;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
}
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.rec-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-decoration: none !important;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(0,0,0,0.04);
}
.rec-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
  border-color: rgba(201, 168, 76, 0.3);
}
.rec-card-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  background: #1b4332;
  overflow: hidden;
}
.rec-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rec-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.rec-card-body { padding: 14px 16px 16px; }
.rec-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1b4332;
  margin-bottom: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-card-course {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   完了モーダル：おすすめミニカード + ボタン群
   ============================================ */
.completion-rec {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.completion-rec-label {
  font-size: 12px;
  color: #888;
  margin: 0 0 10px;
  letter-spacing: 0.5px;
}
.completion-rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8f7f4;
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.completion-rec-card:hover {
  background: #fff;
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.completion-rec-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 55px;
  border-radius: 6px;
  overflow: hidden;
  background: #1b4332;
}
.completion-rec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.completion-rec-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.completion-rec-title {
  font-size: 13px;
  font-weight: 700;
  color: #1b4332;
  line-height: 1.4;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.completion-rec-course {
  font-size: 11px;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.completion-buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.completion-next-btn {
  background: linear-gradient(135deg, #1b4332, #2d6a4f) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.completion-next-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(27, 67, 50, 0.3);
}

@media (max-width: 480px) {
  .rec-section-title { font-size: 17px; }
  .rec-grid { grid-template-columns: 1fr; gap: 12px; }
  .completion-rec-thumb { width: 64px; height: 44px; }
  .completion-next-btn { padding: 11px 18px !important; font-size: 14px !important; }
}

/* ============================================
   電子書籍 一覧
   ============================================ */
.ebooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}
.ebook-card {
  position: relative;
  display: block;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-decoration: none !important;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(0,0,0,0.04);
}
.ebook-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.12);
  border-color: rgba(201, 168, 76, 0.35);
}
.ebook-card.is-read { opacity: 0.95; }
.ebook-card-thumb {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1b4332, #0d2818);
  overflow: hidden;
}
.ebook-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ebook-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: rgba(201, 168, 76, 0.7);
}
.ebook-card-read-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #c9a84c, #e8d48b);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.ebook-card-body { padding: 16px 18px 20px; }
.ebook-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1b4332;
  margin-bottom: 6px;
  line-height: 1.5;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
}
.ebook-card-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ebook-card-overlay-disabled {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  pointer-events: none;
}
@media (max-width: 480px) {
  .ebooks-grid { grid-template-columns: 1fr; gap: 16px; }
  .ebook-card-thumb { height: 160px; }
}

/* ============================================
   利用規約・プライバシーポリシー
   ============================================ */
.legal-content {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-width: 800px;
  margin: 0 auto;
}
.legal-content h2 {
  font-size: 20px;
  color: #1b4332;
  margin-top: 30px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e6e0;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { font-size: 14px; color: #555; margin-bottom: 12px; line-height: 1.9; }
.legal-date { font-size: 13px; color: #888; margin-bottom: 20px; }

/* ============================================
   フッター（eラーニング独自）
   ============================================ */
.rcel-footer {
  background: linear-gradient(135deg, #0d2818, #1b4332);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px 20px;
  border-top: 1px solid rgba(201, 168, 76, 0.3);
}
.rcel-footer .footer-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 30px;
}
.rcel-footer .footer-logo {
  color: #fff;
  font-size: 18px;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.rcel-footer .footer-logo span { color: #c9a84c; }
.rcel-footer .footer-links { display: flex; gap: 20px; }
.rcel-footer .footer-links a { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.rcel-footer .footer-links a:hover { color: #c9a84c; text-decoration: none; }
.rcel-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* ============================================
   完了モーダル
   ============================================ */
.completion-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,40,24,0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.completion-modal[style*="flex"] { display: flex; }
.completion-content {
  background: #fff;
  border-radius: 18px;
  padding: 0 26px 22px;
  max-width: 360px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  position: relative;
  animation: completionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes completionPop {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ミオ先生 画像フレーム（上半身だけ見せる） */
.completion-mio-frame {
  width: calc(100% + 52px);
  margin: 0 -26px 0;
  height: 180px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #e8f5e9 0%, #f0f5f2 100%);
}
.completion-mio-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
  margin-top: 0;
}
.completion-mio-frame::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background: linear-gradient(transparent, #fff);
  pointer-events: none;
}

.completion-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1b4332;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
  margin: 14px 0 6px;
  letter-spacing: 1px;
}
.completion-step {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}
.completion-step:empty { display: none; }
.completion-msg {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 18px;
}
.completion-content .btn {
  padding: 12px 36px;
  border-radius: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
}
/* メインボタン（次のステップ・次のコース）：緑 */
.completion-content .btn-primary {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(27,67,50,0.3);
}
.completion-content .btn-primary:hover {
  background: linear-gradient(135deg, #0d2818, #1b4332);
  transform: translateY(-1px);
}
/* 閉じるボタン：見分けがつくよう薄グレー */
.completion-content .btn-secondary {
  background: #f0ede6;
  color: #555 !important;
  box-shadow: none;
}
.completion-content .btn-secondary:hover {
  background: #e0ddd5;
  color: #1b4332 !important;
}

/* スマホ最適化：見切れ・つぶれ防止 */
@media (max-width: 480px) {
  .completion-content {
    max-width: 90%;
    padding: 0 20px 18px;
    border-radius: 16px;
  }
  .completion-mio-frame {
    height: 150px;
    width: calc(100% + 40px);
    margin: 0 -20px 0;
  }
  .completion-content h2 {
    font-size: 17px;
    margin: 12px 0 6px;
  }
  .completion-step { font-size: 11px; }
  .completion-msg {
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 14px;
  }
  .completion-content .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  .completion-buttons { gap: 6px; margin-top: 14px; }
}

/* （古い .nav-hamburger 定義は削除。新しい定義は line 217 付近 / ナビセクション内） */

/* ============================================
   レスポンシブ - タブレット
   ============================================ */
@media (max-width: 1024px) {
  .course-detail-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}

/* ============================================
   レスポンシブ - スマートフォン
   ============================================ */
@media (max-width: 768px) {
  /* PC用 <br> はスマホで無効化（自動折り返しに任せる） */
  .br-pc { display: none !important; }
  /* スマホ用 <br> をここで有効化 */
  .br-sp { display: inline !important; }

  /* ヒーロー本文：明朝体＋スマホで一回り小さく */
  .hero-compass p {
    font-size: 13px;
    line-height: 2;
    letter-spacing: 0.8px;
    padding: 0 16px;
    /* SP改行を尊重するため balance は外す（指定改行が崩れる対策） */
    text-wrap: wrap;
  }

  /* ナビ：全サイズでハンバーガーメニューを使用（メイン定義参照） */
  .container { padding: 0 16px; }
  .page-content { padding-top: 24px; padding-bottom: 40px; }
  .page-title { font-size: 22px; margin-bottom: 20px; }
  .hero { padding: 50px 20px; }
  .hero-compass { padding: 80px 20px 60px; min-height: 400px; }
  .hero-compass h1 { font-size: 28px; letter-spacing: 2px; }
  .hero-eyecatch { font-size: 11px; letter-spacing: 4px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .courses-grid { grid-template-columns: 1fr; }
  .course-detail-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .rcel-footer .footer-content { flex-direction: column; gap: 20px; }
  .rcel-footer .footer-links { flex-direction: column; gap: 8px; }
  .form-group input, .form-group textarea, .form-group select {
    padding: 12px 14px; font-size: 16px;
  }
  .btn { padding: 12px 24px; font-size: 15px; }
  .section-title { font-size: 22px; }
  .feature-card { padding: 20px; }
  .course-sidebar { max-height: none; overflow-y: visible; position: static; }
  .mypage-header { padding: 24px; }
  .mypage-rank { font-size: 36px; }
  .legal-content { padding: 24px; }
  /* スマホ：Grid を 1列に変更して縦積み（バーのはみ出し防止） */
  .rank-banner {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 16px 18px;
  }
  .rank-banner-left { width: 100%; }
  .rank-banner-right {
    width: 100% !important;
    min-width: 0 !important;
  }
  .rank-banner-progress {
    width: 100% !important;
    min-width: 0 !important;
  }
  .rank-banner-bar {
    flex: 1 1 0% !important;
    width: 100% !important;
    min-width: 0 !important;  /* スマホでは200px下限を解除（はみ出し防止） */
  }
  .rank-banner-pct { font-size: 14px; min-width: 36px; }
}

@media (max-width: 480px) {
  .rcel-navbar .nav-logo { font-size: 16px !important; letter-spacing: 1px !important; }
  .page-title { font-size: 20px; }
  .hero h1 { font-size: 20px; }
  .hero-compass h1 { font-size: 22px; }
  .hero-compass { padding: 60px 16px 50px; min-height: 350px; }
  .category-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
  .category-tab { white-space: nowrap; flex-shrink: 0; }
  .course-sidebar { max-height: none; }
  .step-item { padding: 10px 12px; font-size: 13px; }
  .mypage-stats { grid-template-columns: 1fr; }
  .mypage-medals { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   🌿 全体UI仕上げ：レスポンシブ統一・タッチ最適化・読みやすさ
   ============================================ */

/* 横スクロール防止（iOS Safari/Androidで意図しない横スクロール対策） */
html, body { overflow-x: hidden; }
body.rcel-page { overflow-x: hidden; }

/* タップ時のハイライト色を統一（青いフラッシュを抑える） */
.rcel-page a, .rcel-page button, .rcel-page .btn,
.rcel-page .step-item, .rcel-page .course-card, .rcel-page .accordion-header {
  -webkit-tap-highlight-color: rgba(27, 67, 50, 0.1);
}

/* 画像オーバーフロー防止（テンプレ崩れ対策の保険） */
.rcel-page img { max-width: 100%; height: auto; }

/* テーブルはスマホで横スクロール可能に（管理画面以外も） */
.rcel-page .table-responsive,
.rcel-page table.responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

/* iOSズーム防止：input/textarea のフォントサイズは 16px 以上 */
@media (max-width: 768px) {
  .rcel-page input[type="text"],
  .rcel-page input[type="email"],
  .rcel-page input[type="password"],
  .rcel-page input[type="tel"],
  .rcel-page input[type="url"],
  .rcel-page input[type="search"],
  .rcel-page input[type="number"],
  .rcel-page textarea,
  .rcel-page select {
    font-size: 16px !important;
  }
}

/* タッチターゲット最低44px確保（Apple HIG基準） */
@media (max-width: 768px) {
  .rcel-page .btn,
  .rcel-page button:not(.nav-hamburger):not(.chatbot-toggle):not(.chatbot-send):not(.rcel-bell-btn) {
    min-height: 44px;
  }
  .rcel-page .step-item { min-height: 48px; }
}

/* ============================================
   📱 スマホ向けスペース・タイポグラフィ調整
   ============================================ */
@media (max-width: 768px) {
  /* 全体のページ余白を均一に */
  .rcel-page .container { padding-left: 14px; padding-right: 14px; }
  .rcel-page .page-content { padding-top: 18px; padding-bottom: 32px; }

  /* セクションタイトル：行間少しゆとり */
  .rcel-page .section-title { line-height: 1.45; margin-bottom: 16px; }

  /* コースカードのサムネ：少し低めに */
  .rcel-page .course-card-thumbnail { aspect-ratio: 16/9; }
  .rcel-page .course-card-body { padding: 14px 16px; }
  .rcel-page .course-card-body h3 { font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
  .rcel-page .course-card-body p { font-size: 12px; line-height: 1.6; margin-bottom: 10px; }
  .rcel-page .course-card-meta { font-size: 11px; }

  /* マイページ関連：見やすさ調整 */
  .rcel-page .mypage-header h1 { font-size: 22px; line-height: 1.4; }
  .rcel-page .mypage-stats { gap: 10px; }
  .rcel-page .mypage-stats .stat-card { padding: 14px; }
  .rcel-page .mypage-medals { gap: 16px; }

  /* コース詳細：戻るボタンとサイドバー */
  .rcel-page .course-back-link { padding: 9px 14px; font-size: 13px; min-height: 40px; }
  .rcel-page .step-list { padding: 10px; }
  .rcel-page .sidebar-header { padding: 12px 14px; }
  .rcel-page .sidebar-header h3 { font-size: 14px; }

  /* 完了モーダル：内側余白少なく */
  .rcel-page .completion-content { padding: 20px 18px; }
  .rcel-page .completion-content h2 { font-size: 18px; }
  .rcel-page .completion-step { font-size: 13px; }
  .rcel-page .completion-msg { font-size: 13px; line-height: 1.7; }

  /* メダル獲得モーダル */
  .rcel-page .medal-modal-content { padding: 24px 18px; max-width: calc(100vw - 32px); }
  .rcel-page .medal-modal-title { font-size: 18px; line-height: 1.4; }
  .rcel-page .medal-modal-image { max-width: 200px; }

  /* 電子書籍カード */
  .rcel-page .ebook-card { padding: 14px; }
  .rcel-page .ebook-card-title { font-size: 14px; line-height: 1.5; }
  .rcel-page .ebook-card-desc { font-size: 12px; }

  /* お問い合わせフォーム：ラベル＆余白 */
  .rcel-page .contact-form .form-group label { font-size: 13px; }
  .rcel-page .contact-form .form-group { margin-bottom: 14px; }

  /* おすすめセクション */
  .rcel-page .rec-section-title { font-size: 17px; line-height: 1.4; }
  .rcel-page .rec-grid { gap: 12px; }
  .rcel-page .rec-card { padding: 12px; }
  .rcel-page .rec-card-title { font-size: 13px; line-height: 1.5; }

  /* クイズページ：選択肢を押しやすく */
  .rcel-page .quiz-option { padding: 14px 16px !important; font-size: 14px !important; min-height: 56px; }

  /* 動画コンテナの上の余白縮小（戻るボタンと近づける） */
  .rcel-page .course-back-bar { margin-bottom: 10px; }
}

/* ============================================
   📲 SP超小画面（iPhone SE等 320〜375px）特別対応
   ============================================ */
@media (max-width: 380px) {
  .rcel-page .container { padding-left: 12px; padding-right: 12px; }
  .rcel-page .page-content { padding-top: 16px; padding-bottom: 28px; }
  .rcel-page .hero-compass h1 { font-size: 20px; letter-spacing: 1.5px; }
  .rcel-page .hero-compass { padding: 50px 14px 40px; min-height: 320px; }
  .rcel-page .course-card-body { padding: 12px 14px; }
  .rcel-page .course-card-body h3 { font-size: 14px; }
  .rcel-page .mypage-header { padding: 18px; }
  .rcel-page .mypage-rank { font-size: 28px; }
  .rcel-page .medal-modal-image { max-width: 160px; }
  .rcel-page .medal-card-img { max-width: 140px; }
  .rcel-page .step-item { padding: 9px 11px; font-size: 12.5px; }
  .rcel-page .legal-content { padding: 18px; font-size: 13px; line-height: 1.8; }
}

/* ============================================
   💻 中間サイズ（タブレット縦・横〜狭めPC）対応
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .rcel-page .container { padding-left: 24px; padding-right: 24px; }
  .rcel-page .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .rcel-page .mypage-medals { grid-template-columns: repeat(3, 1fr); }
  /* コース詳細：サイドバーが下に回ってもOKなレイアウト */
  .rcel-page .course-detail-layout { gap: 24px; }
}

/* ============================================
   🌐 PC〜ワイド画面の最大幅キャップ
   ============================================ */
@media (min-width: 1400px) {
  .rcel-page .container { max-width: 1280px; }
}

/* ============================================
   🎯 アクセシビリティ：キーボード操作のフォーカス枠
   ============================================ */
.rcel-page button:focus-visible,
.rcel-page a:focus-visible,
.rcel-page .step-item:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 2px;
}

/* ============================================
   🌙 動きを減らすユーザー設定への対応
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .rcel-page *, .rcel-page *::before, .rcel-page *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================
   📱 ホーム画面追加ガイド（PWA Install Prompt）
   ============================================ */
/* フローティングボタン（画面下） */
.rcel-install-fab {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #c9a84c, #d4b96e);
  color: #1b4332 !important;
  border: none;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: all 0.2s;
  animation: rcelFabPulse 3s ease-in-out infinite;
}
.rcel-install-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
.rcel-install-fab .rcel-fab-icon { font-size: 16px; line-height: 1; }
.rcel-install-fab .rcel-fab-text { font-size: 12px; line-height: 1; }
@keyframes rcelFabPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (max-width: 380px) {
  .rcel-install-fab { padding: 8px 12px; font-size: 11px; }
  .rcel-install-fab .rcel-fab-icon { font-size: 14px; }
}
/* PWAで起動中はフローティングボタン非表示 */
@media (display-mode: standalone) { .rcel-install-fab, .rcel-install-overlay { display: none !important; } }

/* オーバーレイ＋モーダル */
.rcel-install-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 40, 24, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}
.rcel-install-overlay.open { opacity: 1; }
.rcel-install-modal {
  background: #fff;
  border-radius: 18px 18px 12px 12px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 20px;
  position: relative;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease-out;
}
.rcel-install-overlay.open .rcel-install-modal { transform: translateY(0); }
@media (min-width: 768px) {
  .rcel-install-overlay { align-items: center; }
  .rcel-install-modal { border-radius: 18px; }
}

.rcel-install-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0efe8;
  color: #888;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.rcel-install-close:hover { background: #e0dfd8; color: #333; }

.rcel-install-header { text-align: center; margin-bottom: 18px; }
.rcel-install-icon {
  font-size: 44px;
  margin-bottom: 4px;
  animation: rcelInstallBounce 2s ease-in-out infinite;
}
@keyframes rcelInstallBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.rcel-install-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1b4332;
  margin: 0 0 6px;
  line-height: 1.4;
  font-family: 'Noto Serif JP', 'Yu Mincho', serif;
}
.rcel-install-sub {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.rcel-install-device-label {
  background: #f0f5f2;
  color: #2d6a4f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  padding: 6px 14px;
  border-radius: 12px;
  margin: 0 auto 16px;
  display: table;
}

.rcel-install-quickline {
  text-align: center;
  background: #fff8eb;
  border: 1px dashed #d4b96e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: #6b5414;
  margin-bottom: 14px;
  line-height: 1.6;
}

.rcel-install-steps { margin-bottom: 18px; }
.rcel-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: #f8f7f4;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #eee9e0;
}
.rcel-step-num {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(27,67,50,0.3);
}
.rcel-step-body { flex: 1; min-width: 0; }
.rcel-step-title {
  font-size: 13.5px;
  color: #1b4332;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 3px;
}
.rcel-step-title strong { color: #c9a84c; font-size: 16px; vertical-align: middle; }
.rcel-step-icon-svg {
  display: inline-block;
  vertical-align: middle;
  width: 26px;
  height: 26px;
  background: #1b4332;
  color: #fff;
  padding: 3px;
  border-radius: 6px;
  text-align: center;
  margin: 0 2px;
}
.rcel-step-icon-svg svg { color: #c9a84c; vertical-align: 1px; }
.rcel-step-hint {
  font-size: 11px;
  color: #888;
  line-height: 1.6;
}

.rcel-install-note {
  background: #fff5f5;
  border: 1px solid #fecdcd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  color: #a94545;
  line-height: 1.6;
  margin-top: 8px;
}

.rcel-install-btn-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin: 16px 0 12px;
  box-shadow: 0 4px 12px rgba(27,67,50,0.25);
  transition: all 0.2s;
}
.rcel-install-btn-primary:hover { background: linear-gradient(135deg, #0d2818, #1b4332); transform: translateY(-1px); }

.rcel-install-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f0efe8;
}
.rcel-install-btn-secondary {
  background: transparent;
  border: 1px solid #d4d0c8;
  color: #555;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.rcel-install-btn-secondary:hover { background: #f8f7f4; }
.rcel-install-btn-text {
  background: transparent;
  border: none;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 10px;
  text-decoration: underline;
}
.rcel-install-btn-text:hover { color: #666; }

/* ============================================
   📱 iPad / タブレット 専用最適化
   - portrait: 768px / 810px / 820px / 834px
   - landscape: 1024px / 1180px / 1194px / 1366px
   ============================================ */

/* === iPad portrait（縦向き / 768〜900px）=== */
/* 既存の @media (max-width: 768px) は 768pxジャストも含むため、
   iPad mini portrait はスマホ判定。768〜900pxを「狭めタブレット」として上書き調整 */
@media (min-width: 768px) and (max-width: 900px) and (orientation: portrait) {
  /* タブレットでは余白を少しゆとり持たせる */
  .rcel-page .container { padding-left: 24px; padding-right: 24px; }

  /* ナビ：全サイズでハンバーガーメニューを使用（メイン定義に従う） */
  .rcel-page .rcel-navbar .nav-logo { font-size: 18px; letter-spacing: 2px; }

  /* コース一覧：タブレットなら2列キープ（スマホで1列にしてた） */
  .rcel-page .courses-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 18px !important; }
  .rcel-page .course-card-body h3 { font-size: 16px; }
  .rcel-page .course-card-body p { font-size: 13px; }

  /* コース詳細：iPad portraitでも縦積み（動画は広く） */
  .rcel-page .course-detail-layout { grid-template-columns: 1fr !important; gap: 22px; }
  .rcel-page .course-sidebar {
    max-height: 420px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: static;
  }

  /* マイページ：メダルは3列で大きく */
  .rcel-page .mypage-medals { grid-template-columns: repeat(3, 1fr) !important; gap: 22px; }
  .rcel-page .mypage-stats { grid-template-columns: repeat(3, 1fr) !important; }

  /* 電子書籍：2列で */
  .rcel-page .ebooks-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 18px; }

  /* お問い合わせ：横並び */
  .rcel-page .contact-layout { grid-template-columns: 1fr 1fr !important; gap: 24px; }

  /* ヒーロー：iPadは余白広め＆フォント大きめでバランス */
  .rcel-page .hero-compass { padding: 100px 30px 80px; min-height: 480px; }
  .rcel-page .hero-compass h1 { font-size: 32px; letter-spacing: 2.5px; }
  .rcel-page .hero-compass p { font-size: 15px; line-height: 2; }

  /* ランクバナー：iPadなら横並びの方が落ち着く */
  .rcel-page .rank-banner { grid-template-columns: auto 1fr !important; gap: 20px !important; padding: 18px 22px; }

  /* おすすめカード：3列 */
  .rcel-page .rec-grid { grid-template-columns: repeat(3, 1fr) !important; }

  /* チャットボットパネル：iPadなら少し広く */
  .chatbot-panel { width: 420px !important; }
}

/* === iPad landscape（横向き / 1024〜1366px）=== */
/* PCに近いレイアウト・コース3列 */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .rcel-page .container { max-width: 1180px; padding-left: 24px; padding-right: 24px; }

  /* コース一覧：3列でリッチに */
  .rcel-page .courses-grid { grid-template-columns: repeat(3, 1fr); }

  /* コース詳細：横並び（動画 + サイドバー）が綺麗にハマる */
  .rcel-page .course-detail-layout { grid-template-columns: 1fr 320px; gap: 26px; }

  /* マイページ：メダル4列 */
  .rcel-page .mypage-medals { grid-template-columns: repeat(4, 1fr); }
  .rcel-page .mypage-stats { grid-template-columns: repeat(4, 1fr); }

  /* 電子書籍：3列 */
  .rcel-page .ebooks-grid { grid-template-columns: repeat(3, 1fr); }

  /* おすすめカード：4列 */
  .rcel-page .rec-grid { grid-template-columns: repeat(4, 1fr); }
}

/* === iPad Pro 12.9 portrait（1024px ジャスト）=== */
/* portraitなのに1024pxの特殊サイズ → 横並びレイアウトはやや窮屈なのでportrait扱い */
@media (min-width: 1000px) and (max-width: 1100px) and (orientation: portrait) {
  .rcel-page .courses-grid { grid-template-columns: repeat(3, 1fr); }
  .rcel-page .course-detail-layout { grid-template-columns: 1fr 300px; gap: 24px; }
  .rcel-page .mypage-medals { grid-template-columns: repeat(4, 1fr); }
  .rcel-page .ebooks-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === タブレット全般：タッチ操作の最適化 === */
@media (min-width: 768px) and (max-width: 1366px) and (hover: none) {
  /* ホバーが効かないタッチデバイス上では、ホバー専用エフェクトを無効化 */
  .rcel-page .course-card:hover { transform: none; }
  .rcel-page .btn:hover { transform: none; }
  .rcel-page .medal-card:hover { transform: none; }
  /* 代わりに active で押下感を出す */
  .rcel-page .course-card:active { transform: scale(0.98); }
  .rcel-page .btn:active { transform: scale(0.97); }
}

/* === iPad向け：管理画面（WP管理画面でiPadから操作する想定）=== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* 管理画面のサイドメニューが入った状態でも見やすく */
  .admin-wrapper { padding: 16px; }
  .admin-tabs { gap: 4px; }
  .admin-tab { padding: 10px 14px; font-size: 13px; }
  .admin-form { padding: 16px; }
  .admin-form .form-row { flex-wrap: wrap; }
  .admin-form .form-group { min-width: 200px; }

  /* 会社管理者画面のテーブル幅 */
  .ca-table { font-size: 13px; }
  .ca-form-group { min-width: 180px; }
}
