/* ======================== 共通設定 ======================== */
body {
  font-family: "Noto Sans JP", sans-serif;
  box-sizing: border-box;
  margin: 0;
}

.container {
  margin: 0 auto;
  padding: 0 24px;
  max-width: 720px;
  box-sizing: border-box;
}

section {
  margin-bottom: 50px;
}

h1 {
  text-align: center;
  font-weight: normal;
  font-size: 2rem;
}

h2 {
  text-align: center;
  font-weight: normal;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  text-align: center;
  font-weight: normal;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: #00acee; /* リンク色を親要素と同じに */
}

.badge-wrapper {
  text-align: left; /* テキストは左揃えのまま */
  display: inline-block;
  margin: 0 auto; /* ← 横中央に配置 */
}

/* ======================== ヘッダー設定 ======================== */
header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.5); /* 半透明白 */
  backdrop-filter: blur(2px); /* 背景ぼかし */
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;

  /* ★ 修正箇所:
     paddingを 4辺 (上、右、下、左) で指定し直し、
     セーフエリアの値を calc() で追加します。
  */
  padding-top: calc(env(safe-area-inset-top) + 24px);
  padding-right: calc(env(safe-area-inset-right) + 24px);
  padding-bottom: 24px;
  padding-left: calc(env(safe-area-inset-left) + 24px);
}

.nav-header .logo {
  height: 40px;
  display: flex;
  align-items: center;
}

.nav-header .icon {
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ======================== ヒーロー画面 ======================== */

.notice {
  color: #aaa;
}

.blue {
  color: #00acee;
}

/* ======================== カードとタグの設定 ======================== */
.card-grid {
  display: flex;
  flex-direction: column; /* 縦に並べる */
  gap: 1em;
}

.card {
  transform: scale(1); /* 初期値を指定しておくと滑らかに変化する */
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;
  display: block;
  height: 2em;
  padding: 1em;
  border-radius: 1em;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1em;
  font-weight: bold;
}

.card--dim {
  opacity: 0.5;
  filter: grayscale(60%);
}

.badge-icon,
.badge-icon-spacer {
  width: 2em;
  height: 2em;
  display: inline-block;
}

.icon {
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle; /* アイコンをテキストと中央揃え */
}

.badge {
  display: inline-flex; /* ← ここ */
  align-items: center; /* ← ここ */
  justify-content: left; /* ← 左寄せ */
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
  font-size: 0.85em; /* 必要に応じて調整 */
  font-weight: bold;
  text-align: center;
  min-width: 6em;
  color: white;
  background-color: #00aaff; /* 任意の背景色 */
  gap: 0.3em; /* 絵文字と文字の間隔 */
}

.badge.star,
.badge.gold {
  background-color: #00acee;
  color: white;
}

.badge.yet,
.badge.challenge,
.badge.silver,
.badge.bronze {
  background-color: #eeeaec; /* 明るめのグレー（前向きな印象） */
  color: white;
}

.grade-label {
  font-size: 0.9em;
  color: #555;
  margin-top: 0.2em;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #f9f9ff;
}

/* アニメーション・ホバー */
.fade-in {
  opacity: 0;
  animation: fadeIn 2s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.grade-label {
  display: block;
  font-size: 0.75em;
  color: #555;
  margin-top: 0.3em;
}

/* ======================== ボタン ======================== */
.button {
  background-color: #00acee;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  display: inline-block;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  margin: 4px;
  width: fit-content;
  line-height: 1.4;
}

.button-hover {
  background-color: #008ecf;
  box-shadow: 0 4px 16px rgba(0, 172, 238, 0.15);
  transform: translateY(-2px) scale(1.04);
  transition: all 0.3s ease;
}

.button-wrapper {
  text-align: center;
  margin: 1rem 0;
}

.play {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  display: inline-block;
  transform: translateY(-1px); /* ← ズレがある場合に微調整 */
}

/* ======================== グリッド・レイアウト ======================== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 0;
  row-gap: 24px;
  justify-items: center;
  align-items: center;
}

.grid p {
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

/* ======================== 使い方・利用規約のリスト/段落設定 ======================== */
.terms ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 1em 0;
}

.terms li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.howto ul {
  list-style: none;
  padding-left: 0;
  margin: 1em 0;
}

.howto li {
  position: relative;
  margin-bottom: 0.5em;
  line-height: 1.6;
  padding-left: 1em; /* ポチ分のスペース確保 */
}

.howto li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em; /* 縦位置調整 */
  width: 0.5em;
  height: 0.5em;
  background-color: #00ACEE; /* 好きな色 */
  border-radius: 50%; /* 丸に */
}

.howto strong {
  font-weight: bold;
}
/* ======================== フッター設定 ======================== */
.footer {
  text-align: center;
  font-size: 0.9em;
  margin-top: 2em;
  padding: 1em;
  border-top: 1px solid #ccc;
  color: #555;

  /* ★ 修正箇所: 下部と左右のセーフエリアを追加 */
  padding-bottom: calc(env(safe-area-inset-bottom) + 1em);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.footer-links a {
  color: #555;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  justify-content: center;
  padding: 0;
  list-style: none;
}

.footer-links li {
  width: 45%; /* 2列に収まる幅 */
  text-align: center;
}

/* スクロール先のカードを一時的にハイライト */
.card.card-highlight {
  transition: all 0.3s ease-out;
  box-shadow: 0 0 20px 5px rgba(0, 150, 255, 0.7); /* 青系の影 */
  transform: scale(1.03); /* 少しだけ拡大 */
}

/* ======================== レスポンシブ設定 ======================== */

/* PCでは1列にするなど調整したい場合 */
@media screen and (min-width: 768px) {
  .footer-links {
    flex-direction: row;
    justify-content: center;
  }

  .footer-links li {
    width: auto;
  }
}
