/* --- セクション全体の調整 --- */
#featured-challenges {
  background-color: #fef9f5; /* 薄いオレンジ背景でセクションを分離 */
  padding: 30px 15px;
  margin-bottom: 40px; /* max-point-section との間に十分な距離を取る */
  border-radius: 12px;
}

/* タイトルを中央に寄せる */
.section-title {
  text-align: center; /* これが「中のテキストを中央に」という命令 */
  width: 100%;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* --- PCとスマホの出し分け --- */
#challengeList {
  display: flex;
  gap: 15px;
  /* スマホ：横スクロール */
  overflow-x: auto;
  padding-bottom: 15px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* PC（画面幅768px以上）: グリッド表示に切り替え */
@media (min-width: 768px) {
  #challengeList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    overflow-x: visible; /* スクロールバーを消す */
    padding-bottom: 0;
  }
}

/* --- カードのスリム化デザイン --- */
.challenge-card {
  background: #fff;
  border: 2px solid #ff6600;
  border-radius: 12px;
  padding: 15px;
  flex: 0 0 280px; /* スマホ時の幅固定 */
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 14px; /* 少し小さく */
  height: 2.8em;
  overflow: hidden;
  margin: 10px 0;
}

.point-summary {
  text-align: center;
  margin-bottom: 12px;
}

.total-points .num {
  font-size: 24px;
  font-weight: bold;
  color: #ff6600;
}

.breakdown {
  font-size: 11px;
  color: #777;
}

.breakdown .bonus {
  color: #e53935;
  font-weight: bold;
}

/* ボタンを横並びにして高さを節約 */
.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-invite, .btn-direct {
  font-size: 11px;
  padding: 8px 2px;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

.btn-invite { background: #ff6600; color: #fff; }
.btn-direct { background: #f0f0f0; color: #333; border: 1px solid #ddd; }

.condition-hint {
  font-size: 10px;
  color: #999;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.carousel-container {
  position: relative; /* ボタンを配置する基準 */
  display: flex;
  align-items: center;
}

#challengeList {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth; /* スムーズに動かす */
  padding: 10px 0;
  /* スクロールバーを隠す（デザイン優先） */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
#challengeList::-webkit-scrollbar { display: none; }

.challenge-card {
  flex: 0 0 280px; /* カード幅固定 */
}

/* 矢印ボタンのスタイル */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 102, 0, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-btn.prev { left: -20px; }
.nav-btn.next { right: -20px; }

/* スマホでは矢印を消して、指でのスワイプに任せる */
@media (max-width: 767px) {
  .nav-btn { display: none; }
  .challenge-card { flex: 0 0 80%; } /* スマホは少し大きく */
}