/* styles.css */
/* ============================================================================
   HALLUCINATION CERTIFICATION - PREMIUM AUTHORITY DESIGN
   ベルベット調 × 金縁の「ハルシネーション検定」プレミアムUI
   ============================================================================ */

:root {
  /* === ベース背景カラー === */
  --navy-900: #07111f;
  --navy-800: #0b1c2e;
  --navy-700: #10243a;
  --navy-600: #142b45;

  /* === ゴールド系アクセント === */
  --gold-main: #d8b86b;
  --gold-bright: #f3dd9b;
  --gold-dark: #8a6e2f;

  /* === テキストカラー === */
  --text-1: #f7ecd2;
  --text-2: #d4c5a8;
  --text-3: #a89775;

  /* === 正誤カラー === */
  --ok: #43c37b;
  --ng: #e15b6b;
  --idle: #5a4d2e;

  /* === フォント & 共通レイアウト === */
  --font-display: "Shippori Mincho", "Noto Serif JP", "Times New Roman", serif;
  --font-body: "Shippori Mincho", "Noto Serif JP", "Times New Roman", serif;

  --btn-h: 58px;
  --g-1: 10px;
  --g-2: 16px;
  --g-3: 24px;
  --g-4: 36px;

  /* === 影・グロー表現 === */
  --shadow-deep: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-mid: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* === リセット === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === body 基本 === */
body {
  min-height: 100vh;
  margin: 0;
  padding: 16px 12px 24px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-1);
  background:
    radial-gradient(1200px 800px at 85% -10%, #132a48 0%, #07111f 60%),
    radial-gradient(1000px 600px at 10% 110%, #0f223b 0%, rgba(7, 17, 31, 0) 60%),
    #07111f;
}


/* === アプリ全体レイアウト === */
.app.layout {
  width: 100%;
  max-width: 1400px;
  min-height: 85vh;
  margin: 0 auto;
  /* ここで横方向の中央寄せ */
  display: grid;
  grid-template-columns: 300px minmax(520px, 1fr) 320px;
  gap: var(--g-4);
}

/* === ページ全体のロゴ＆フッター（カード枠の外） === */
.page-header,
.page-footer {
  max-width: 1400px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* フッター内リンクのスタイル */
.page-footer a {
  color: var(--gold-dark);
  /* コピーライトと同じ色 */
  text-decoration: none;
  /* 下線なし */
  font-size: 0.7rem;
  /* コピーライトと同じくらい */
  margin: 0 4px;
  /* ちょっとだけ間隔 */
}

/* ホバー時だけ少しだけ強調 */
.page-footer a:hover {
  color: var(--gold-main);
  /* 少し明るい金色 */
  text-decoration: underline;
  /* うっすら下線 */
}


/* 上のロゴ行 */
.page-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* 下のフッター行（縦方向にテキストを積む） */
.page-footer {
  flex-direction: column;
  padding-top: 8px;
  padding-bottom: 8px;
  text-align: center;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--gold-dark);
}

/* 仕切りとリンク */
.footer-separator {
  margin: 0 0.35em;
  opacity: 0.6;
}

.footer-link {
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.7rem;
}

.footer-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}



/* === カード共通枠 === */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--g-3);
  border-radius: 16px;
  background:
    radial-gradient(160% 100% at 50% -20%, rgba(20, 43, 69, 0.35), rgba(20, 43, 69, 0)),
    linear-gradient(180deg, #0f2036 0%, #0b1727 100%);
  border: 1px solid rgba(216, 184, 107, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 6px rgba(216, 184, 107, 0.08);
}

.card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(216, 184, 107, 0.12);
  border-radius: 12px;
  pointer-events: none;
}

/* === 左カラム === */
.left-col {
  align-items: center;
  text-align: center;
}

.brand-mark svg {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.app-title {
  font-family: var(--font-display);
  color: var(--gold-main);
  margin: var(--g-3) 0;
  line-height: 1.2;
}

.app-title span {
  display: block;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
}

.app-title em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.tagline {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: var(--g-4);
}

/* === 中央カラム（問題部分） === */
.center-col {
  padding: 40px;
}

.center-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* baseline → center 推奨 */
  border-bottom: 1px solid rgba(216, 184, 107, 0.25);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* 追加：右側の「リング＋N/10」コンテナ */
.center-progress {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* 追加：小さい進捗リング */
.center-progress-ring {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(60% 60% at 50% 40%, #101c2f 0%, #0b1727 100%);
  box-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.05),
    0 0 0 4px rgba(216, 184, 107, 0.12);
}

.center-progress-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, #d8b86b) calc(var(--pct, 0) * 1%),
      rgba(216, 184, 107, 0.08) 0);
  mask: radial-gradient(closest-side, transparent 68%, black 69%);
  opacity: 0.95;
}

.center-progress-ring-inner {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-bright);
}


.center-title {
  color: var(--gold-main);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  opacity: 0.9;
}

.counter {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 1.1rem;
}

.question-box {
  margin-bottom: 24px;
}

.question-text {
  font-size: 1.15rem;
  line-height: 1.85;
  color: #f8efd8;
  margin: 6px 0 12px;
}

/* === 選択肢 === */
.choices-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.choice-btn {
  background: linear-gradient(180deg, #0f2036 0%, #0b1727 100%);
  border-radius: 12px;
  border: 1px solid rgba(216, 184, 107, 0.28);
  color: var(--text-1);
  padding: 14px 16px;
  text-align: left;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.choice-btn:hover:not(:disabled),
.choice-btn:focus-visible:not(:disabled) {
  outline: none;
  border-color: rgba(243, 221, 155, 0.65);
  box-shadow: 0 0 0 2px rgba(243, 221, 155, 0.18);
  transform: translateY(-1px);
}

.choice-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.choice-btn.correct {
  border-color: rgba(67, 195, 123, 0.7);
  box-shadow: 0 0 0 2px rgba(67, 195, 123, 0.18);
  background: linear-gradient(180deg, rgba(67, 195, 123, 0.22), rgba(15, 32, 54, 1));
}

.choice-btn.wrong {
  border-color: rgba(225, 91, 107, 0.7);
  box-shadow: 0 0 0 2px rgba(225, 91, 107, 0.18);
  background: linear-gradient(180deg, rgba(225, 91, 107, 0.22), rgba(15, 32, 54, 1));
}

/* True / False のときだけ 2列 */
.choices-stack[data-kind="tf"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 0;
}

.choices-stack[data-kind="tf"] .choice-btn {
  text-align: center;
}

/* === 判定エリア === */
.judge-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  min-height: 40px;
}

.judge-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-family: var(--font-display);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.judge-badge.is-idle {
  opacity: 0;
}

.judge-badge.is-correct {
  opacity: 1;
  background: var(--ok);
  color: #091520;
  box-shadow: 0 0 10px var(--ok);
}

.judge-badge.is-wrong {
  opacity: 1;
  background: var(--ng);
  color: #fff;
  box-shadow: 0 0 10px var(--ng);
}

.judge-note {
  color: var(--text-3);
  font-size: 0.9rem;
}

/* === 解説 === */
.explain-box {
  background: rgba(216, 184, 107, 0.1);
  border: 1px solid rgba(216, 184, 107, 0.3);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.explain-head {
  font-weight: bold;
  color: var(--gold-main);
  margin-bottom: 8px;
}

.explain-text {
  font-size: 0.95rem;
}

/* === 次へボタン行 === */
.nav-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

/* === 右カラム（スコア・進捗） === */
.right-col {
  align-items: center;
}

.score-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.score-emblem {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(60% 60% at 50% 40%, #101c2f 0%, #0b1727 100%);
  box-shadow:
    inset 0 2px 14px rgba(255, 255, 255, 0.05),
    0 0 0 7px rgba(216, 184, 107, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.5);
}

.score-emblem::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, #d8b86b) calc(var(--pct, 0) * 1%), rgba(216, 184, 107, 0.08) 0);
  mask: radial-gradient(closest-side, transparent 68%, black 69%);
  opacity: 0.95;
}

.emblem-inner {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-main);
}

.score-line {
  font-size: 2rem;
  font-weight: bold;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.rank-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-main);
  margin: 10px 0 18px;
  text-align: center;
  min-height: 1.6em;
}

/* === 進捗ドット === */
.progress-wrap {
  margin-bottom: 24px;
  width: 100%;
}

.progress-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
}

.progress-dots li {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(216, 184, 107, 0.28), rgba(216, 184, 107, 0.18));
  box-shadow: inset 0 0 0 1px rgba(216, 184, 107, 0.22);
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.progress-dots li.is-active {
  background: linear-gradient(180deg, #f3dd9b, #d8b86b);
  transform: translateY(-1px);
  box-shadow: 0 0 8px var(--gold-main);
}

.progress-dots li.is-completed {
  background: linear-gradient(180deg, rgba(243, 221, 155, 0.85), rgba(216, 184, 107, 0.85));
  opacity: 0.95;
}

/* === セッション情報・履歴 === */
.session-stats {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* === 評価ブロック === */
.evaluation-box {
  margin-bottom: 20px;
}

.evaluation-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--gold-main);
  text-align: center;
  margin-bottom: 4px;
}

.evaluation-label {
  font-size: 0.8rem;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 4px;
}

.evaluation-message {
  font-size: 0.9rem;
  color: var(--text-1);
}


.evaluation-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold-main);
  margin-bottom: 4px;
}

.evaluation-message {
  font-size: 0.9rem;
  color: var(--text-2);
}

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.stat:last-child {
  margin-bottom: 0;
}

.stat-label {
  text-align: left;
}

.stat-value {
  text-align: right;
  color: var(--text-1);
}

/* === 本日のプレイ履歴 === */
.history-wrap {
  margin-top: 12px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  width: 100%;
}

.history-head {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--gold-main);
}

.history-list {
  list-style: none;
}

.history-list li {
  display: grid;
  /* 「◯回目」の幅を少し削って、称号側に回す */
  grid-template-columns: 3.4em minmax(0, 1fr);
  /* すき間も少しだけ詰める */
  column-gap: 0.55rem;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(216, 184, 107, 0.18);
  /* 全体をほんの少しだけ小さくして収まりを良くする */
  font-size: 0.8rem;
}

.history-list li:last-child {
  border-bottom: none;
}

/* 「◯回目」は右寄せ、「称号」は左寄せ */
.history-run {
  text-align: right;
}

.history-rank {
  text-align: left;
}


/* === 右下アクション === */
.right-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}


/* === ボタン共通 === */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  min-height: var(--btn-h);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

.btn.primary {
  background: linear-gradient(180deg, #f6e7bc 0%, #e9cd85 55%, #d8b86b 100%);
  color: var(--navy-900);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.35);
}

.btn.primary:hover {
  filter: brightness(1.04) saturate(1.02);
}

.btn.primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 rgba(0, 0, 0, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.35);
}

.btn.ghost {
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--gold-main);
  color: var(--gold-main);
}

/* コピー用の少し控えめなボタン */
.btn.subtle {
  opacity: 0.85;
  font-size: 0.85rem;
  padding: 10px 18px;
}

.btn.subtle:hover {
  opacity: 1;
}

.btn.ghost:hover {
  background: rgba(216, 184, 107, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === フッター（各カラム共通） === */
.left-footer,
.center-footer,
.right-footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold-dark);
}

.footer-tagline {
  font-family: var(--font-display);
  color: var(--text-2);
  margin-bottom: 4px;
  font-size: 0.7rem;
  opacity: 0.85;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--gold-dark);
}

/* === レスポンシブ：スマホ・タブレット === */
@media (max-width: 900px) {
  .app.layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card {
    padding: 20px;
  }

  /* ▼ スマホ終了画面：縦スクロールなしで収める用の調整 */
  body.is-finished .app.layout {
    /* 85vh のせいでヘッダー＋フッターと合わせると 100vh を超えるので解除 */
    min-height: auto;
  }

  body.is-finished .right-col.card {
    /* 結果カードの内側余白を少しだけ詰める */
    padding: 16px 16px 14px;
  }

  body.is-finished .score-wrap {
    margin-bottom: 12px;
  }

  body.is-finished .rank-title {
    margin: 6px 0 10px;
    font-size: 1.1rem;
  }

  body.is-finished .progress-wrap {
    margin-bottom: 12px;
  }

  body.is-finished .evaluation-box {
    margin-bottom: 12px;
  }

  body.is-finished .session-stats {
    margin-bottom: 10px;
    padding: 10px;
  }

  body.is-finished .history-wrap {
    margin-top: 8px;
  }

  body.is-finished .right-actions {
    margin-top: 12px;
  }


  /* スタート画面中：左カラムだけを中央寄せ表示 */
  body.is-start .left-col {
    display: flex;
    max-width: 480px;
    width: 100%;
    margin: 24px auto;
  }

  body.is-start .center-col,
  body.is-start .right-col {
    display: none;
  }

  /* クイズ中：中央パネルだけ表示（左・右は隠す） */
  body.is-quiz .center-col {
    display: flex;
    order: 1;
    width: 100%;
  }

  body.is-quiz .right-col,
  body.is-quiz .left-col {
    display: none;
  }

  /* 結果画面：中央 → 右 の順で縦並び。左は非表示（ナビ専用） */
  body.is-finished .center-col,
  body.is-finished .right-col {
    display: flex;
    width: 100%;
  }

  body.is-finished .center-col {
    order: 1;
  }

  body.is-finished .right-col {
    order: 2;
  }

  body.is-finished .left-col {
    display: none;
  }


  .center-col {
    padding: 24px 18px 20px;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .score-wrap,
  .session-stats,
  .history-wrap,
  .right-actions {
    width: 100%;
  }

  .nav-row {
    justify-content: center;
  }

  .page-header,
  .page-footer {
    max-width: 100%;
    margin: 8px auto;
  }
}


/* T/F もスマホでは縦1列 */
@media (max-width: 560px) {
  .choices-stack[data-kind="tf"] {
    grid-template-columns: 1fr;
  }
}

/* === スマホ：終了時は結果パネルだけ表示 === */
@media (max-width: 900px) {

  /* 終了状態では左・中央を消して、結果パネルだけ 1 枚にする */
  body.is-finished .left-col,
  body.is-finished .center-col {
    display: none;
  }

  /* すでにあるレスポンシブ設定の中に追加 */
  .page-header,
  .page-footer {
    max-width: 100%;
    margin: 8px auto;
  }
}

body.is-finished .right-col {
  display: flex;
  order: 1;
  width: 100%;
}

/* === About Modal: ハルシネーション検定について === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 22, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}

.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  position: relative;
  max-width: 640px;
  width: 92%;
  max-height: 88vh;
  padding: 26px 28px 24px;
  border-radius: 20px;

  /* 内側の濃紺 + 外側の金枠 */
  background:
    linear-gradient(#0b1727, #07111f) padding-box,
    linear-gradient(135deg, var(--gold-bright), var(--gold-main), #b88b3c) border-box;
  border: 1px solid transparent;

  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(243, 221, 155, 0.18);
  color: var(--text-1);
  overflow-y: auto;
}

.modal-header h2 {
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  font-size: 1.05rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.modal-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.modal-body strong {
  color: var(--text-1);
  font-weight: 600;
}

.modal-body h3 {
  font-size: 0.95rem;
  margin: 0.3rem 0 0.4rem;
  color: var(--text-1);
}

.modal-list {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-2);
}

.modal-list li+li {
  margin-top: 0.25rem;
}

.modal-note {
  font-size: 0.8rem;
  color: var(--text-3);
  border-top: 1px solid rgba(243, 221, 155, 0.16);
  padding-top: 0.6rem;
  margin-top: 0.9rem;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.1rem;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(243, 221, 155, 0.4);
  background: radial-gradient(circle at 30% 20%, #18263b, #050910);
  color: var(--gold-bright);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.modal-close-btn:hover {
  filter: brightness(1.1);
}

.modal-close-btn:active {
  transform: translateY(1px);
}

@media (max-width: 600px) {
  .modal-dialog {
    width: 94%;
    padding: 20px 18px 18px;
    border-radius: 18px;
  }

  .modal-body p,
  .modal-list,
  .modal-note {
    font-size: 0.85rem;
  }

  .modal-links {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 左カラムのボタン間を少しだけ空ける */
.left-col .btn {
  width: 100%;
  max-width: 230px;
}

.left-col .btn+.btn {
  margin-top: 10px;
  /* 「この検定について」と「はじめる」の間隔。お好みで調整 */
}

/* === 結果画面：称号・評価ブロックの調整 === */

/* 称号（例：新米AIユーザー）を少し大きく＆余白を詰める */
.rank-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  /* もとの 1.2rem よりほんの少し大きく */
  color: var(--gold-main);
  margin: 8px 0 12px;
  /* 下の余白を詰める */
  text-align: center;
}

/* 評価ボックスを少しコンパクトに */
.evaluation-box {
  margin-bottom: 14px;
}

/* 1行目タイトル */
.evaluation-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--gold-main);
  text-align: center;
  margin-bottom: 6px;
}

/* 2行目「評価：〜」を1行でセンター表示 */
.evaluation-line {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* 「評価：」の部分 */
.evaluation-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--gold-main);
  margin-right: 0.25em;
}

/* メッセージ部分（AIの幻覚に〜） */
.evaluation-message {
  font-size: 0.85rem;
  color: var(--text-2);
}

/* 今回／今日は の箱も少し詰める */
.session-stats {
  margin-bottom: 12px;
  padding: 10px;
}

/* 本日のプレイ履歴の箱も少し詰める */
.history-wrap {
  margin-top: 8px;
  padding: 10px;
}


/* === スマホ（終了画面）の圧縮レイアウト === */
@media (max-width: 900px) {

  /* 結果画面だけ、カードの縦サイズを抑える */
  body.is-finished .app.layout {
    min-height: auto;
  }

  body.is-finished .right-col.card {
    padding: 16px 16px 12px;
  }

  body.is-finished .score-wrap {
    margin-bottom: 12px;
  }

  body.is-finished .rank-title {
    margin-bottom: 10px;
  }

  body.is-finished .evaluation-box {
    margin-bottom: 10px;
  }

  body.is-finished .session-stats {
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  body.is-finished .history-wrap {
    margin-top: 8px;
    padding: 8px 10px;
  }

  /* ボタンを少し小さめに＆間隔も詰める */
  body.is-finished .right-actions {
    margin-top: 10px;
    justify-content: center;
    gap: 8px;
  }

  body.is-finished .right-actions .btn {
    padding: 8px 16px;
    /* もとの 12px 24px より小さく */
    min-height: 38px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
  }

  /* ==== アフィリエイト枠：PC/スマホ共通 ==== */

  /* 左カラムのボタンのすぐ下でコンパクト表示 */
  .left-col .affiliate-slot {
    margin-top: 10px;
    padding: 4px 10px 0;
    text-align: center;
  }

  /* 「※プロモーション」ラベル（ここで必ず描画させる） */
  .left-col .affiliate-slot::before {
    content: "※プロモーション";
    /* ← これが消える原因になりやすいので確定で指定 */
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 2px;
    /* ラベルとリンクを少しだけ詰める */
    opacity: 0.5;
  }

  /* リンクテキスト：小さめ＆はみ出し防止 */
  .left-col .affiliate-slot a {
    font-size: 0.6rem;
    color: var(--text-3);
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    line-height: 1.3;
    word-break: break-all;
  }
}

/* ==== アフィリエイト枠：PC/スマホ共通 ==== */

/* 左カラムのボタンのすぐ下でコンパクト表示 */
.left-col .affiliate-slot {
  margin-top: 10px;
  padding: 4px 10px 0;
  text-align: center;
}

/* 「※プロモーション」ラベル（ここで必ず描画させる） */
.left-col .affiliate-slot::before {
  content: "※プロモーション";
  display: block;
  font-size: 0.6rem;
  color: var(--text-2);
  /* ← var(--text-muted) だと未定義なので text-2 を使う */
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  opacity: 0.5;
}

/* リンクテキスト：小さめ＆はみ出し防止 */
.left-col .affiliate-slot a {
  font-size: 0.6rem;
  color: var(--text-3);
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  line-height: 1.3;
  word-break: break-all;
}

.left-col .affiliate-slot a:hover {
  opacity: 0.9;
  text-decoration: underline;
}

/* 結果パネル右下の3ボタンを同じサイズ感にそろえる */
body.is-finished .right-actions .btn {
  min-height: 46px;
  /* 高さそろえ */
  padding: 10px 24px;
  /* 上下の余白も同じに */
  font-size: 0.9rem;
  /* 文字サイズ統一 */
  letter-spacing: 0.12em;
}

/* 右カラム内ではボタンの横幅もそろえる */
body.is-finished .right-actions {
  flex-direction: column;
  align-items: center;
  /* 真ん中に縦並び */
}

body.is-finished .right-actions .btn {
  width: 100%;
  max-width: 260px;
  /* お好みで 240〜280px あたりに調整可 */
  text-align: center;
}

/* ▼ スマホのスタート画面だけ、左カラムのボタンを少し細身にする */
@media (max-width: 560px) {
  body.is-start .left-col .btn {
    max-width: 210px;
    /* 幅を少しだけキュッと */
    min-height: 46px;
    /* 高さもほんの少し低めに */
    padding: 10px 20px;
    /* 上下左右の余白をコンパクトに */
    font-size: 0.9rem;
    /* 文字もほんの少しだけ小さく */
  }

  /* ボタン同士の間隔も少し詰める */
  body.is-start .left-col .btn+.btn {
    margin-top: 8px;
  }
}

/* === 右カラムの3ボタンを PC / スマホ共通で同じサイズにそろえる === */
.right-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  /* 縦一列 */
  align-items: flex-end;
  /* ★ デフォルトは右寄せ（PC向け） */
  gap: 10px;
  width: 100%;
}

.right-actions .btn {
  width: 100%;
  max-width: 260px;
  /* 横幅お好みで調整 */
  min-height: 46px;
  padding: 10px 24px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ============================================================
   Legal pages (privacy / terms)
   ============================================================ */

body.legal-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px 12px 32px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-1);
  background:
    radial-gradient(1200px 800px at 85% -10%, #132a48 0%, #07111f 60%),
    radial-gradient(1000px 600px at 10% 110%, #0f223b 0%, rgba(7, 17, 31, 0) 60%),
    #07111f;
}

.legal-main {
  max-width: 900px;
  margin: 0 auto;
}

.legal-card {
  margin: 32px auto 16px;
  padding: 28px 26px 24px;
}

.legal-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--gold-main);
  margin-bottom: 16px;
  text-align: center;
}

.legal-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold-bright);
  margin-top: 18px;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.legal-card p,
.legal-card ul {
  font-size: 0.9rem;
  color: var(--text-2);
}

.legal-card ul {
  padding-left: 1.2rem;
  margin: 4px 0 8px;
}

.legal-card li+li {
  margin-top: 2px;
}

.legal-intro {
  margin-bottom: 10px;
}

.legal-updated {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-3);
}

.legal-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-3);
}

.legal-card a {
  color: var(--gold-bright);
  text-decoration: underline;
}

.legal-card a:hover {
  text-decoration: none;
}

/* スマホ時は少し余白を詰める */
@media (max-width: 640px) {
  .legal-card {
    padding: 22px 16px 18px;
  }

}

/* プライバシーポリシー・利用規約ページ用「トップへ戻る」ボタン位置 */
.legal-back {
  margin-top: 24px;
  text-align: center;
}

/* スマホでは少しだけ詰める */
@media (max-width: 640px) {
  .legal-back {
    margin-top: 18px;
  }
}