@charset "utf-8";

/* ---------------------------------
   ページ全体の初期設定
--------------------------------- */

/* すべての要素のサイズ計算方法を統一（枠線や余白もサイズに含める） */
* {
  box-sizing: border-box;
}

/* ページ全体の基本デザイン */
body {
  margin: 0; /* ブラウザ標準の余白をなくす */
  font-family: "M PLUS 1p", sans-serif; /* 日本語でも読みやすいWebフォント */
  background-color: #f5f5f5; /* 薄いグレー背景 */
  color: #333; /* 文字は濃いグレー */
  padding-top: 80px;
}

/* ---------------------------------
   ヘッダー（ページ上部に固定）
--------------------------------- */
.site-header {
  position: fixed; /* スクロールしても位置が変わらない */
  top: 0; left: 0; right: 0;
  z-index: 1000; /* 前面に表示 */
  display: flex; /* 横並びにする */
  justify-content: space-between; /* 左右に分ける */
  align-items: center; /* 縦方向の中央揃え */
  padding: 10px 30px;
  background: rgba(255,255,255,0.10); /* 半透明の白背景 */
  backdrop-filter: saturate(1.1) blur(4px); /* 背景を少し鮮やか＆ぼかす */
}

.brand {
  display: inline-flex; /* 画像と文字を横並び */
  align-items: center;
  gap: 10px; /* 画像と文字の間隔 */
  text-decoration: none; /* 下線なし */
}

.brand-mark {
  height: 44px; /* ロゴの高さ */
  width: auto; /* 縦横比を保つ */
}

.brand-text {
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 24px); /* 面幅で可変（18〜24px） */
  line-height: 1; /* 行間詰め */
  color: #333;
  white-space: nowrap; /* 改行させない */
}



.site-nav ul {
  list-style: none; /* 行頭の●を消す */
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

/* ---------------------------------
   メインの背景エリア（ヒーロー部分）
--------------------------------- */
.hero {
  position: relative; /* 子要素（恐竜など）の配置の基準にする */
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 80px); /* 画面の高さからヘッダー分を引く */
  padding-top: 6px;
  padding-bottom: 84px; /* フッター分＋安全余白 */
  background-image: url("../images/hero-bg.jpg"); /* 背景画像 */
  background-size: cover; /* 画像を全体に広げる */
  background-position: center; /* 画像の表示位置を中央に */
  overflow: hidden; /* はみ出し部分を隠す */
}

/* 恐竜イラスト（左右） */
.hero-dino {
  position: absolute;
  z-index: 3;
  width: auto;
  height: auto;
}

.hero-dino.left {
  left: -10vw; /* 少し画面外に出す */
  top: 48%; /* 縦の真ん中に置く */
  transform: translateY(-50%); /* 画像の中心を基準に */
  height: 70vh; /* 画面高さの70% */
}

.hero-dino.right {
  right: -8vw;
  top: 25%;
  height: 50vh;
}

/* 真ん中のコンテンツ（動物画像・タイトル・ボタン） */
.hero-center {
  text-align: center;
  z-index: 2; /* 恐竜より前に表示 */
  max-width: 640px;
  margin: 10px auto;
  padding: 0 8vw; /* 両端に余白（恐竜と重ならないように） */
}

.photo-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
}

.animal-photo {
  height: 170px;
  width: auto;
  object-fit: contain; /* 画像を切らずに縮小 */
}

.hero-title {
  font-size: 3em;
  color: #333;
  display: inline-block;
  padding: 0 20px;
  border-radius: 12px;
  margin: -5px 0;
  line-height:1.05;
  font-family: "M PLUS Rounded 1c", "M PLUS 1p", "Noto Sans JP", sans-serif;
  font-weight: 800; /* ← グーグルフォントで読み込んだ太さに合わせる */
  letter-spacing: 0.02em; /* 詰めすぎ防止の微調整 */
}

.hero-description {
  max-width: 520px;
  margin: 10px auto 6px;
  padding: 0 8px;
  color: #444;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(255,255,255,.9);
}

.hero-prototype {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

.hero-prototype strong {
  color: #555;
  font-size: 13px;
}

@media (min-width: 769px) {
  .hero-center {
    transform: translateY(-14px);
  }
}



.hero-button {
  font-size: 1.5em;
  text-decoration: none;
  color: #ffffff;
  background-color: #ff9900;
  padding: 11px 30px;
  border-radius: 30px;
  cursor: pointer;
}

.hero-button:hover {
  background-color: #ff7700;
}

/* ---------------------------------
   フッター（ページ下部に固定）
--------------------------------- */
.site-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 50px;
  z-index: 1000;
  background: rgba(255,255,255,0.35);
  backdrop-filter: saturate(1.1) blur(8px);/* 背景に彩度を1.1倍（110%）、８pxのぼかし効果 */
  padding: 0 24px;
  display: flex;
  align-items: center;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-mark {
  height: 22px;
  width: auto;
}

.footer-brand {
  font-weight: 700;
  color: #333;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-nav a {
  color: #333;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.header-subtitle,
.mobile-footer-links {
  display: none;
}

@media (min-width: 769px) {
  body:not([class]) .site-footer {
    height: auto;
    min-height: 70px;
    padding: 6px 24px;
  }

  body:not([class]) .footer-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand links"
      "copy copy";
    align-items: center;
    justify-content: center;
    gap: 4px 18px;
    max-width: 1180px;
  }

  body:not([class]) .footer-left {
    grid-area: brand;
    justify-content: center;
    white-space: nowrap;
  }

  body:not([class]) .footer-nav {
    display: contents;
  }

  body:not([class]) .desktop-footer-links {
    grid-area: links;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
  }

  body:not([class]) .desktop-footer-links a {
    white-space: nowrap;
  }

  body:not([class]) .footer-nav small {
    grid-area: copy;
    display: block;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
  }
}


















/* =========================
   input-name.php 専用スタイル
   （このページだけに効くよう.page-inputで範囲設定）
========================= */

/* ページ全体で余計なスクロールを禁止 */
/* html にクラスは付けられないため body で代替。高さは 100vh で確保 */
.page-input {
  height: 100vh;
  overflow: hidden;
}

/* 全要素のサイズ計算を「枠や余白込み」にする設定 */
.page-input * {
  box-sizing: border-box;
}

/* ページ全体の基本設定 */
.page-input {
  margin: 0;
  font-family: "M PLUS 1p", sans-serif;
  color: #333;
  background-color: #f5f5f5;
  padding-top: 80px; /* 固定ヘッダーぶんの余白 */
}

/* ==== 中央ステージ ==== */
.page-input .stage {
  position: relative;
  height: calc(100vh - 80px);
  padding: 16px 0 calc(64px + 20px);
  overflow: hidden; /* 要素からはみ出したコンテンツを非表示にする設定 */
  background-image: url("../images/hero-bg.jpg"); /* 背景画像（indexと同じ）※CSSからの相対に変更 */
  background-size: cover;
  background-position: center;
  /* background-position: 50% 45%; */
}

.page-input .stage-title {
  margin: 0 auto 14px;
  padding: .2em .6em;
  text-align: center;
  font-size: clamp(22px, 3.2vw, 34px);
  color: #333;
  text-shadow: 0 2px 8px rgba(255,255,255,.7);
}

/* 恐竜の飾り */
.page-input .side-dino {
  position: absolute;
  z-index: 2;
  width: auto;
  pointer-events: none;
  max-height: 95vh;
}

.page-input .side-dino.left {
  left: -14vw;
  top: 10vh;
  height: 64vh;
}

.page-input .side-dino.right {
  right: -18vw;
  top: 25vh;
  height: 48vh;
}

/* ==== UIエリア ==== */
.page-input .ui {
  position: relative;
  z-index: 3;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2vw;
  text-align: center;
}

/* 入力内容を表示するボックス */
.page-input #nameOutput {
  display: flex; /* 中の文字を縦横に配置するため */
  align-items: center; /* 縦方向の中央寄せ */
  justify-content: flex-start; /* 左寄せ（中央寄せにしたければ center） */
  font-size: 36px;
  margin: 10px auto 12px;
  padding: 0 14px; /* 上下は0にして高さ固定 */
  border: 1px solid #ccc;
  width: 90%;
  max-width: 560px;
  height: 56px; /* 高さを固定（入力しても変わらない） */
  background: #fff;
  border-radius: 10px;
  overflow: hidden; /* 長すぎる文字がはみ出ないように */
}

/* ボタン行 */
.page-input .form-row {
  margin: 10px auto 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.page-input .next-button,
.page-input #deleteButton {
  font-size: 16px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.page-input .next-button {
  background: #4caf50;
  color: #fff;
}

.page-input .next-button:hover {
  background: #43a047;
}

.page-input #deleteButton {
  background: #f88;
  color: #222;
}

.page-input .small-helper {
  display: none;
}

.page-input #deleteButton:hover {
  background: #f66;
}

/* ひらがなパレットの囲い */
.page-input .grid-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  margin: 10px auto 0;
}

/* 左の縦列 */
.page-input .mark-col {
  display: grid;
  grid-template-rows: repeat(5, 50px);
  grid-auto-columns: 50px;
  gap: 5px;
}

.page-input .mark-col button {
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.page-input .mark-col .small {
  font-size: 16px;
}

/* 五十音グリッド */
.page-input .grid {
  display: grid;
  grid-template-rows: repeat(5, 50px);
  grid-template-columns: repeat(11, 50px);
  justify-content: center;
  gap: 5px;
}

.page-input .grid button {
  width: 50px;
  height: 50px;
  font-size: 18px;
}

.page-input .grid button:disabled {
  visibility: hidden; /*要素は非表示。場所は確保 */
}




















/* =========================
   question pages 共通
   ※ 各ページとも <body class="page-quiz"> を付与
========================= */

/* ------------------------------------------------------------
   ベース（input-name.php から流用：共通の見た目・固定配置）
------------------------------------------------------------ */

/* すべての要素のサイズ計算に padding と border を含める（ズレ防止） */
.page-quiz * {
  box-sizing: border-box;
}

/* ページを1枚に固定（縦横スクロールを止める）
   - htmlは範囲設定（スコープ）できないため、body（= .page-quiz）で代替
*/
.page-quiz {
  height: 100vh;
  overflow: hidden;
}

/* ページ全体の基本セット */
.page-quiz {
  margin: 0;
  font-family: "M PLUS 1p", sans-serif; /* 読みやすい日本語フォント系 */
  color: #333;
  background-color: #f5f5f5;
  padding-top: 80px; /* 固定ヘッダー分の上余白（重なり防止） */
}

/* ヘッダー（固定） */
.page-quiz .site-header {
  position: fixed; /* 画面上部に固定 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000; /* 前面へ */
  display: flex; /* 横並び */
  justify-content: space-between; /* 左右に配置 */
  align-items: center; /* 縦中央 */
  padding: 10px 30px;
  background: rgba(255,255,255,0.10); /* 半透明の白 */
  backdrop-filter: saturate(1.1) blur(4px);/* 少し鮮やかに＆ぼかし（対応ブラウザ） */
}

/* ロゴ＋サイト名リンク */
.page-quiz .brand {
  display: inline-flex; /* インラインで横並び */
  align-items: center; /* 縦中央 */
  gap: 10px; /* すき間 */
  text-decoration: none; /* 下線なし */
}
.page-quiz .brand-mark {
  height: 44px; /* ロゴ高さ */
  width: auto; /* 比率維持 */
  display: block; /* 画像の隙間対策 */
}
.page-quiz .brand-text {
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 24px); /* 画面幅で可変（18〜24px） */
  line-height: 1; /* 行間詰め */
  color: #333;
  white-space: nowrap; /* 改行しない */
}



/* ヘッダーナビ（見た目だけ。リンク先はダミーでもOK） */
.page-quiz .site-nav ul {
  list-style: none; /* 行頭の点を消す */
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.page-quiz .site-nav a {
  text-decoration: none; /* 下線なし */
  color: #333;
  font-weight: bold; /* 少し太字 */
}

/* 中央ステージ（固定の背景エリア。input-name.php と同じ） */
.page-quiz .stage {
  position: relative; /* 子要素の基準にする */
  height: calc(100vh - 80px); /* 画面高 − ヘッダー高（固定） */
  padding: 16px 0 calc(64px + 20px); /* 下にフッター64px＋安全20px（潜り込み防止） */
  overflow: hidden; /* はみ出しを隠す */
  background-image: url("../images/hero-bg.jpg"); /* index と同じ背景画像で世界観統一（CSSからの相対パス） */
  background-size: cover; /* 画面を埋め尽くす */
  background-position: center;
  /* background-position: 50% 40%; */
  background-attachment: fixed; /* スクロール錯視を抑える（雰囲気合わせ） */
}

/* ステージの見出し（問題文をここに出す） */
.page-quiz .stage-title {
  margin: 20px auto 14px;
  padding: .2em .6em; /* 文字の周りの余白 */
  text-align: center;
  font-size: clamp(22px, 3.2vw, 34px); /* 画面幅で可変 */
  color: #333;
}

.page-quiz .player-name {
  display: inline-block;
  color: #555;
  font-size: .78em;
  font-weight: 700;
  line-height: 1.3;
}

.page-quiz .question-text {
  color: #333;
  display: inline-block;
  margin-top: 4px;
  font-size: 1.42em;
  font-weight: 800;
  line-height: 1.25;
}

/* 左右の恐竜（飾り・位置は input-name.php と同じで統一） */
.page-quiz .side-dino {
  position: absolute; /* 自由配置 */
  z-index: 3; /* UIよりうしろ寄り */
  width: auto; /* 比率維持 */
  pointer-events: none; /* クリックを素通り（UI操作の邪魔をしない） */
  max-height: 95vh; /* 画面より大きくしすぎない */
}
.page-quiz .side-dino.left {
  left: -14vw; /* さらに左へオフセット */
  top: 10vh; /* 少し下げる */
  height: 64vh; /* 大きさ */
  transform-origin: left center; /* 変形の支点 */
}
.page-quiz .side-dino.right {
  right: -18vw; /* 右へオフセット */
  top: 20vh; /* 少し下げる */
  height: 48vh; /* 大きさ */
  transform-origin: right top; /* 変形の支点 */
}

/* UI コンテナ（中央の中身をまとめる。動物写真と正解・不正解部分と次の問題へ部分） */
.page-quiz .ui {
  position: relative; /* ステージ内の通常配置 */
  z-index: 2; /* 恐竜より前に出す */
  max-width: 960px; /* 横幅の上限（写真5枚用に少し広め） */
  margin: 25px auto 0; /* 中央寄せ */
  padding: 0 2vw; /* 端の恐竜と干渉しづらく */
  text-align: center; /* 中央揃え */
}

/* ------------------------------------------------------------
   ★ ここから「中央UIの差し替え部分（input-name.php → 問題パート）」
   - input-name.php の “名前入力UI” を “問題UI” に入れ替え
------------------------------------------------------------ */

/* 写真を横に5枚並べる（小さい画面でも折返さない想定） */
.page-quiz .photo-row {
  display: flex;
  justify-content: center;
  gap: 6px; /* 写真どうしの間隔 */
  margin: 16px 0 10px;
  flex-wrap: nowrap; /* 折り返さない（画面が狭い場合は画像を小さく） */
}
.page-quiz .animal-card {
  width: 160px; /* 各カードの横幅（目安） */
}
.page-quiz .animal-photo {
  width: 100%; /* カード幅いっぱい */
  height: 150px; /* 固定高さ（揃える） */
  object-fit: contain; /* 切り抜かずに収める */
  display: block; /* 画像の下の隙間対策 */
  border-radius: 10px;
}

/* 動物名のボタン（ひらがな） */
.page-quiz .answer-button {
  margin-top: 6px; /* 写真との間隔 */
  width: 100%; /* カード幅いっぱい */
  padding: 10px 12px;
  font-size: 16px;
  border: none; /* 枠なし */
  border-radius: 24px; /* 丸め */
  color: #fff;
  background: #ff9900; /* オレンジ */
  box-shadow: 0 4px 16px rgba(0,0,0,.18); /* ほんのり影 */
  cursor: pointer;
}
.page-quiz .answer-button:hover {
  background: #ff7700; /* ちょい濃いオレンジ */
}

/* 判定メッセージ（ここに せいかい／ちがうよ を出す） */
.page-quiz .judge {
  margin: 10px auto 6px;
  font-size: 20px; /* 少し大きめ */
  min-height: 28px; /* 1行ぶん確保（出し入れでガタつかないように） */
}

/* 「つぎの もんだいへ」ボタン（最初は非表示） */
.page-quiz .next-wrap {
  margin-top: 8px; /* 上の判定との間隔 */
}
.page-quiz .next-button {
  display: none; /* 最初は隠す → 回答後に出す */
  padding: 12px 20px;
  font-size: 18px; /* 文字サイズ */
  border: none; /* 枠なし */
  border-radius: 28px; /* 丸め */
  color: #fff;
  background: #4caf50; /* 緑 */
  box-shadow: 0 4px 16px rgba(0,0,0,.18); /* 影 */
  cursor: pointer;
  text-decoration: none; /* aタグの下線を消す（ボタン見た目） */
}
.page-quiz .next-button:hover {
  background: #43a047; /* ちょい濃い緑 */
}

/* ------------------------------------------------------------
   フッター（固定）… ここも input-name.php と同じで世界観を統一
------------------------------------------------------------ */
.page-quiz .site-footer {
  position: fixed; /* 画面下部に固定 */
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px; /* 高さ固定 */
  z-index: 1000; /* 前面 */
  background: rgba(255,255,255,0.10); /* 半透明の白 */
  backdrop-filter: saturate(1.1) blur(8px); /* ガラス風 */
  padding: 0 24px; /* 上下0・左右24 */
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  overflow: hidden; /* はみ出し防止 */
}
.page-quiz .footer-inner {
  max-width: 1100px; /* 最大幅 */
  margin: 0 auto; /* 中央寄せ */
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  justify-content: space-between; /* 左右に配置 */
  width: 100%; /* 幅いっぱい */
  height: 100%; /* フッター高に揃える */
}
.page-quiz .footer-left {
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  gap: 10px; /* 間隔 */
}
.page-quiz .footer-mark {
  height: 22px; /* ロゴ高さ */
  width: auto; /* 比率維持 */
  display: block; /* 画像の隙間対策 */
}
.page-quiz .footer-brand {
  font-weight: 700;
  color: #333;
}
.page-quiz .footer-nav {
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  gap: 10px; /* 間隔 */
  color: #333;
}
.page-quiz .footer-nav a {
  color: #333;
  text-decoration: none; /* 下線なし */
}
.page-quiz .footer-nav a:hover {
  text-decoration: underline; /* ホバーで下線 */
}





















/* =========================
   score.php 専用スタイル
   （このページだけに効くよう .page-score でスコープ）
   - ティラノ演出：15秒ワンショット
   - ピーク時は scale(5.0)
========================= */

/* ---- ベース ---- */
.page-score * { box-sizing: border-box; }
.page-score {
  margin: 0;
  height: 100%;
  overflow: hidden;
  padding-top: 80px;
  font-family: "M PLUS 1p", sans-serif;
  color: #333;
  background-color: #f5f5f5;
}

/* ---- ヘッダー ---- */
.page-score .site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 30px; height: 80px;
  background: rgba(255,255,255,0.10);
  backdrop-filter: saturate(1.1) blur(4px);
}
.page-score .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.page-score .brand-mark { height: 44px; width: auto; display: block; }
.page-score .brand-text { font-weight: 800; font-size: clamp(18px, 2.2vw, 24px); line-height: 1; color: #333; white-space: nowrap; }
.page-score .site-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.page-score .site-nav a { text-decoration: none; color: #333; font-weight: bold; }

/* ---- ステージ ---- */
.page-score .stage {
  position: relative;
  height: calc(100vh - 80px);
  padding: 16px 0 calc(64px + 20px);
  overflow: visible;
  background-image: url("../images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.page-score .stage-title {
  margin: 20px auto 14px;
  padding: .2em .6em;
  text-align: center;
  font-size: clamp(22px, 3.2vw, 34px);
  color: #333;
}
.page-score .player-name { font-size: 1.2em; }
.page-score .result-text { font-size: 1.4em; line-height: 1.4; }

/* ---- 左右の恐竜 ---- */
.page-score .side-dino {
  position: absolute; z-index: 2; width: auto; pointer-events: none; max-height: 95vh;
}
.page-score .side-dino.left  { left: -14vw; top: 10vh; height: 64vh; transform-origin: left center; }
.page-score .side-dino.right { right: -18vw; top: 20vh; height: 48vh; transform-origin: right top; }

/* ---- 中央ティラノ ---- */
.page-score .ui {
  position: relative; z-index: 3;
  max-width: 960px; margin: 25px auto 0; padding: 0 2vw;
  text-align: center;
}
.page-score .sway-wrap {
  width: 100%; display: flex; justify-content: center; align-items: center;
  position: relative; z-index: 10; overflow: visible;
}
.page-score .sway-dino {
  display: block; margin: 0 auto;
  height: 120px; width: auto;
  background: transparent;
  transform-origin: 50% 80%;
  will-change: transform, filter;
  filter: drop-shadow(0 0 0 rgba(255,215,0,0));
  animation: tyrano-one-shot-giant 15s ease-in-out 0s 1 both;
}
.page-score.is-perfect .sway-dino {
  animation: tyrano-one-shot-perfect 15s ease-in-out 0s 1 both;
}

/* ---- ティラノ通常演出 ---- */
@keyframes tyrano-one-shot-giant {
  0%   { transform: rotate(0deg) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
  12%  { transform: rotate(-10deg) scale(2.0) translateY(-10px);
         filter: drop-shadow(0 0 6px rgba(255,215,0,0.8)) drop-shadow(0 0 12px rgba(255,255,0,0.7)) drop-shadow(0 0 18px rgba(255,255,255,0.5)); }
  28%  { transform: rotate(8deg) scale(3.2) translateY(0);
         filter: drop-shadow(0 0 10px rgba(255,215,0,0.9)) drop-shadow(0 0 18px rgba(255,255,0,0.85)) drop-shadow(0 0 26px rgba(255,255,255,0.6)); }
  50%  { transform: rotate(0deg) scale(5.0) translateY(-24px);
         filter: drop-shadow(0 0 16px rgba(255,215,0,1)) drop-shadow(0 0 28px rgba(255,255,0,0.95)) drop-shadow(0 0 40px rgba(255,255,255,0.8)); }
  70%  { transform: rotate(-6deg) scale(2.8) translateY(-10px);
         filter: drop-shadow(0 0 8px rgba(255,215,0,0.7)) drop-shadow(0 0 14px rgba(255,255,0,0.6)); }
  85%  { transform: rotate(6deg) scale(1.6) translateY(-4px);
         filter: drop-shadow(0 0 5px rgba(255,215,0,0.4)) drop-shadow(0 0 8px rgba(255,255,0,0.3)); }
  100% { transform: rotate(0deg) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
}

/* ---- ティラノ満点演出 ---- */
@keyframes tyrano-one-shot-perfect {
  0%   { transform: rotate(0deg) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
  10%  { transform: rotate(-12deg) scale(2.2) translateY(-16px);
         filter: drop-shadow(0 0 10px rgba(255,215,0,0.9)) drop-shadow(0 0 18px rgba(255,235,59,0.9)) drop-shadow(0 0 26px rgba(255,255,255,0.8)); }
  25%  { transform: rotate(8deg) scale(3.6) translateY(0);
         filter: drop-shadow(0 0 14px rgba(255,215,0,1)) drop-shadow(0 0 24px rgba(255,235,59,0.95)) drop-shadow(0 0 36px rgba(255,255,255,0.85)); }
  50%  { transform: rotate(360deg) scale(5.0) translateY(-40px);
         filter: drop-shadow(0 0 20px rgba(255,215,0,1)) drop-shadow(0 0 36px rgba(255,235,59,1)) drop-shadow(0 0 52px rgba(255,255,255,0.95)); }
  70%  { transform: rotate(-8deg) scale(3.0) translateY(-14px);
         filter: drop-shadow(0 0 12px rgba(255,215,0,0.9)) drop-shadow(0 0 22px rgba(255,235,59,0.85)); }
  85%  { transform: rotate(6deg) scale(1.8) translateY(-6px);
         filter: drop-shadow(0 0 8px rgba(255,215,0,0.6)) drop-shadow(0 0 14px rgba(255,235,59,0.5)); }
  100% { transform: rotate(0deg) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
}

/* ---- ボタン ---- */
.page-score .actions { margin-top: 10px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.page-score .btn {
  display: inline-block; padding: 12px 20px; font-size: 18px;
  border: none; border-radius: 28px; color: #fff;
  background: #ff9900; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  text-decoration: none; cursor: pointer;
}
.page-score .btn:hover { background: #ff7700; }
.page-score .btn.secondary { background: #607d8b; }
.page-score .btn.secondary:hover { background: #546e7a; }

.page-score .answer-review {
  width: min(90%, 520px);
  margin: 18px auto 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  text-align: left;
}

.page-score .answer-review h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 22px;
  color: #333;
}

.page-score .answer-review ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.7;
  font-weight: 700;
}

/* ---- フッター ---- */
.page-score .site-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 50px; z-index: 1000;
  background: rgba(255,255,255,0.10);
  backdrop-filter: saturate(1.1) blur(4px);
  padding: 0 24px; display: flex; align-items: center; overflow: hidden;
}
.page-score .footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 100%;
}
.page-score .footer-left { display: flex; align-items: center; gap: 10px; }
.page-score .footer-mark { height: 22px; width: auto; display: block; }
.page-score .footer-brand { font-weight: 700; color: #333; }
.page-score .footer-nav { display: flex; align-items: center; gap: 10px; }
.page-score .footer-nav a { color: #333; text-decoration: none; }
.page-score .footer-nav a:hover { text-decoration: underline; }

/* ---- アクセシビリティ ---- */
@media (prefers-reduced-motion: reduce) {
  .page-score .sway-dino { animation: none !important; transform: none !important; filter: none !important; }
}














/* =========================
   score.php 専用スタイル（段階制アニメ）
   - perfect / high / mid / low で秒数・拡大率・発光を調整
   - ヘッダー(z=1000)を越えるため stage=1500 / ui=2000 を付与
========================= */

/* ---- ベース（デフォルト=low） ---- */
.page-score {
  margin: 0; height: 100%; overflow: hidden; padding-top: 80px;
  font-family: "M PLUS 1p", sans-serif; color: #333; background-color: #f5f5f5;

  --anim-dur: 5s;         /* 再生時間 */
  --scale-peak: 1.8;      /* 最大拡大率 */
  --scale-mid:  1.4;      /* 中間拡大率 */
  --jump-peak: -8px;      /* 最大ジャンプ量（上方向＝マイナス） */
  --jump-mid:  -4px;      /* 中間ジャンプ量 */
  --glow-a1: .45;         /* 発光（ゴールド） */
  --glow-a2: .35;         /* 発光（イエロー） */
  --glow-a3: .25;         /* 発光（白） */
  --spin: 0deg;           /* perfectのみ360deg */
}

/* ---- 段階別（PHPで body に tier-◯ を付与） ---- */
.page-score.tier-mid {
  --anim-dur: 8s;
  --scale-peak: 2.6; --scale-mid: 1.8;
  --jump-peak: -14px; --jump-mid: -8px;
  --glow-a1: .65; --glow-a2: .55; --glow-a3: .40;
}
.page-score.tier-high {
  --anim-dur: 12s;
  --scale-peak: 3.8; --scale-mid: 2.6;
  --jump-peak: -22px; --jump-mid: -12px;
  --glow-a1: .85; --glow-a2: .75; --glow-a3: .60;
}
.page-score.tier-perfect {
  --anim-dur: 15s;
  --scale-peak: 5.0; --scale-mid: 3.6;
  --jump-peak: -40px; --jump-mid: -18px;
  --glow-a1: 1; --glow-a2: 1; --glow-a3: .95;
  --spin: 360deg; /* 1回転 */
}

/* ---- ヘッダー（参考：z=1000） ---- */
.page-score .site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 30px; height: 80px;
  background: rgba(255,255,255,0.10); backdrop-filter: saturate(1.1) blur(4px);
}
.page-score .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.page-score .brand-mark { height: 44px; width: auto; display: block; }
.page-score .brand-text { font-weight: 800; font-size: clamp(18px, 2.2vw, 24px); line-height: 1; color: #333; white-space: nowrap; }
.page-score .site-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.page-score .site-nav a { text-decoration: none; color: #333; font-weight: bold; }

/* ---- ステージ（ヘッダーより前面へ） ---- */
.page-score .stage {
  position: relative; z-index: 1500;            /* ★重要 */
  height: calc(100vh - 80px);
  padding: 16px 0 calc(64px + 20px);
  overflow: visible;                              /* 拡大で切れない */
  background-image: url("../images/hero-bg.jpg");
  background-size: cover; background-position: center; background-attachment: fixed;
}
.page-score .stage-title {
  margin: 20px auto 14px; padding: .2em .6em; text-align: center;
  font-size: clamp(22px, 3.2vw, 34px); color: #333;
}
.page-score .player-name { font-size: 1.2em; }
.page-score .result-text { font-size: 1.4em; line-height: 1.4; }

/* ---- 左右の飾り恐竜 ---- */
.page-score .side-dino {
  position: absolute; z-index: 2; width: auto; pointer-events: none; max-height: 95vh;
}
.page-score .side-dino.left  { left: -14vw; top: 10vh; height: 64vh; transform-origin: left center; }
.page-score .side-dino.right { right: -18vw; top: 20vh; height: 48vh; transform-origin: right top; }

/* ---- 中央UI＆ティラノ（さらに前面へ） ---- */
.page-score .ui {
  position: relative; z-index: 2000;             /* ★重要 */
  max-width: 960px; margin: 25px auto 0; padding: 0 2vw; text-align: center;
}
.page-score .sway-wrap {
  width: 100%; display: flex; justify-content: center; align-items: center;
  position: relative; overflow: visible;
}
.page-score .sway-dino {
  display: block; margin: 0 auto; height: 120px; width: auto; background: transparent;
  transform-origin: 50% 80%;
  will-change: transform, filter;
  filter: drop-shadow(0 0 0 rgba(255,215,0,0));
  animation: tyrano-generic var(--anim-dur) ease-in-out 0s 1 both; /* ワンショット */
}
/* perfect だけは回転入りの別アニメへ切替 */
.page-score.tier-perfect .sway-dino { animation-name: tyrano-perfect; }

/* ---- アニメーション（filterで発光・透明維持） ---- */
@keyframes tyrano-generic {
  0%   { transform: rotate(0) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
  15%  { transform: rotate(-8deg) scale(var(--scale-mid)) translateY(var(--jump-mid));
         filter: drop-shadow(0 0 6px  rgba(255,215,0,calc(var(--glow-a1)*0.9)))
                 drop-shadow(0 0 12px rgba(255,255,0,calc(var(--glow-a2)*0.9)))
                 drop-shadow(0 0 18px rgba(255,255,255,calc(var(--glow-a3)*0.8))); }
  35%  { transform: rotate(8deg)  scale(calc((var(--scale-mid) + var(--scale-peak)) / 2)) translateY(calc((var(--jump-mid) + var(--jump-peak)) / 2));
         filter: drop-shadow(0 0 10px rgba(255,215,0,var(--glow-a1)))
                 drop-shadow(0 0 18px rgba(255,255,0,var(--glow-a2)))
                 drop-shadow(0 0 26px rgba(255,255,255,var(--glow-a3))); }
  50%  { transform: rotate(0) scale(var(--scale-peak)) translateY(var(--jump-peak));
         filter: drop-shadow(0 0 12px rgba(255,215,0,var(--glow-a1)))
                 drop-shadow(0 0 24px rgba(255,255,0,var(--glow-a2)))
                 drop-shadow(0 0 36px rgba(255,255,255,var(--glow-a3))); }
  70%  { transform: rotate(-6deg) scale(calc((1 + var(--scale-mid)) / 2)) translateY(calc(var(--jump-mid) / 2));
         filter: drop-shadow(0 0 8px  rgba(255,215,0,calc(var(--glow-a1)*0.7)))
                 drop-shadow(0 0 14px rgba(255,255,0,calc(var(--glow-a2)*0.6))); }
  85%  { transform: rotate(6deg) scale(1.2) translateY(calc(var(--jump-mid) / 4));
         filter: drop-shadow(0 0 5px rgba(255,215,0,calc(var(--glow-a1)*0.4)))
                 drop-shadow(0 0 8px rgba(255,255,0,calc(var(--glow-a2)*0.3))); }
  100% { transform: rotate(0) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
}

/* perfect 専用（50%で1回転） */
@keyframes tyrano-perfect {
  0%   { transform: rotate(0) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
  15%  { transform: rotate(-12deg) scale(var(--scale-mid)) translateY(var(--jump-mid));
         filter: drop-shadow(0 0 10px rgba(255,215,0,calc(var(--glow-a1)*0.95)))
                 drop-shadow(0 0 18px rgba(255,235,59,var(--glow-a2)))
                 drop-shadow(0 0 26px rgba(255,255,255,calc(var(--glow-a3)*0.9))); }
  30%  { transform: rotate(8deg) scale(calc((var(--scale-mid) + var(--scale-peak)) / 2)) translateY(calc((var(--jump-mid) + var(--jump-peak)) / 2));
         filter: drop-shadow(0 0 14px rgba(255,215,0,var(--glow-a1)))
                 drop-shadow(0 0 24px rgba(255,235,59,var(--glow-a2)))
                 drop-shadow(0 0 36px rgba(255,255,255,var(--glow-a3))); }
  50%  { transform: rotate(var(--spin)) scale(var(--scale-peak)) translateY(var(--jump-peak));
         filter: drop-shadow(0 0 16px rgba(255,215,0,var(--glow-a1)))
                 drop-shadow(0 0 30px rgba(255,235,59,var(--glow-a2)))
                 drop-shadow(0 0 44px rgba(255,255,255,var(--glow-a3))); }
  70%  { transform: rotate(-8deg) scale(calc((1 + var(--scale-mid)) / 2)) translateY(calc(var(--jump-mid) / 2));
         filter: drop-shadow(0 0 12px rgba(255,215,0,calc(var(--glow-a1)*0.8)))
                 drop-shadow(0 0 22px rgba(255,235,59,calc(var(--glow-a2)*0.75))); }
  85%  { transform: rotate(6deg) scale(1.25) translateY(calc(var(--jump-mid) / 4));
         filter: drop-shadow(0 0 8px rgba(255,215,0,calc(var(--glow-a1)*0.6)))
                 drop-shadow(0 0 14px rgba(255,235,59,calc(var(--glow-a2)*0.5))); }
  100% { transform: rotate(0) scale(1) translateY(0); filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
}

/* ---- ボタン/フッター/アクセシビリティ ---- */
.page-score .actions { margin-top: 10px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.page-score .btn {
  display: inline-block; padding: 12px 20px; font-size: 18px;
  border: none; border-radius: 28px; color: #fff;
  background: #ff9900; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  text-decoration: none; cursor: pointer;
}
.page-score .btn:hover { background: #ff7700; }
.page-score .btn.secondary { background: #607d8b; }
.page-score .btn.secondary:hover { background: #546e7a; }

.page-score .site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 50px; z-index: 1000;
  background: rgba(255,255,255,0.10); backdrop-filter: saturate(1.1) blur(4px);
  padding: 0 24px; display: flex; align-items: center; overflow: hidden;
}
.page-score .footer-inner {
  max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 100%;
}
.page-score .footer-left { display: flex; align-items: center; gap: 10px; }
.page-score .footer-mark { height: 22px; width: auto; display: block; }
.page-score .footer-brand { font-weight: 700; color: #333; }
.page-score .footer-nav { display: flex; align-items: center; gap: 10px; color: #333; }
.page-score .footer-nav a { color: #333; text-decoration: none; }
.page-score .footer-nav a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .page-score .sway-dino { animation: none !important; transform: none !important; filter: none !important; }
}















/* ---------------------------------
   ボタン
--------------------------------- */
.page-score .actions {
  margin-top: 10px;
  display: flex; /* 横並び */
  justify-content: center; /* 中央寄せ */
  gap: 10px; /* 間隔 */
  flex-wrap: wrap; /* せまい画面で折り返し */
}
.page-score .btn {
  display: inline-block; /* インラインブロック */
  padding: 12px 20px;
  font-size: 18px; /* 文字サイズ */
  border: none; /* 枠なし */
  border-radius: 28px;
  color: #fff; /* 白文字 */
  background: #ff9900; /* オレンジ */
  box-shadow: 0 4px 16px rgba(0,0,0,.18); /* 影 */
  text-decoration: none; /* 下線なし */
  cursor: pointer; /* 手カーソル */
}
.page-score .btn:hover {
  background: #ff7700; /* 少し濃く */
}
.page-score .btn.secondary {
  background: #607d8b; /* 青グレー */
}
.page-score .btn.secondary:hover {
  background: #546e7a; /* 少し濃く */
}

/* ---------------------------------
   フッター（固定）
--------------------------------- */
.page-score .site-footer {
  position: fixed; /* 下に固定 */
  left: 0; /* 左端 */
  right: 0; /* 右端 */
  bottom: 0; /* 下端 */
  height: 50px; /* 高さ */
  z-index: 1000; /* 前面 */
  background: rgba(255,255,255,0.10); /* うっすら白 */
  backdrop-filter: saturate(1.1) blur(4px); /* ガラスっぽさ */
  padding: 0 24px; /* 上下0・左右24 */
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  overflow: hidden; /* はみ出し防止 */
}
.page-score .footer-inner {
  max-width: 1100px; /* 最大幅 */
  margin: 0 auto; /* 中央寄せ */
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  justify-content: space-between; /* 左右配置 */
  width: 100%; /* 幅いっぱい */
  height: 100%; /* 高さ合わせ */
}
.page-score .footer-left {
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  gap: 10px; /* 間隔 */
}
.page-score .footer-mark {
  height: 22px; /* ロゴ高さ */
  width: auto; /* 比率維持 */
  display: block; /* 隙間対策 */
}
.page-score .footer-brand {
  font-weight: 700;
  color: #333;
}
.page-score .footer-nav {
  display: flex; /* 横並び */
  align-items: center; /* 縦中央 */
  gap: 10px; /* 間隔 */
  color: #333;
}
.page-score .footer-nav a {
  color: #333; /* リンク色 */
  text-decoration: none; /* 下線なし */
}
.page-score .footer-nav a:hover {
  text-decoration: underline; /* ホバーで下線 */
}
















/* =========================
   固定ページ（howto / parents / series / contact / contact_thanks）共通
========================= */
.page-static {
  height: 100vh;
  overflow: hidden;
  padding-top: 80px;
}

/* =========================
   ステージ（背景エリア）
   ※ 背景は center に統一
========================= */
.page-static .stage {
  position: relative;
  height: calc(100vh - 80px);
  padding: 16px 0 70px;
  overflow: hidden;
  background-image: url("../images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
}

/* =========================
   恐竜（index.php と同じ位置・大きさ）
   left: -10vw / top: 48% / translateY(-50%) / height: 70vh
   right: -8vw  / top: 25%                 / height: 50vh
========================= */
.page-static .side-dino {
  position: absolute;
  z-index: 2;
  width: auto;
  pointer-events: none;
  max-height: 95vh;
}

.page-static .side-dino.left {
  left: -12vw;
  top: 48%;
  transform: translateY(-50%);
  height: 70vh;
}

.page-static .side-dino.right {
  right: -10vw;
  top: 25%;
  height: 50vh;
}

/* =========================
   中央エリア（説明パネルを包む）
========================= */
.page-static .ui {
  position: relative;
  z-index: 3;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2vw;
  text-align: left;
}

/* =========================
   説明パネル
========================= */
.page-static .panel {
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.page-static .panel h1 {
  margin: 0 0 12px;
  text-align: center;
  font-size: 36px;
  font-weight: 800;
}

/* =========================
   手順ボックス（3等分）
========================= */
.page-static .steps {
  display: flex;
  gap: 12px;
}

.page-static .step {
  flex: 1 1 0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  font-size: 16px;
}

/* =========================
   補助テキスト
========================= */
.page-static .meta {
  margin: 12px 0 0;
  padding-left: 18px;
}

.page-static .note {
  display: block;
  margin-top: 6px;
  color: #666;
  font-size: 13px;
}













/* =========================================================
   固定ページ用のまとめ（ページ別）
   ※ 既存スタイルに影響しないよう、page-◯◯ で範囲を限定
========================================================= */

/* ===== HOWTO（ゲームの遊び方） ===== */
.page-howto .howto-steps {
  margin: 0;
  padding-left: 1.4em; /* 番号分のインデント */
  list-style: decimal; /* 1,2,3…の番号 */
}

.page-howto .howto-item {
  background: #fff; /* 白背景の箱 */
  border-radius: 14px;
  padding: 10px;
  margin: 0 0 8px 0; /* 各項目の間隔 */
}

.page-howto .howto-item p {
  margin: 0;
  text-align: left; /* 本文は左寄せ */
}

.page-howto .howto-item p + p {
  margin-top: 4px; /* タイトル行との間隔 */
}

.page-howto .howto-meta {
  margin: 10px 0 0;
  padding-left: 18px; /* ● の見栄え調整 */
}


/* ===== PARENTS（保護者の方へ） ===== */
.page-parents .parents-list {
  margin: 0;
  padding-left: 18px; /* 箇条書きのインデント */
  line-height: 1.6; /* 行間ゆったり */
  text-align: left;
}

.page-parents .parents-list li {
  margin: 0 0 6px 0;
}

.page-parents .parents-list .term {
  font-weight: 700; /* 見出しを太字 */
  display: block; /* 行頭で改行表示 */
}


/* ===== SERIES（シリーズ紹介） ===== */
.page-series .series-grid {
  display: grid; /* グリッドレイアウト */
  grid-template-columns: repeat(2, 320px); /* 320px×2列 */
  justify-content: center; /* 全体を中央寄せ */
  column-gap: 6px; /* 列間の余白 */
  row-gap: 6px; /* 行間の余白 */
}

.page-series .series-card {
  padding: 8px;
}

.page-series .series-title {
  font-weight: 700; /* 太字 */
  font-size: 20px; /* 少し大きめ */
  margin-bottom: 4px; /* 下余白 */
  text-align: center; /* 中央揃え */
}

.page-series .thumb {
  height: 135px; /* サムネの高さを統一 */
  display: flex; /* 画像の中央寄せ土台 */
  align-items: center; /* 縦中央 */
  justify-content: center; /* 横中央 */
  background: #fff; /* 白の土台 */
  border-radius: 10px;
}

.page-series .thumb img {
  max-width: 100%; /* はみ出し防止（横） */
  max-height: 100%; /* はみ出し防止（縦） */
  width: auto; /* 縦横比を維持 */
  height: auto; /* 縦横比を維持 */
  display: block; /* 画像下の隙間対策 */
}

.page-series .series-status {
  margin-top: 4px; /* 画像との間隔 */
  color: #666; /* サブ情報の色 */
  text-align: center; /* 中央揃え */
  font-size: 16px; /* 少し大きめ */
}


/* ===== CONTACT（お問い合わせ） ===== */
.page-contact .contact-form {
  text-align: left; /* ラベル→入力欄の並びに合わせる */
}

.page-contact .contact-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,248,220,.95);
  color: #6b4b00;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

.page-contact .form-grid {
  display: grid; /* 2列のグリッド */
  grid-template-columns: max-content 480px; /* 左：ラベル幅 / 右：入力域 */
  column-gap: 2px; /* ラベルと入力欄を“ほぼくっつける” */
  row-gap: 10px; /* 行間 */
  align-items: center; /* 縦位置を揃える */
  width: max-content; /* 中身の幅にフィット */
  margin: 0 auto; /* グリッド全体を中央配置 */
}

.page-contact .form-grid label {
  font-weight: 700; /* ラベル強調 */
  margin: 0; /* 余白はグリッドに任せる */
  white-space: nowrap; /* 「メッセージ：」の折返し防止 */
}

.page-contact .form-grid label[for="message"] {
  align-self: start; /* テキストエリアが縦長なので上揃え */
}

.page-contact .form-grid input[type="text"],
.page-contact .form-grid input[type="email"],
.page-contact .form-grid textarea {
  width: 400px; /* 指定どおりの幅 */
  padding: 8px; /* 入力しやすい余白 */
  border: 1px solid #ccc; /* 薄い枠線 */
  border-radius: 8px;
  height: 36px; /* input 高さ統一 */
}

.page-contact .form-grid textarea {
  height: auto; /* 自動高さ */
  min-height: 10em; /* rows="10" 相当 */
}

.page-contact .form-actions {
  display: flex; /* ボタン中央寄せ土台 */
  justify-content: center; /* ど真ん中に配置 */
  margin-top: 12px; /* 本体との間隔 */
}

.page-contact .btn-submit {
  min-width: 240px; /* 大きめで押しやすい */
  padding: 12px 24px; /* クリック領域を確保 */
  font-size: 18px; /* 視認性アップ */
  border: none; /* 枠線なし */
  border-radius: 28px; /* ころんとした丸み */
  background: #ff9900; /* 目立つオレンジ */
  color: #fff; /* 白文字 */
  cursor: pointer; /* 指カーソル */
}

.page-contact .btn-submit:hover {
  background: #ff7700; /* 濃い色でホバー感 */
}

.page-contact .btn-submit:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== ABOUT / PRIVACY TEXT PAGES ===== */
.page-about,
.page-privacy {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

.page-about .stage,
.page-privacy .stage {
  height: auto;
  min-height: calc(100vh - 80px);
  overflow: visible;
  padding-bottom: 86px;
}

.page-about .ui,
.page-privacy .ui {
  max-width: 880px;
}

.page-about .about-panel,
.page-privacy .privacy-panel {
  max-width: 860px;
  margin: 0 auto;
}

.page-about .about-panel section,
.page-privacy .privacy-panel section {
  margin: 0 0 16px;
}

.page-about .about-panel h2,
.page-privacy .privacy-panel h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.4;
  color: #333;
}

.page-about .about-panel p,
.page-privacy .privacy-panel p {
  margin: 0;
  line-height: 1.75;
}

.page-about .about-panel p + p {
  margin-top: 8px;
}

.page-privacy .privacy-panel a {
  color: #2468a8;
  font-weight: 700;
}

.page-privacy .policy-date {
  margin-top: 18px;
  font-weight: 700;
  text-align: right;
}






/* どのページでもヘッダー高さを統一して縦中央にする最終上書き */
.site-header,
.page-quiz .site-header,
.page-score .site-header {
  height: 80px;  /* 固定高さ */
  padding: 0 30px;
  align-items: center;  /* 念のため縦中央 */
}

/* =========================
   スマホ表示の最小調整
   PC版の雰囲気は保ちつつ、見切れと横はみ出しを防ぐ
========================= */
@media (max-width: 768px) {
  body,
  .page-input,
  .page-quiz,
  .page-score,
  .page-static {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0;
  }

  .site-header,
  .page-quiz .site-header,
  .page-score .site-header {
    position: static;
    height: auto;
    min-height: 72px;
    padding: 10px 14px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
  }

  .brand-mark,
  .page-quiz .brand-mark,
  .page-score .brand-mark {
    height: 38px;
  }

  .brand-text,
  .page-quiz .brand-text,
  .page-score .brand-text {
    font-size: 18px;
  }

  .site-nav ul,
  .page-quiz .site-nav ul,
  .page-score .site-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    font-size: 14px;
  }

  .site-footer,
  .page-quiz .site-footer,
  .page-score .site-footer {
    position: static;
    height: auto;
    min-height: 50px;
    padding: 8px 14px;
  }

  .footer-inner,
  .page-quiz .footer-inner,
  .page-score .footer-inner {
    height: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    text-align: center;
  }

  .footer-brand {
    font-size: 14px;
  }

  .footer-nav,
  .page-quiz .footer-nav,
  .page-score .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 13px;
  }

  .page-input .stage,
  .page-quiz .stage,
  .page-score .stage,
  .page-static .stage {
    height: auto;
    min-height: calc(100svh - 122px);
    padding: 12px 12px 28px;
    overflow: hidden;
    background-attachment: scroll;
  }

  .page-input .stage-title,
  .page-quiz .stage-title,
  .page-score .stage-title,
  .page-static .panel h1 {
    margin-top: 8px;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.25;
  }

  .page-quiz .question-text,
  .page-score .result-text {
    font-size: 1.15em;
  }

  .page-input .side-dino.left,
  .page-quiz .side-dino.left,
  .page-score .side-dino.left,
  .page-static .side-dino.left {
    left: -28vw;
    top: 120px;
    height: 44vh;
  }

  .page-input .side-dino.right,
  .page-quiz .side-dino.right,
  .page-score .side-dino.right,
  .page-static .side-dino.right {
    right: -30vw;
    top: 170px;
    height: 34vh;
  }

  .page-input .ui,
  .page-quiz .ui,
  .page-score .ui,
  .page-static .ui {
    max-width: 100%;
    margin-top: 12px;
    padding: 0;
  }

  .page-quiz .photo-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin: 12px auto 10px;
    max-width: 520px;
  }

  .page-quiz .animal-card {
    flex: 1 1 calc(50% - 10px);
    width: auto;
    max-width: 155px;
    min-width: 128px;
  }

  .page-quiz .animal-photo {
    height: 118px;
  }

  .page-quiz .answer-button {
    padding: 9px 10px;
    font-size: 15px;
  }

  .page-quiz .next-button {
    max-width: 100%;
    white-space: normal;
  }

  .page-input #nameOutput {
    width: 100%;
    max-width: 520px;
    height: 52px;
    font-size: 30px;
  }

  .page-input .form-row {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .page-input .grid-wrap {
    --kana-size: 38px;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .page-input .mark-col {
    grid-template-rows: repeat(5, var(--kana-size));
    grid-auto-columns: var(--kana-size);
    gap: 4px;
    flex: 0 0 auto;
  }

  .page-input .mark-col button,
  .page-input .grid button {
    width: var(--kana-size);
    height: var(--kana-size);
    font-size: 16px;
    padding: 0;
  }

  .page-input .mark-col .small {
    font-size: 12px;
  }

  .page-input .grid {
    grid-template-rows: repeat(5, var(--kana-size));
    grid-template-columns: repeat(11, var(--kana-size));
    gap: 4px;
    flex: 0 0 auto;
  }

  .page-contact .form-grid {
    width: 100%;
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .page-contact .form-grid label {
    white-space: normal;
  }

  .page-contact .form-grid input[type="text"],
  .page-contact .form-grid input[type="email"],
  .page-contact .form-grid textarea {
    width: 100%;
    max-width: 100%;
  }

  .page-contact .panel {
    padding: 18px 16px;
  }

  .page-contact .contact-notice {
    font-size: 14px;
    text-align: left;
  }

  .page-privacy .stage {
    padding: 14px 12px 24px;
  }

  .page-about .about-panel,
  .page-privacy .privacy-panel {
    padding: 18px 16px;
  }

  .page-about .about-panel h1,
  .page-privacy .privacy-panel h1 {
    font-size: clamp(25px, 7vw, 32px);
  }

  .page-about .about-panel h2,
  .page-privacy .privacy-panel h2 {
    font-size: 17px;
  }

  .page-about .about-panel p,
  .page-privacy .privacy-panel p {
    font-size: 14px;
    line-height: 1.75;
  }

  .page-privacy .policy-date {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page-quiz .animal-card {
    min-width: 118px;
    max-width: calc(50% - 6px);
  }

  .page-quiz .animal-photo {
    height: 96px;
  }

  .page-input .grid-wrap {
    --kana-size: 6.6vw;
    gap: 6px;
  }

  .page-input .mark-col button,
  .page-input .grid button {
    min-width: 24px;
    min-height: 24px;
    font-size: 14px;
  }

  .page-input .next-button,
  .page-input #deleteButton {
    width: min(100%, 180px);
    padding: 10px 12px;
  }

  .page-static .panel {
    border-radius: 14px;
    padding: 16px 14px;
  }
}

/* =========================
   スマホ表示の第2段階調整
   文字・説明・ボタンを装飾画像より優先して表示する
========================= */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body,
  .page-input,
  .page-quiz,
  .page-score,
  .page-static {
    overflow-y: auto;
  }

  .site-header,
  .page-quiz .site-header,
  .page-score .site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 8px 12px 10px;
    gap: 8px;
  }

  body:not(.page-static) .site-header .site-nav,
  body:not(.page-static).page-quiz .site-header .site-nav,
  body:not(.page-static).page-score .site-header .site-nav {
    display: none;
  }

  .brand,
  .page-quiz .brand,
  .page-score .brand {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }

  .header-subtitle {
    display: block;
    margin-top: -2px;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
  }

  .brand-text,
  .page-quiz .brand-text,
  .page-score .brand-text,
  .site-nav a,
  .page-quiz .site-nav a,
  .page-score .site-nav a {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .site-nav,
  .page-quiz .site-nav,
  .page-score .site-nav {
    width: 100%;
  }

  .site-nav ul,
  .page-quiz .site-nav ul,
  .page-score .site-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 360px);
    margin: 0 auto;
    gap: 6px;
  }

  .site-nav li,
  .page-quiz .site-nav li,
  .page-score .site-nav li {
    min-width: 0;
    text-align: center;
  }

  .site-nav a,
  .page-quiz .site-nav a,
  .page-score .site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.42);
    font-size: 13px;
    line-height: 1.25;
  }

  .site-nav li:nth-child(3),
  .page-quiz .site-nav li:nth-child(3),
  .page-score .site-nav li:nth-child(3) {
    grid-column: 1 / -1;
  }

  .hero {
    display: block;
    height: auto;
    min-height: auto;
    padding: 18px 14px 28px;
    overflow: hidden;
  }

  .hero-center {
    position: relative;
    z-index: 10;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .hero-dino {
    z-index: 1;
    opacity: .32;
    max-width: 60vw;
    height: auto;
  }

  .hero-dino.left {
    left: -22vw;
    top: 96px;
    height: auto;
    width: 55vw;
    transform: none;
  }

  .hero-dino.right {
    right: -24vw;
    top: 190px;
    height: auto;
    width: 50vw;
  }

  .hero .photo-row {
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px auto;
    max-width: 280px;
  }

  .hero .photo-row .animal-photo {
    width: 58px;
    height: 58px;
  }

  .hero .photo-row .animal-photo:nth-child(n+4) {
    display: none;
  }

  .hero-title {
    position: relative;
    z-index: 12;
    display: block;
    margin: 8px auto 9px;
    padding: 0;
    font-size: clamp(29px, 10vw, 39px);
    line-height: 1.12;
    text-shadow: 0 2px 10px rgba(255,255,255,.85);
  }

  .hero-title span {
    display: block;
  }

  .hero-description,
  .hero-prototype {
    position: relative;
    z-index: 12;
  }

  .hero-description {
    width: min(100%, 350px);
    margin: 7px auto 6px;
    padding: 0 4px;
    font-size: 13px;
    line-height: 1.55;
  }

  .hero-prototype {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: min(100%, 330px);
    margin: 0 auto 10px;
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 11px;
  }

  .hero-prototype strong {
    font-size: 12px;
  }

  .hero-button,
  .page-input .next-button,
  .page-input #deleteButton,
  .page-quiz .next-button,
  .page-score .btn,
  .page-contact .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86%;
    max-width: 360px;
    min-height: 48px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    line-height: 1.25;
  }

  .hero-button {
    position: relative;
    z-index: 12;
    font-size: 20px;
    padding: 12px 18px;
  }

  .footer-nav,
  .page-quiz .footer-nav,
  .page-score .footer-nav {
    width: 100%;
    gap: 6px 10px;
  }

  .mobile-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    width: 100%;
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-footer-links a {
    color: #555;
  }

  .desktop-footer-links {
    display: none;
  }

  .page-input .stage,
  .page-quiz .stage,
  .page-score .stage,
  .page-static .stage {
    min-height: auto;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .page-input .side-dino,
  .page-quiz .side-dino,
  .page-static .side-dino {
    z-index: 1;
    opacity: .28;
    max-width: 60vw;
  }

  .page-input .stage-title,
  .page-input .ui,
  .page-quiz .stage-title,
  .page-quiz .ui,
  .page-static .ui {
    position: relative;
    z-index: 5;
  }

  .page-quiz .answer-button {
    min-height: 42px;
    word-break: keep-all;
  }

  .page-quiz .player-name {
    font-size: .72em;
    line-height: 1.25;
  }

  .page-quiz .question-text {
    margin-top: 3px;
    font-size: 1.22em;
    line-height: 1.25;
  }

  .page-quiz .question-text span {
    display: block;
  }

  .page-score .stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 14px 30px;
    text-align: center;
  }

  .page-score .stage-title {
    position: relative;
    z-index: 5;
    order: 1;
    width: 100%;
    margin: 4px auto 14px;
    padding: 0 6px;
    line-height: 1.35;
  }

  .page-score canvas {
    z-index: 3 !important;
  }

  .page-score .player-name {
    font-size: 1.05em;
  }

  .page-score .result-text {
    display: inline-block;
    margin-top: 4px;
    font-size: 1.08em;
    line-height: 1.45;
  }

  .page-score .side-dino {
    display: none;
  }

  .page-score .ui {
    order: 2;
    position: relative;
    z-index: 4;
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .page-score .sway-wrap {
    overflow: visible;
    margin: 2px auto 14px;
  }

  .page-score .sway-dino {
    height: auto;
    width: min(44vw, 160px);
    max-width: 160px;
    animation: none;
    transform: none;
    filter: none;
  }

  .page-score .actions {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .page-score .actions form {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .page-score .btn {
    font-size: 18px;
    padding: 12px 18px;
  }

  .page-score .answer-review {
    width: min(100%, 340px);
    margin-top: 14px;
    padding: 12px 14px;
    text-align: left;
  }

  .page-score .answer-review h2 {
    font-size: 20px;
  }

  .page-score .answer-review ul {
    padding-left: 1em;
    font-size: 15px;
  }
}

/* =========================
   スマホ版クイズUIの調整
   5択を2列＋最後中央にし、判定をやさしく見せる
========================= */
@media (max-width: 768px) {
  .page-quiz .photo-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
    align-items: start;
    gap: 8px;
    width: min(100%, 340px);
    max-width: 340px;
    margin: 10px auto 8px;
  }

  .page-quiz .animal-card {
    width: 100%;
    max-width: 146px;
    min-width: 0;
  }

  .page-quiz .animal-card:nth-child(5) {
    grid-column: 1 / -1;
    width: calc(50% - 4px);
  }

  .page-quiz .animal-photo {
    height: 88px;
    border-radius: 9px;
  }

  .page-quiz .answer-button {
    min-height: 42px;
    margin-top: 5px;
    padding: 8px 8px;
    font-size: 15px;
    line-height: 1.2;
  }

  .page-quiz .judge {
    display: block;
    width: min(100%, 340px);
    min-height: 0;
    margin: 10px auto 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.86);
    font-size: clamp(22px, 6.2vw, 28px);
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    word-break: keep-all;
  }

  .page-quiz .judge:empty {
    display: none;
  }

  .page-quiz .judge--correct {
    color: #247a2f;
    border: 3px solid rgba(76,175,80,.72);
    box-shadow: 0 6px 18px rgba(76,175,80,.22);
  }

  .page-quiz .judge--try {
    color: #8a5b00;
    border: 3px solid rgba(255,193,7,.72);
    box-shadow: 0 6px 18px rgba(255,193,7,.18);
  }

  .page-quiz .animal-card.is-correct {
    padding: 5px;
    border-radius: 14px;
    outline: 4px solid #4caf50;
    background: rgba(232,255,232,.92);
    box-shadow: 0 8px 20px rgba(76,175,80,.24);
  }

  .page-quiz .animal-card.is-try {
    padding: 5px;
    border-radius: 14px;
    outline: 3px solid #ffc107;
    background: rgba(255,248,220,.9);
  }

  .page-quiz .answer-button.is-try {
    background: #f6a623;
  }
}

/* =========================
   公開前のスマホ最終調整
   空白・折り返し・ボタン主従・読みやすさの微調整
========================= */
@media (max-width: 768px) {
  .site-header,
  .page-quiz .site-header,
  .page-score .site-header {
    padding-top: 7px;
    padding-bottom: 8px;
  }

  .header-subtitle {
    font-size: 12px;
    color: #666;
  }

  .hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100svh - 154px);
    padding: 14px 14px 24px;
  }

  .hero .photo-row {
    max-width: 330px;
    gap: 10px;
  }

  .hero .photo-row .animal-photo {
    width: 72px;
    height: 72px;
  }

  .hero-title {
    font-size: clamp(34px, 11.4vw, 44px);
    line-height: 1.08;
    margin: 10px auto 14px;
  }

  .hero-dino {
    max-width: none;
    opacity: .56;
    filter: saturate(1.14) contrast(1.08);
  }

  .hero-dino.left {
    left: -42vw;
    top: clamp(64px, 18vw, 82px);
    width: min(76vw, 300px);
  }

  .hero-dino.right {
    right: -42vw;
    top: clamp(118px, 34vw, 150px);
    width: min(70vw, 276px);
  }

  .hero-button {
    min-height: 50px;
    font-size: 20px;
    padding: 13px 18px;
  }

  .page-input .stage-title span {
    display: block;
  }

  .page-input .stage-title {
    font-size: clamp(24px, 7.2vw, 31px);
    line-height: 1.25;
    margin-bottom: 10px;
  }

  .page-input .form-row {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 9px;
  }

  .page-input .next-button {
    order: 1;
    width: 86%;
    max-width: 340px;
    min-height: 50px;
    font-size: 18px;
    font-weight: 800;
    background: #43a047;
  }

  .page-input #deleteButton,
  .page-input .small-helper {
    order: 2;
    width: calc(50% - 6px);
    max-width: 162px;
    min-height: 42px;
    font-size: 15px;
    background: rgba(255,255,255,.86);
    color: #8a4b4b;
    border: 2px solid rgba(180,90,90,.35);
  }

  .page-input .small-helper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
  }

  .page-input #btnSmall {
    display: none;
  }

  .page-quiz .stage {
    background-position: center top;
  }

  .page-quiz .photo-row {
    gap: 9px;
    margin-top: 8px;
  }

  .page-quiz .animal-card {
    max-width: 148px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 5px 16px rgba(0,0,0,.12);
  }

  .page-quiz .animal-card:nth-child(5) {
    width: calc(50% + 2px);
  }

  .page-quiz .animal-photo {
    height: 86px;
  }

  .page-quiz .answer-button {
    min-height: 43px;
    font-size: 15px;
  }

  .page-quiz .judge {
    margin-top: 11px;
    padding: 11px 12px;
    font-size: clamp(21px, 5.8vw, 26px);
    line-height: 1.32;
  }

  .page-quiz .next-wrap {
    margin-top: 9px;
  }

  .page-quiz .next-button {
    width: 86%;
    max-width: 340px;
    min-height: 50px;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    background: #43a047;
  }

  .page-score .result-text {
    font-size: clamp(28px, 7.8vw, 34px);
    line-height: 1.25;
  }

  .page-score .score-line {
    display: block;
  }

  .page-score .result-note {
    display: inline-block;
    margin-top: 6px;
    font-size: .68em;
    line-height: 1.35;
  }

  .page-score .player-name {
    font-size: .9em;
  }

  .mobile-footer-links {
    font-size: 11px;
    gap: 3px 9px;
  }

  .site-footer .footer-nav,
  .site-footer .footer-nav a,
  .site-footer .footer-nav small,
  .site-footer .mobile-footer-links,
  .site-footer .mobile-footer-links a,
  .page-quiz .site-footer .footer-nav,
  .page-quiz .site-footer .footer-nav a,
  .page-quiz .site-footer .footer-nav small,
  .page-score .site-footer .footer-nav,
  .page-score .site-footer .footer-nav a,
  .page-score .site-footer .footer-nav small {
    font-size: 12px;
    line-height: 1.35;
  }

  .site-footer .mobile-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    width: min(100%, 360px);
    gap: 3px 6px;
    padding-bottom: 4px;
    margin: 0 auto 4px;
    border-bottom: 1px solid rgba(0,0,0,.08);
  }

  .site-footer .mobile-footer-links a {
    display: block;
    min-width: 0;
    padding: 2px 4px;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .site-footer .desktop-footer-link {
    display: none;
  }

  .site-footer .desktop-footer-links {
    display: none;
  }
}

/* =========================
   主要ゲームページのスマホ恐竜位置調整
========================= */
@media (max-width: 768px) {
  .page-input .stage,
  .page-quiz .stage,
  .page-score .stage {
    overflow-x: hidden;
  }

  .page-input .side-dino,
  .page-quiz .side-dino,
  .page-score .side-dino {
    z-index: 1;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    pointer-events: none;
    filter: saturate(1.12) contrast(1.06);
  }

  .page-input .side-dino {
    opacity: .48;
  }

  .page-input .side-dino.left {
    left: -42vw;
    top: clamp(64px, 18vw, 84px);
    width: min(76vw, 300px);
  }

  .page-input .side-dino.right {
    right: -42vw;
    top: clamp(118px, 34vw, 150px);
    width: min(70vw, 276px);
  }

  .page-quiz .side-dino {
    opacity: .32;
  }

  .page-quiz .side-dino.left {
    left: -46vw;
    top: clamp(58px, 16vw, 76px);
    width: min(70vw, 270px);
  }

  .page-quiz .side-dino.right {
    right: -34vw;
    top: clamp(96px, 28vw, 128px);
    width: min(62vw, 246px);
  }

  .page-score .side-dino {
    opacity: .28;
  }

  .page-score .side-dino.left {
    left: -48vw;
    top: clamp(72px, 20vw, 96px);
    width: min(68vw, 268px);
  }

  .page-score .side-dino.right {
    right: -36vw;
    top: clamp(126px, 36vw, 164px);
    width: min(60vw, 236px);
  }
}

/* =========================
   index.php スマホ下部リンクの収まり調整
========================= */
@media (max-width: 768px) {
  body:not([class]) .site-footer {
    min-height: 0;
    padding: 4px 10px 3px;
  }

  body:not([class]) .site-footer .footer-inner {
    gap: 2px 8px;
  }

  body:not([class]) .site-footer .footer-left {
    gap: 6px;
  }

  body:not([class]) .site-footer .footer-mark {
    height: 18px;
  }

  body:not([class]) .site-footer .footer-brand {
    font-size: 11px;
    line-height: 1.1;
  }

  body:not([class]) .site-footer .footer-nav,
  body:not([class]) .site-footer .footer-nav small {
    gap: 2px 6px;
    line-height: 1.15;
  }

  body:not([class]) .site-footer .mobile-footer-links {
    gap: 0 5px;
    padding-bottom: 2px;
    margin-bottom: 2px;
  }

  body:not([class]) .site-footer .mobile-footer-links a {
    min-height: 17px;
    padding: 0 3px;
    line-height: 1.15;
  }
}

/* =========================
   series.php スマホ表示のはみ出し調整
========================= */
@media (max-width: 768px) {
  .page-series .stage {
    overflow-x: hidden;
    overflow-y: visible;
  }

  .page-series .ui {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  .page-series .panel {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .page-series .series-grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    width: min(100%, 360px);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    column-gap: 0;
    row-gap: 12px;
  }

  .page-series .series-card {
    width: 100%;
    max-width: 340px;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .page-series .thumb {
    width: 100%;
    max-width: 100%;
    height: clamp(116px, 34vw, 135px);
    box-sizing: border-box;
    overflow: hidden;
  }

  .page-series .thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .page-series .series-title,
  .page-series .series-status {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }
}

/* =========================
   全ページ共通フッター統一
========================= */
.footer-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.footer-home:hover {
  text-decoration: none;
}

@media (min-width: 769px) {
  .site-footer,
  .page-quiz .site-footer,
  .page-score .site-footer,
  .page-static .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    min-height: 70px;
    padding: 6px 24px;
    overflow: hidden;
  }

  .footer-inner,
  .page-quiz .footer-inner,
  .page-score .footer-inner,
  .page-static .footer-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand links"
      "copy copy";
    align-items: center;
    justify-content: center;
    gap: 4px 18px;
    width: 100%;
    max-width: 1180px;
    height: auto;
    text-align: center;
  }

  .footer-left,
  .page-quiz .footer-left,
  .page-score .footer-left,
  .page-static .footer-left {
    grid-area: brand;
    justify-content: center;
    min-width: 0;
  }

  .footer-nav,
  .page-quiz .footer-nav,
  .page-score .footer-nav,
  .page-static .footer-nav {
    display: contents;
  }

  .mobile-footer-links {
    display: none;
  }

  .desktop-footer-links,
  .page-quiz .desktop-footer-links,
  .page-score .desktop-footer-links,
  .page-static .desktop-footer-links {
    grid-area: links;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
  }

  .desktop-footer-links a,
  .page-quiz .desktop-footer-links a,
  .page-score .desktop-footer-links a,
  .page-static .desktop-footer-links a {
    white-space: nowrap;
  }

  .footer-nav small,
  .page-quiz .footer-nav small,
  .page-score .footer-nav small,
  .page-static .footer-nav small {
    grid-area: copy;
    display: block;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
  }
}

@media (max-width: 768px) {
  .site-footer .footer-left,
  .page-quiz .site-footer .footer-left,
  .page-score .site-footer .footer-left,
  .page-static .site-footer .footer-left {
    justify-content: center;
  }

  .site-footer .footer-home,
  .page-quiz .site-footer .footer-home,
  .page-score .site-footer .footer-home,
  .page-static .site-footer .footer-home {
    gap: 6px;
  }

  .site-footer .desktop-footer-links,
  .page-quiz .site-footer .desktop-footer-links,
  .page-score .site-footer .desktop-footer-links,
  .page-static .site-footer .desktop-footer-links {
    display: none;
  }

  .site-footer .mobile-footer-links,
  .page-quiz .site-footer .mobile-footer-links,
  .page-score .site-footer .mobile-footer-links,
  .page-static .site-footer .mobile-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 360px);
    gap: 3px 6px;
    margin: 0 auto 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0,0,0,.08);
  }

  .site-footer .mobile-footer-links a,
  .page-quiz .site-footer .mobile-footer-links a,
  .page-score .site-footer .mobile-footer-links a,
  .page-static .site-footer .mobile-footer-links a {
    display: block;
    min-width: 0;
    padding: 2px 4px;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
}

/* =========================
   score.php 紙吹雪レイヤー調整
========================= */
.page-score canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 999999 !important;
}

body.page-score {
  overflow-x: hidden;
}

.page-score .stage {
  overflow-x: clip;
}
