/* =============================
   styles.css（ブログ1ページ＋ヘッダー右上に検索）
   初心者向けコメント付き
   ============================= */

/* === 1) リセット＆基本設定 ====================== */
/* すべての要素のボックスサイズを「枠線込み」に統一（レイアウト崩れを防ぐ） */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ページ全体の高さを100%にしておく（必要に応じて使える） */
html,
body {
  height: 100%;
}

/* 基本の文字設定と行間。日本語では少し広めの行間が読みやすい */
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans KR", "Noto Sans JP", sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* メインコンテンツは縦に伸びる */
main {
  flex: 1;
}

/* 画像は親の幅を超えないようにする */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === 2) カラーテーマ（変数） ==================== */
/* SVA 風の濃いネイビー＋シアンアクセント */
:root {
  --bg: #020617;
  /* ページ全体のベース（ほぼ黒） */
  --bg-soft: #020617;
  --fg: #f9fafb;
  /* メイン文字色（ほぼ白） */
  --muted: #dee7f8;
  /* サブテキスト */
  --border: #1f2937;
  /* 罫線 */
  --surface: #050816;
  /* セクションの背景カード色 */
  --surface-soft: #0b1120;
  --primary: #38bdf8;
  /* アクセント（シアン） */
  --primary-soft: #0ea5e9;
  --accent: #facc15;
  /* 差し色のゴールド */

  --maxw: 1040px;
  /* コンテンツ幅を少し広めに */
  --radius: 4px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .75);

  /* ===== VIGNETTE controls ===== */
  --vgn-inner: 52%;
  /* 明るい中心の半径 */
  --vgn-mid: 72%;
  /* 暗くなり始め */
  --vgn-outer: 100%;
  /* 端 */
  --vgn-a1: 0.3;
  /* 中心の暗さ(基本0) */
  --vgn-a2: 0.3;
  /* 中間の暗さ */
  --vgn-a3: 0.9;
  /* 端の暗さ：グリッドがうるさいならここを上げる */
}

/* ダークモード指定のときも基本は同じ配色に揃えておく */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --bg-soft: #020617;
    --fg: #f9fafb;
    --muted: #9ca3af;
    --border: #1f2937;
    --surface: #050816;
    --surface-soft: #0b1120;
    --primary: #38bdf8;
    --primary-soft: #0ea5e9;
    --accent: #facc15;
    --shadow: 0 22px 55px rgba(0, 0, 0, .9);
  }
}

/* リンクの色（アクセント色を使用） */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* アクセシビリティ用：画面には見せないがスクリーンリーダーには読ませる */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === 3) レイアウト共通 =========================== */
/* 中央寄せの共通コンテナ。左右の余白は画面幅に応じて可変 */
.container {
  width: 100%;
  max-width: 1600px;
  /* PC で広々レイアウト */
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 48px);
}

/* === 4) ヘッダー（上部固定＆半透明背景） ======== */
.site-header {
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(248, 250, 252, 0.10);
}


/* ヘッダー内のレイアウト（ロゴ｜メニュー｜検索） */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
  min-height: 64px;
  /* ★ ロゴと下線の間に余白 */
}

/* ロゴ画像（バナー）が縦長にならないようにする */
.brand-logo {
  display: block;
  max-height: 44px;
  height: auto;
  width: auto;
}

/* 中央ナビゲーション（PC時） */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* メニュー（PC 基本状態） */
.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* li の余白リセット（念のため） */
.nav-list li {
  margin: 0;
  padding: 0;
}

.nav-list a:hover {
  color: var(--accent);
  border-bottom: 1px solid rgba(250, 204, 21, 0.8);
}


.nav-list a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 0;
  color: var(--fg);
}

.nav-list a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 右端ブロック（検索＋ハンバーガー） */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 検索テキストボックス（細身のピル型） */
.search-input {
  width: clamp(140px, 23vw, 220px);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .7);
  background: rgba(15, 23, 42, .95);
  color: var(--fg);
  font-size: 13px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(148, 163, 184, .85);
}

.search-input:focus {
  border-color: rgba(56, 189, 248, .9);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, .6),
    0 0 18px rgba(56, 189, 248, .65);
}

/* 検索ボタン：SVA 風ピルボタン */
.search-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, .85);
  background:
    radial-gradient(circle at 30% 0%, #e0f2fe, transparent 60%),
    linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #0b1120;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.search-btn:hover {
  filter: brightness(1.04);
}

/* ハンバーガーメニュー（モバイル） */
.nav-toggle {
  display: none;
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .7);
  background: rgba(15, 23, 42, .9);
  color: var(--fg);
  width: 44px;
  min-height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle .bars {
  display: inline-block;
  inline-size: 18px;
  block-size: 2px;
  background: currentColor;
  box-shadow:
    0 -6px 0 0 currentColor,
    0 6px 0 0 currentColor;
}

/* === PC幅の微調整 ========================= */
@media (min-width: 881px) {
  .header-inner {
    align-items: center;
  }
}

/* === モバイル時のナビ配置 ================== */
@media (max-width: 880px) {

  /* ヘッダー内の要素配置：ロゴ左・検索右上にまとめる */
  .header-inner {
    gap: 12px;
  }

  .primary-nav {
    position: absolute;
    inset-inline: 16px;
    top: calc(100% + 8px);
    /* ★ ヘッダーの高さに追従して下に出す */
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: none;
    justify-content: flex-start;
    z-index: 50;
  }

  .primary-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 6px 8px;
  }

  .nav-list a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .header-actions {
    margin-left: auto;
  }

  .search-input {
    width: clamp(120px, 32vw, 200px);
  }

  .nav-toggle {
    display: inline-flex;
    /* ★ スマホでだけ表示 */
  }
}

/* さらに狭い幅（スマホ縦）のとき、検索とハンバーガーが重ならないように2段に */
@media (max-width: 520px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 10px;
    padding-block: 10px 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .search-input {
    width: 65%;
  }
}

/* === 7) 記事ヘッダー（タイトルなど） ============ */
.layout {
  padding-block: 20px;
}

.article-header {
  margin-block: 10px 18px;
}

.eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.title {
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.15;
  margin: .2em 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.hero {
  margin: 14px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hero figcaption {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

/* === 8) 本文（読みやすさ重視） ================== */
.prose {
  font-size: clamp(16px, 2.1vw, 18.5px);
  line-height: 1.9;
}

.prose h2 {
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.25;
  margin: 1.6em 0 .6em;
}

.prose h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  margin: 1.2em 0 .4em;
}

.prose p {
  margin: .9em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
  margin: .8em 0;
}

.prose li {
  margin: .3em 0;
}

.prose blockquote {
  margin: 1em 0;
  padding: .6em 1em;
  border-left: 3px solid color-mix(in oklab, var(--primary) 40%, transparent);
  background: color-mix(in oklab, var(--primary) 6%, transparent);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
  padding: .1em .3em;
  border-radius: 6px;
  background: color-mix(in oklab, var(--fg) 10%, transparent);
}

.prose pre {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--fg) 12%, transparent);
  overflow: auto;
}

figure {
  margin: 1em 0;
}

figcaption {
  color: var(--muted);
  font-size: .9em;
  margin-top: .4em;
}

/* === 9) 表（横スクロール対応） ================== */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

table {
  border-collapse: collapse;
  min-width: 560px;
  width: 100%;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* 注意枠（メモなど） */
.note {
  margin: 1em 0;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--primary) 5%, transparent);
}

/* === 10) 記事フッター（著者情報） ============== */
.article-footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  inline-size: 48px;
  block-size: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.author-name {
  font-weight: 600;
  margin: 0;
}

.author-bio {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}


/* === 11) サイト全体フッター ====================== */
/* ============================
   フッター（広告耐性・視認性強化）
   ============================ */

.site-footer {
  position: relative;
  /* fixed にしない（重要） */
  margin-top: 48px;
  padding: 24px 16px 20px;

  background: rgba(3, 7, 18, 0.);
  /* ← 不透明度アップ */
  backdrop-filter: blur(10px);
  /* ぼかしは弱めに */

  border-top: 1px solid rgba(148, 163, 184, 0.45);
  /* 境界を明確に */
  color: var(--muted);
  text-align: center;
}

/* フッター内テキスト */
.site-footer p,
.site-footer small {
  font-size: 13px;
  line-height: 1.7;
  margin: 6px 0;
  color: rgba(226, 232, 240, 0.85);
}

/* コピーライト */
.site-footer .copyright {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.6);
}


.footer-inner,
.footer-warn {
  padding-block: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* 注意書きは少し幅を絞って中央に */
.footer-warn {
  max-width: 960px;
  margin-inline: auto;
  padding-bottom: 18px;
}


/* === 検索結果オーバーレイ ==================== */
/* 画面全体を覆うレイヤー（最初は非表示） */
#searchOverlay {
  display: none;
  /* script.js で block に切り替え */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  overflow-y: auto;
}

/* 中央に表示する検索結果パネル */
#searchResults.search-results-panel {
  margin: 40px auto;
  max-width: 720px;
  padding: 20px 20px 24px;
  border-radius: 6px;
  background: rgba(5, 10, 25, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  color: var(--fg);
}


/* ヘッダー（タイトル＋閉じるボタン） */
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-results-title {
  margin: 0;
  font-size: 18px;
  color: var(--fg);
  /* ← ほぼ白に */
}

/* 閉じるボタン */
.search-results-close {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #f97373;
  color: #fff;
}

.search-results-close:hover {
  filter: brightness(1.05);
}

/* 実際の検索結果テキストを表示する領域 */
.search-results-body {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}



/* ====== ここから「カードっぽく見せる」設定 ====== */

/* 1行分（appendLine や typeToConsole が挿入する1ブロック） */
#resultsContent>div {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f8fafc;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  /* 濃いネイビー */
  /* ★ 追加：結果テキストの色 */
}


/* エラーメッセージらしき行は色を変えたい場合 */
#resultsContent>div:has([data-error]),
#resultsContent>div:has(.error) {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* URL 部分（script.js が自動で <a> にしてくれる）をカード内リンク風に */
#resultsContent a {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  background: #eff6ff;
  color: #1d4ed8;
  word-break: break-all;
}

#resultsContent a:hover {
  background: #dbeafe;
}

/* ダークテーマにしている場合の色調整（任意） */
@media (prefers-color-scheme: dark) {
  #searchResults.search-results-panel {
    margin: 40px auto;
    max-width: 720px;
    padding: 20px 20px 24px;
    border-radius: 4px;
    background: rgba(5, 10, 25, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    color: var(--fg);
  }

  #resultsContent>div {
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.95);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--fg);
  }

  #resultsContent a {
    background: #0b1120;
    border-color: rgba(96, 165, 250, 0.7);
    color: #bfdbfe;
  }
}

/* ローディング行だけカード枠を外して、普通のテキスト表示にする */
#resultsContent>div.loading-line {
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 8px;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  /* ちょっと濃いグレー */
}


/* =========================================
   弓降岳天文台 トップページ用スタイル
   ========================================= */

/* ヒーローセクション ---------------------- */
/* ヒーローセクション ---------------------- */
.observatory-hero {
  margin-top: 0;
  padding: clamp(120px, 18vh, 220px) 16px clamp(120px, 22vh, 260px);
  max-width: 760px;
  margin-inline: auto;
  text-align: center;

  min-height: 60vh;
  /* ★これが決定打 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: none;
  /* 枠っぽい背景を消す */
  box-shadow: none;
  /* カード風シャドウも消す */
}


.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.observatory-title {
  font-size: clamp(16px, 2.0vw, 22px);
  margin: 0 0 0px;
  color: var(--fg);
}

/* 見出し下のアーチ画像（共通） */
.arc-under {
  display: block;
  margin: 2px auto 0;
  /* ← 上だけ2px、中央寄せ */
  width: min(720px, 80vw);
  height: auto;
  opacity: 0.9;
  pointer-events: none;
}

/* ヒーロー（弓降岳天文台）の下：少し大きめ */
.arc-under--hero {
  width: min(820px, 86vw);
  margin-top: 14px;
}

/* セクション（CONTENTS/NEWS）の下：少し小さめ */
.arc-under--section {
  width: min(160px, 64vw);
  margin: 1px auto 0;
  /* 上に少し余白＋中央寄せ */
}

.observatory-lead {
  margin: 0 0 12px;
  color: color-mix(in oklab, var(--fg) 88%, var(--muted));
  font-size: 16px;
  line-height: 1.9;
}

.observatory-body {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}


.observatory-title {
  font-size: clamp(26px, 4.4vw, 34px);
  margin: 0 0 10px;
}

.observatory-lead {
  margin: 0 0 10px;
  color: color-mix(in oklab, var(--fg) 82%, var(--muted));
  font-size: 15px;
}

.observatory-body {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* コンテンツ全体 -------------------------- */
.observatory-Item {
  margin-top: 32px;
  padding-block: 4px 18px;
}

.observatory-section-title {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
  text-align: center;
  /* 追加 */
  letter-spacing: 0.25em;
  /* お好みで */
  font-size: 32px;
  margin: 16 0 0px;
}





/* 月齢 & 天気カードのグリッド ------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto 28px;
  /* 中央寄せ＋少し余白 */
}


/* 共通カードデザイン ---------------------- */
.info-card,
.article01,
.obs-card {
  background: rgba(5, 10, 25, 0.45);
  /* ← 0.65 → 0.45：星空が透ける */
  backdrop-filter: blur(20px) saturate(180%);
  /* ぼかし強めでガラス感UP */
  border: 1px solid rgba(148, 163, 184, 0.35);
  /* 枠線もやや控えめに */
  border-radius: var(--radius);

}



/* カードのタイトル行 ---------------------- */
.info-card-title {
  position: relative;
  margin: 0;
  padding: 10px 14px 8px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e5e7eb;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.35), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.6);
}


.info-card-title span {
  background: linear-gradient(90deg, #e5e7eb, #bfdbfe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.info-card-title::before {
  content: "☾";
  display: inline-block;
  margin-right: 6px;
  font-size: 1.1em;
  vertical-align: -1px;
  color: #fde68a;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.8);
}

/* 天気カードだけアイコンを変える */
#weather-section .info-card-title::before {
  content: "☼";
  color: #facc15;
}

/* 月齢カードの境界線クリックエリア -------- */
.border-toggle {
  height: 8px;
  background: rgba(148, 163, 184, 0.6);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* 月齢コンテンツ -------------------------- */
.moon-content {
  position: relative;
  padding: 10px 16px 12px;
}

#moon-image {
  width: min(46vw, 160px);
  padding: 4px 0;
}

.phase-text {
  margin: 4px auto 0;
  font-size: 0.9rem;
}

.moon-caption {
  font-size: 11px;
}

.weather-content {
  padding: 12px 16px 14px;
}

.weather-placeholder {
  font-size: 12px;
}


/* 星の粒っぽいテクスチャ */
.moon-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(248, 250, 252, 0.35) 0, transparent 55%),
    radial-gradient(circle at 80% 40%, rgba(248, 250, 252, 0.22) 0, transparent 55%),
    radial-gradient(circle at 30% 80%, rgba(248, 250, 252, 0.18) 0, transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}

.moon-content>* {
  position: relative;
  z-index: 1;
}

/* 日付入力欄 */
#moon-date-input {
  display: none;
  /* JS でも制御しているが、初期状態を保証 */
  width: 70%;
  max-width: 230px;
  height: 34px;
  margin: 4px auto 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  text-align: center;
  font-size: 0.9rem;
  outline: none;
  display: block;
  transition:
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background-color 0.2s ease-out;
}

#moon-date-input:focus {
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.8),
    0 0 18px rgba(59, 130, 246, 0.55);
  background: rgba(15, 23, 42, 0.98);
}

/* 月の画像 */
#moon-image {
  display: block;
  margin: 4px auto 0;
  width: min(52vw, 190px);
  height: auto;
  padding: 8px 0;
  filter:
    drop-shadow(0 0 12px rgba(248, 250, 252, 0.85)) drop-shadow(0 0 32px rgba(56, 189, 248, 0.55));
  transform: translateY(0);
  transition:
    transform 0.25s ease-out,
    filter 0.25s ease-out;
}

/* PC ホバー時にふわっと浮く感じ */
@media (hover: hover) {
  #moon-image:hover {
    transform: translateY(-3px) scale(1.02);
    filter:
      drop-shadow(0 0 18px rgba(248, 250, 252, 0.95)) drop-shadow(0 0 40px rgba(96, 165, 250, 0.8));
  }
}

/* 月相テキスト */
.phase-text {
  color: #e5e7eb;
  text-align: center;
  margin: 4px auto 0;
  padding: 4px 8px 4px;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(15, 23, 42, 0.9),
    0 0 18px rgba(15, 23, 42, 0.9);
  box-sizing: border-box;
}

/* 補足説明 */
.moon-caption {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* 天気カード ------------------------------ */
.weather-content {
  padding: 14px 18px 16px;
}

.weather-placeholder {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* =========================
   NEWS：左サムネ付きカード
   ========================= */
.observatory-News .news-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  /* 既存より少し厚くして高さ確保 */
  min-height: 128px;
  /* ★カード高さを少し上げる（好みで調整） */
}

/* 16:9 サムネ枠（左固定） */
.observatory-News .news-thumb {
  flex: 0 0 clamp(160px, 22vw, 240px);
  /* 左カラム幅 */
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  /* 角丸は控えめ */
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.observatory-News .news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 右側テキスト */
.observatory-News .news-body {
  min-width: 0;
  /* 折り返しのため */
}

.observatory-News .news-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.observatory-News .news-body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* スマホでは縦積み（サムネ上、本文下） */
@media (max-width: 640px) {
  .observatory-News .news-item {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  .observatory-News .news-thumb {
    flex-basis: auto;
    width: 100%;
  }
}

/* NEWS：日付（カードのヘッダーっぽい行） */
.observatory-News .news-meta {
  margin: 0 0 6px;
}

.observatory-News .news-date {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(226, 232, 240, .75);
}

/* NEWS：カード全体リンク化 */
.observatory-News .news-item {
  padding: 0;
  /* paddingはリンク側に持たせる */
}

.observatory-News .news-link {
  display: flex;
  gap: 16px;
  width: 100%;
  /* ★カード横幅いっぱいに */
  height: 100%;
  /* ★カードの高さも埋める（効かない環境でも害なし） */
  align-items: center;
  padding: 14px 16px;
  min-height: 128px;
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  .observatory-News .news-item:hover {
    border-color: rgba(85, 85, 85, 0.2);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .65);
    filter: brightness(1.03);
  }
}

/* スマホ：縦積み */
@media (max-width: 640px) {
  .observatory-News .news-link {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }
}


/* カードリンク一覧 ------------------------ */
.observatory-links {
  margin-top: 26px;
}

.observatory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.obs-card {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(5, 10, 25, 0.45);
  /* 半透明ガラス */
  backdrop-filter: blur(20px) saturate(180%);
  text-decoration: none;
  color: var(--fg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}


.obs-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.obs-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.obs-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.65);
}

/* 少し画面が広いときの微調整 -------------- */
@media (min-width: 768px) {
  .observatory-hero {
    padding-block: 46px 34px;
  }
}


html,
body {
  font-family: "Montserrat", "Noto Sans KR", "Noto Sans JP", sans-serif;
  font-weight: 300;
}

/* ===== 右下の大きい月（“1/4だけ見せる”） ===== */
#moon-wrapper {
  position: fixed;
  right: -18vmin;
  /* 右へはみ出させる */
  bottom: -18vmin;
  /* 下へはみ出させる */
  width: clamp(260px, 42vw, 520px);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 5;
  /* グリッドより上／本文より下 にする */
}

.big-moon__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.45));
  transform: none;
}

/* 通常月 */
.moon-base {
  z-index: 1;
}

/* 赤月 */
.moon-red {
  z-index: 2;
  opacity: 0;
  transition: opacity 1.2s ease;
}


/* =========================================
   Weather card (追加)
   ========================================= */

.weather-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 6px;
}

.weather-icon-wrap {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
}

.weather-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, .35));
  transform: translateZ(0);
}

/* 5回目：金色フラッシュ */
.weather-icon.is-gold-flash {
  animation: goldFlash 900ms ease-out 1;
}

@keyframes goldFlash {
  0% {
    filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0));
  }

  30% {
    filter: drop-shadow(0 0 22px rgba(250, 204, 21, .95)) drop-shadow(0 0 40px rgba(250, 204, 21, .55));
  }

  100% {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, .35));
  }
}

.weather-meta {
  min-width: 0;
}

.weather-status {
  margin: 0;
  font-size: 16px;
  letter-spacing: .06em;
  color: rgba(248, 250, 252, .92);
}

.weather-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, .72);
}

#weatherTemp {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, .72);
}

.weather-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(148, 163, 184, .22);
}

.weather-btn {
  appearance: none;
  border: 1px solid rgba(56, 189, 248, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  padding: 8px 12px;
  border-radius: 6px;
  /* 角丸を強くしない */
  letter-spacing: .08em;
  cursor: pointer;
}

.weather-btn:hover {
  border-color: rgba(56, 189, 248, .9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .25);
}

.weather-btn.-gold {
  border-color: rgba(250, 204, 21, .7);
  background: rgba(250, 204, 21, .12);
}

.weather-hint {
  font-size: 12px;
  color: rgba(226, 232, 240, .70);
  letter-spacing: .06em;
}

/* 7回目解放の入力UI */
.weather-unlock {
  margin: 0 16px 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(5, 10, 25, .28);
  backdrop-filter: blur(18px) saturate(170%);
}

.weather-unlock-title {
  font-size: 12px;
  letter-spacing: .14em;
  color: rgba(250, 204, 21, .9);
  margin: 0 0 10px;
}

.weather-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.weather-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(226, 232, 240, .78);
}

.weather-input {
  width: 180px;
  max-width: 42vw;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  outline: none;
}

.weather-input:focus {
  border-color: rgba(250, 204, 21, .85);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .25);
}

.weather-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: rgba(226, 232, 240, .65);
}

@media (max-width: 520px) {
  .weather-row {
    gap: 12px;
  }

  .weather-icon-wrap {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .weather-icon {
    width: 48px;
    height: 48px;
  }

  .weather-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .weather-input {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Weather icon hover (moon と同系統) ===== */
@media (hover: hover) {
  #weather-section #weatherIcon:hover {
    transform: scale(1.06);
    filter:
      drop-shadow(0 0 16px rgba(248, 250, 252, 0.55)) drop-shadow(0 0 34px rgba(56, 189, 248, 0.55));
  }
}

/* ============================
   Weather card reload alert
   ============================ */

/* 赤フラッシュ用 */
.weather-alert {
  animation: weatherAlertFlash 0.9s ease-out 1;
}

@keyframes weatherAlertFlash {
  0% {
    box-shadow:
      0 0 0 rgba(239, 68, 68, 0),
      inset 0 0 0 rgba(239, 68, 68, 0);
    background-color: rgba(239, 68, 68, 0.05);
  }

  35% {
    box-shadow:
      0 0 28px rgba(239, 68, 68, 0.75),
      inset 0 0 24px rgba(239, 68, 68, 0.25);
    background-color: rgba(239, 68, 68, 0.18);
  }

  100% {
    box-shadow:
      0 0 0 rgba(239, 68, 68, 0),
      inset 0 0 0 rgba(239, 68, 68, 0);
    background-color: transparent;
  }
}

/* =========================
   天気カード：警告状態（7回目以降）
   ========================= */
#weather-section.weather-alert {
  background: linear-gradient(180deg,
      rgba(120, 20, 20, 0.85),
      rgba(60, 10, 10, 0.85));
  box-shadow:
    0 0 0 1px rgba(255, 80, 80, 0.6),
    0 0 40px rgba(255, 60, 60, 0.25);
}

/* タイトルと文字も少し強調 */
#weather-section.weather-alert .info-card-title span {
  color: #ffe4e4;
}

#weather-section.weather-alert .weather-phase {
  color: #fff;
}

/* =========================================
   左上固定：だーくまちゃんメニュー（背景なし）
   ========================================= */
.floating-darkuma {
  position: fixed;
  left: 30px;
  top: 96px;
  /* ヘッダーの少し下。必要なら数値だけ微調整 */
  z-index: 9000;

  display: block;
  width: clamp(105px, 15vw, 165px);
  /* 以前の約1.5倍 */
  aspect-ratio: 1 / 1;

  /* 背景の丸い円を完全に消す */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;

  text-decoration: none;
  cursor: pointer;

  /* 通常時は少し透ける → ホバーで透明度UP */
  opacity: 0.82;
  transition: opacity .2s ease-out;

  /* ふわふわ上下 */
  animation: floatY 3.6s ease-in-out infinite;
}

.floating-darkuma__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* 画像をそのまま（切り抜かずに） */
  border-radius: 0;
  /* 丸マスクもしない（画像そのまま） */

  /* 余計な光り方はさせない */
  filter: none;
  transition: none;
}

/* ホバー時：透明度が上がるだけ */
@media (hover: hover) {
  .floating-darkuma:hover {
    opacity: 1;
  }
}

/* ふわふわアニメ */
@keyframes floatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .floating-darkuma {
    animation: none !important;
    transition: none !important;
  }
}


/* PCなど hover 可能環境だけ演出 */
@media (hover: hover) {
  .floating-darkuma:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.62),
      0 0 34px rgba(56, 189, 248, 0.32);
  }

  .floating-darkuma:hover .floating-darkuma__img {
    transform: scale(1.04);
    filter:
      drop-shadow(0 0 16px rgba(248, 250, 252, 0.45)) drop-shadow(0 0 30px rgba(56, 189, 248, 0.35));
  }
}

/* スマホ：少し下＆少し小さめ */
@media (max-width: 520px) {
  .floating-darkuma {
    left: 8px;
    top: 40vh;
    width: 74px;
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {

  .floating-darkuma,
  .floating-darkuma__img {
    transition: none !important;
  }
}

/* 背景ステージ（最背面） */
.sky-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sky-stage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sky-stage__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}



/* 30秒後の切替で少しだけ強める（任意） */
.sky-stage__grid.is-revealed {
  opacity: 1;
}

/* 既存のビネットがある場合：グリッドより上に置く */
.sky-stage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;

  /* ビネットを弱める（暗すぎを解消） */
  background: radial-gradient(circle at 50% 45%,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.10) 55%,
      rgba(0, 0, 0, 0.35) 100%);
}


/* UIは必ず月より前 */
.site-header,
.observatory-hero,
.observatory-Item,
.observatory-News,
.info-grid,
.article01,
.observatory-section-title,
footer {
  position: relative;
  z-index: 5;
}

/* =========================
   背景レイヤー再定義
   ========================= */

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
}

/* 星空・グリッド */
#bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#bg-grid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0.35;
}

/* 月（右下 1/4 表示） */
#moon-layer {
  position: fixed;
  right: -20%;
  bottom: -20%;
  width: 50vw;
  max-width: 600px;
  z-index: 1;
  pointer-events: none;
}

#moon-layer img {
  width: 100%;
  height: auto;
}

/* コンテンツは必ず前面 */
.site-header,
main,
footer {
  position: relative;
  z-index: 10;
}

/* ===== ヘッダーは sticky に戻す（上の謎の隙間を消す） ===== */
body {
  padding-top: 0 !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* =========================================================
   FIX PATCH: 背景/グリッド/大きい月/本文のレイヤーを復旧
   （このブロックは styles.css の末尾に追記）
========================================================= */

/* ブラウザ上の“謎の隙間”対策（基本の余白リセット） */
html,
body {
  margin: 0;
  padding: 0;
}

/* ヘッダーが最前面に来るように */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* 本文が背景より前に来るように（重要） */
main,
.main,
.content,
.container,
.wrapper {
  position: relative;
  z-index: 20;
}

/* ===== 背景ステージ ===== */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 星空（通常合成） */
.bg-stage .bg-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* 20秒〜30秒で赤くする（JSが --bgHue を更新） */
  filter:
    hue-rotate(var(--bgHue, 0deg)) saturate(1.15) brightness(var(--bgDim, 1));
  transition: filter 0.25s linear;
}

/* グリッド（スクリーン合成） */
.bg-stage .bg-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  mix-blend-mode: screen;
  /* ←これが“スクリーン合成” */
  opacity: 0.65;
}

/* 歯車入りグリッドは最初は見えない（30秒でフェードイン） */
.bg-stage .bg-grid--gear {
  opacity: 0;
  transition: opacity 2.8s ease;
  /* “じんわり” */
}

body.is-gear-on .bg-stage .bg-grid--gear {
  opacity: 0.85;
}

/* ===== 大きい月（背景より前、本文より後ろ）===== */
.big-moon {
  position: fixed;
  right: -32vmin;
  /* 右下に“1/4だけ”出すための押し出し */
  bottom: -32vmin;
  width: clamp(420px, 62vmin, 760px);
  aspect-ratio: 1 / 1;
  z-index: 10;
  /* 背景(0) < 月(10) < 本文(20) */
  pointer-events: none;
}

.big-moon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;

  /* 通常の白いグロウ */
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.55));
  transition: filter 0.25s linear;
}

/* 月の減光（赤黒く） */
.big-moon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.65);
  mix-blend-mode: multiply;
  opacity: var(--moonDim, 0);
  /* 0→1で暗く */
}

/* 月の“円弧”赤化レイヤー（直線clipをやめて円弧マスクに） */
.big-moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;

  /* 赤い着色（色相） */
  background: rgba(140, 0, 0, 0.92);
  mix-blend-mode: color;
  opacity: 1;

  /* ★ここが肝：円弧で進むマスク */
  /* --moonProg: 0→1 で、赤領域が左から円弧状に広がる */
  -webkit-mask-image: radial-gradient(circle at calc((1 - var(--moonProg)) * 140%) 50%,
      #000 0%,
      #000 30%,
      transparent 65%,
      transparent 100%);
  mask-image: radial-gradient(circle at calc((1 - var(--moonProg)) * 140%) 50%,
      #000 0%,
      #000 30%,
      transparent 65%,
      transparent 100%);

  /* 端を少し柔らかく（好みで） */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}


/* 月のグロウも赤く変える（進行に合わせてJSがクラス付与） */
body.is-bloodmoon .big-moon img {
  filter: drop-shadow(0 0 18px rgba(255, 80, 80, 0.65));
}

/* スマホで月が寄りすぎる/はみ出る対策 */
@media (max-width: 700px) {
  .big-moon {
    right: -40vmin;
    bottom: -40vmin;
    width: clamp(360px, 78vmin, 680px);
  }
}

/* ===== Scene vignette (背景+グリッド+大きい月にまとめて掛ける) ===== */
.scene-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  /* 背景(0) < 月(10) < これ(15) < 本文(20) */

  background: radial-gradient(circle at 50% 45%,
      rgba(0, 0, 0, var(--vgn-a1)) 0%,
      rgba(0, 0, 0, var(--vgn-a2)) var(--vgn-inner),
      rgba(0, 0, 0, var(--vgn-a2)) var(--vgn-mid),
      rgba(0, 0, 0, var(--vgn-a3)) var(--vgn-outer));
}

/* =========================================
   FEATURE IMAGES（ヒーロー下の2枚画像）
   ========================================= */

.observatory-feature {
  margin: 12px auto 36px;
  padding: 0 16px;
  position: relative;
  z-index: 5;
}

/* 2枚を中央揃え */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* 各画像ブロック */
.feature-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  aspect-ratio: 16 / 9;
}

/* 画像本体 */
.feature-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 余白が出ないようにトリミング */
  display: block;
  transition:
    filter 0.35s ease,
    transform 0.35s ease;
}

/* 説明テキスト（最初は隠す） */
.feature-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
  background: linear-gradient(to top,
      rgba(2, 6, 23, 0.85),
      rgba(2, 6, 23, 0.0) 60%);
  color: var(--fg);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.feature-caption h3 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.feature-caption p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ホバー演出（PCのみ） */
@media (hover: hover) {
  .feature-item:hover img {
    filter: brightness(1.15);
    transform: scale(1.03);
  }

  .feature-item:hover .feature-caption {
    opacity: 1;
    transform: translateY(0);
  }
}

/* スマホ時は縦並び */
@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   NEWS detail page（個別記事ページ）
   ========================================= */

.news-detail-wrap {
  min-height: calc(100vh - 64px);
  /* ヘッダー分をざっくり差し引き */
  display: grid;
  place-items: center;
  padding-block: clamp(18px, 4vh, 40px);
}

.news-detail-card {
  width: min(1100px, 94vw);
  padding: clamp(16px, 2.6vw, 26px);
}

/* 既存のガラスカードを使う（article01 と同じ系統） */
.news-detail-card {
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}

.news-detail-header {
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding-bottom: 12px;
}

.news-detail-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .18em;
  color: rgba(226, 232, 240, .75);
}

.news-detail-title {
  margin: 0 0 8px;
  line-height: 1.25;
  font-size: clamp(20px, 3.2vw, 34px);
}

.news-detail-meta {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 232, 240, .78);
}

.news-detail-hero {
  margin: 14px 0 16px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
}

.news-detail-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-detail-body {
  font-size: 15px;
  line-height: 1.9;
  color: rgba(248, 250, 252, .92);
}

.news-detail-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.news-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  background: rgba(15, 23, 42, .45);
  color: var(--fg);
  text-decoration: none;
}

.news-detail-back:hover {
  border-color: rgba(56, 189, 248, .75);
  text-decoration: none;
}

/* =========================================
   NEWS detail：画像左 / 本文右（2カラム）
   ========================================= */

.news-detail-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  /* ★ 左1/3：右2/3 */
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
}

/* 左：サムネイル */
.news-detail-hero {
  margin: 0;
  /* 縦並び時の余白をリセット */
}

.news-detail-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* 右：本文 */
.news-detail-body {
  font-size: 15px;
  line-height: 1.9;
  color: rgba(248, 250, 252, .92);
}

/* スマホでは縦並びに戻す */
@media (max-width: 768px) {
  .news-detail-content {
    grid-template-columns: 1fr;
  }

  .news-detail-hero {
    margin-bottom: 12px;
  }
}

/* =========================
   ページ進捗バッジ（右下固定）
   ========================= */
.pager-badge {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 9999;

  padding: 6px 12px;
  border-radius: 999px;

  font-size: 12px;
  letter-spacing: 0.08em;

  color: rgba(248, 250, 252, 0.9);
  background: rgba(5, 10, 25, 0.65);
  backdrop-filter: blur(10px) saturate(160%);

  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);

  pointer-events: none;
  /* クリックを邪魔しない */
}

/* =========================================
   STAFF page（職員紹介）
   ========================================= */

.staff-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.staff-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.staff-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.staff-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.staff-lead {
  margin: 10px 0 150px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* カードのグリッド（PC:3列 / タブレット:2列 / スマホ:1列） */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* ★ PCで3列 */
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 980px) {
  .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .staff-grid {
    grid-template-columns: 1fr;
    padding-bottom: 420px;
    /* ★追加：カード1枚分くらいの“タップできる空白” */
  }
}


.staff-card {
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.staff-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  /* 画像比率は好みでOK */
  object-fit: cover;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  filter: saturate(1.05) contrast(1.03);
}

.staff-caption {
  margin: 4px 14px 0px;
  padding: 0;
  font-size: 10px;
  line-height: 1.85;
  color: rgba(226, 232, 240, 0.82);
}

.staff-name {
  margin: 0px 14px 2px;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: rgba(248, 250, 252, 0.92);
}

.staff-role {
  margin: 0 14px 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.75);
}

.staff-message {
  margin: 0 14px 14px;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(226, 232, 240, 0.82);
}

/* hoverできる環境だけ少しだけ反応 */
@media (hover: hover) {
  .staff-card:hover {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.62);
    transform: translateY(-2px);
    transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
  }
}

.hidden-message {
  color: transparent;
}



/* ===== staff card glass restore patch ===== */
.staff-card {
  background: rgba(5, 10, 25, 0.45) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

/* =============================
   Cassiopeia：背景に固定（透過PNG前提）
   ============================= */

/* 背景に置くカシオペア座（クリック不可：見た目だけ） */
.bg-stage .bg-cassiopeia {
  position: absolute;
  right: clamp(54px, 3vw, 72px);
  bottom: clamp(180px, 5vw, 72px);


  /* 画像は 960x960 だが、表示はレスポンシブでOK */
  width: min(38vw, 360px);
  height: auto;

  pointer-events: none;
  /* 背景の一部として固定 */
  opacity: 0.85;

  /* 明るさ演出（JSが --cass-glow を更新） */
  filter: brightness(var(--cass-glow, 0.55)) drop-shadow(0 0 12px rgba(56, 189, 248, 0.22));
}

/* スマホ：中央下に寄せて “背景の一部” 感を維持 */
@media (max-width: 640px) {
  .bg-stage .bg-cassiopeia {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 18px;
    width: min(78vw, 420px);
  }
}

/* カシオペア：描画レイヤーと操作レイヤーを同じ箱に重ねる（現カシオペア画像と同位置） */
.cass-canvas,
.cass-hit {
  position: fixed;
  right: clamp(54px, 3vw, 72px);
  bottom: clamp(180px, 5vw, 72px);

  width: min(38vw, 360px);
  aspect-ratio: 1 / 1;
}

/* 描画レイヤー：星と線を描く。背景(0) < ビネット(15) < ここ(16) < 本文/カード(20) */
.cass-canvas {
  display: block;
  z-index: 16;
  pointer-events: none;
}

/* 操作レイヤー：透明。ここでドラッグ／なぞりを受ける（カードより手前） */
.cass-hit {
  z-index: 40;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  /* タッチでなぞってもページがスクロールしないように */
}

/* スマホ：画像位置と完全に合わせる */
@media (max-width: 640px) {
  .cass-canvas,
  .cass-hit {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 18px;
    width: min(78vw, 420px);
  }
}

/* =========================================
   FLOOR MAP page
   （styles.css 末尾に追記）
   ========================================= */

.floor-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.floor-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.floor-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.floor-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.floor-lead {
  margin: 10px 0 22px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* 1枚カード */
.floor-card {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 22px);

  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.floor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.floor-card-caption {
  margin: 0;
  font-size: 32px;
  letter-spacing: .14em;
  color: rgba(226, 232, 240, .78);
}

.floor-nav {
  display: flex;
  gap: 10px;
}

.floor-navBtn {
  appearance: none;
  border: 1px solid rgba(56, 189, 248, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: .08em;
}

.floor-navBtn:hover {
  border-color: rgba(56, 189, 248, .9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .25);
}

.floor-mapArea {
  margin-top: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
}

.floor-mapImg {
  width: 100%;
  height: auto;
  display: block;
}

.floor-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, .70);
  letter-spacing: .04em;
}

/* 画像直下のナビ */
.floor-nav--below {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

/* ボタンを分かりやすく大きく */
.floor-navBtn--big {
  padding: 14px 18px;
  /* ←大きく */
  font-size: 18px;
  /* ←文字(矢印)も大きく */
  min-width: 64px;
  min-height: 48px;
  border-radius: 999px;
}

/* スマホは中央寄せ */
@media (max-width: 520px) {
  .floor-nav--below {
    justify-content: center;
  }
}

.floor-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(248, 250, 252, 0.10);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

/* スマホ：ボタンが詰まるので折り返し */
@media (max-width: 520px) {
  .floor-card-head {
    flex-wrap: wrap;
    justify-content: center;
  }

  .floor-nav {
    width: 100%;
    justify-content: center;
  }
}

/* floor nav disabled（押せない状態をグレーアウト） */
.floor-navBtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
  box-shadow: none;
}

/* =========================================
   GALLERY page（写真ギャラリー）
   ========================================= */

.gallery-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.gallery-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.gallery-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.gallery-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.gallery-lead {
  margin: 10px 0 26px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* 3列×2段（レスポンシブで2列/1列） */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-card {
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.gallery-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  filter: saturate(1.06) contrast(1.04);
}

/* ダウンロードボタン（画像のすぐ下） */
.gallery-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px 14px 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, .85);
  background:
    radial-gradient(circle at 30% 0%, #e0f2fe, transparent 60%),
    linear-gradient(135deg, #57a6ca, #116d9e);
  color: #0b1120;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.gallery-download:hover {
  filter: brightness(1.04);
  text-decoration: none;
}

.gallery-meta {
  padding: 0 14px 14px;
}

.gallery-maintitle {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0.10em;
  color: rgba(245, 245, 245, 0.78);
}

.gallery-author {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.10em;
  color: rgba(226, 232, 240, 0.78);
}

.gallery-comment {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(226, 232, 240, 0.86);
}


/* =========================================
   NEWS page（ニュース一覧）
   ========================================= */
.news-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.news-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.news-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.news-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.news-lead {
  margin: 10px 0 26px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* =========================================
   FACILITY page（施設紹介）
   ========================================= */

.facility-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.facility-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.facility-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.facility-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.facility-lead {
  margin: 10px 0 26px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* 3列×2段（レスポンシブで2列/1列） */
.facility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 980px) {
  .facility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .facility-grid {
    grid-template-columns: 1fr;
  }
}

.facility-card {
  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.facility-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  filter: saturate(1.06) contrast(1.04);
}

.facility-meta {
  padding: 12px 14px 14px;
}

.facility-name {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 0.10em;
  color: rgba(245, 245, 245, 0.78);
}

.facility-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(226, 232, 240, 0.86);
}

/* =========================================
   CONTACT page（お問い合わせ）
   ========================================= */

.contact-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.contact-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.contact-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.contact-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.contact-lead {
  margin: 10px 0 26px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* 1枚カード */
.contact-card {
  width: min(900px, 94vw);
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 26px);

  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-row {
  display: grid;
  gap: 8px;
}

.contact-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.78);
}

.contact-input,
.contact-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(248, 250, 252, 0.92);
  outline: none;
}

.contact-input:focus,
.contact-select:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.contact-submit {
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, .85);
  background:
    radial-gradient(circle at 30% 0%, #e0f2fe, transparent 60%),
    linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #0b1120;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.contact-submit:hover {
  filter: brightness(1.04);
}

.contact-note {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.70);
}

.contact-result {
  margin-top: 6px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: rgba(248, 250, 252, 0.92);
  line-height: 1.7;
}

.contact-result.is-error {
  border-color: rgba(248, 113, 113, 0.70);
  background: rgba(127, 29, 29, 0.25);
}

@media (max-width: 520px) {
  .contact-actions {
    justify-content: center;
  }
}

.contact-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(248, 250, 252, 0.92);
  outline: none;
  resize: vertical;
  /* 縦方向のみリサイズ可 */
  line-height: 1.7;
  font-family: inherit;
}

.contact-textarea:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

/* =========================================
   DARKUMA: 2レイヤー方式
   - 見た目(visual)は下
   - 当たり判定(hit)だけ上
   - 両者は同じ軌道で完全同期
   ========================================= */

/* 共通：同じ座標・同じ移動（＝同期） */
.darkuma-wrap {
  position: fixed;
  left: 50%;
  top: 44%;

  width: clamp(48px, 5.5vw, 84px);
  height: auto;

  transform: translate(-50%, -50%);
  animation: darkumaSideToSide 40s ease-in-out infinite alternate;

  display: block;
}

/* 内側：上下ふわふわ（transform競合を避けるため内側で揺らす） */
.darkuma-inner {
  display: block;
  width: 100%;
  height: 100%;
  animation: darkumaFloatY 6s ease-in-out infinite;
}

/* ===== 見た目（下）===== */
.darkuma-visual {
  z-index: 16;
  /* 背景より上 / 本文より下 を想定 */
  pointer-events: none;
  /* クリックは奪わない */
  opacity: 0.55;
  /* 透明度を上げる（薄くする） */
}

.darkuma-visual img {
  width: 100%;
  height: auto;
  display: block;

  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;

  /* 常時グロー */
  filter:
    drop-shadow(0 0 10px rgba(248, 250, 252, .55)) drop-shadow(0 0 26px rgba(56, 189, 248, .35));
}

/* ===== 当たり判定（上）===== */
.darkuma-hit {
  z-index: 40;
  /* 本文より上に置く：クリック可能にする */
  pointer-events: auto;
  background: transparent;
  text-decoration: none;
  cursor: pointer;

  /* 透明（見えない） */
  opacity: 0;
}

/* クリック範囲を画像と同じサイズにする（余白を少し増やしたいなら下2行を調整） */
.darkuma-hit .darkuma-inner {
  width: 100%;
  height: 100%;
}

/* 左右に大きく移動：余白まで行かせる
   80px を小さくするともっと端まで行く（例: 40px） */
@keyframes darkumaSideToSide {
  0% {
    transform: translate(-50%, -50%) translate(calc(-50vw + 80px), -2vh);
  }

  50% {
    transform: translate(-50%, -50%) translate(calc(50vw - 80px), 5vh);
  }

  100% {
    transform: translate(-50%, -50%) translate(calc(-50vw + 80px), 10vh);
  }
}

/* 上下ふわふわ */
@keyframes darkumaFloatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

/* スマホ */
@media (max-width: 640px) {
  .darkuma-wrap {
    width: 46px;
    top: 46%;
  }

  @keyframes darkumaSideToSide {
    0% {
      transform: translate(-50%, -50%) translate(calc(-50vw + 56px), -2vh);
    }

    50% {
      transform: translate(-50%, -50%) translate(calc(50vw - 56px), 6vh);
    }

    100% {
      transform: translate(-50%, -50%) translate(calc(-50vw + 56px), 10vh);
    }
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {

  .darkuma-wrap,
  .darkuma-inner {
    animation: none !important;
  }
}

/* =========================
   DARKUMA hitbox fix
   「当たり判定がクリックできない」根本原因：高さ0対策
   ========================= */

/* 共通：幅と高さを同じにして必ず面積を持たせる */
.darkuma-wrap {
  width: clamp(48px, 5.5vw, 84px);
  height: clamp(48px, 5.5vw, 84px);
  /* ★これが重要（height:auto をやめる） */
  aspect-ratio: 1 / 1;
  /* 保険（どちらか効けばOK） */
}

/* 当たり判定（上） */
.darkuma-hit {
  z-index: 40;
  pointer-events: auto;
  display: block;
  opacity: 0;
  /* 完全透明でもOK */
  /* iOS/一部環境で0だとタップが不安定な場合だけ 0.001 にする */
  /* opacity: 0.001; */
}

/* 当たり判定の中身も面積を持たせる（クリック範囲＝この四角） */
.darkuma-hit .darkuma-inner {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* スマホだけサイズ別にするならこちらも合わせる */
@media (max-width: 640px) {
  .darkuma-wrap {
    width: 46px;
    height: 46px;
    /* ★スマホも高さを明示 */
  }
}

/* =========================================
   DARKUMA EXAM page（styles.css 末尾に追記）
   ========================================= */

.exam-layout {
  padding-top: clamp(18px, 3vh, 34px);
  padding-bottom: clamp(24px, 4vh, 44px);
}

.exam-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 18px;
}

.exam-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 100px 0 8px;
}

.exam-title {
  margin: 0;
  font-size: clamp(22px, 4.0vw, 40px);
  letter-spacing: 0.08em;
  color: var(--fg);
}

.exam-lead {
  margin: 10px 0 26px;
  color: color-mix(in oklab, var(--fg) 80%, var(--muted));
  font-size: 18px;
  line-height: 1.9;
}

/* 1枚カード */
.exam-card {
  width: min(980px, 94vw);
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 26px);

  background: rgba(5, 10, 25, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* =========================
   exam: 正解/不正解 フラッシュ
   ========================= */

/* フラッシュ用の疑似要素を重ねるため */
.exam-card {
  position: relative;
  overflow: hidden;
}

/* 上にかぶせる光（通常は見えない） */
.exam-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

/* 正解フラッシュ（緑） */
.exam-card.flash-correct::after {
  animation: examFlashCorrect 420ms ease-out;
}

/* 不正解フラッシュ（赤） */
.exam-card.flash-wrong::after {
  animation: examFlashWrong 420ms ease-out;
}

@keyframes examFlashCorrect {
  0% {
    opacity: 0;
    box-shadow: none;
    background: rgba(34, 197, 94, 0.00);
  }

  18% {
    opacity: 1;
    box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.18);
  }

  100% {
    opacity: 0;
    box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, 0.00);
    background: rgba(34, 197, 94, 0.00);
  }
}

@keyframes examFlashWrong {
  0% {
    opacity: 0;
    box-shadow: none;
    background: rgba(239, 68, 68, 0.00);
  }

  18% {
    opacity: 1;
    box-shadow: inset 0 0 0 9999px rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.18);
  }

  100% {
    opacity: 0;
    box-shadow: inset 0 0 0 9999px rgba(239, 68, 68, 0.00);
    background: rgba(239, 68, 68, 0.00);
  }
}

/* 博士の喋り（画像＋吹き出し） */
.exam-say {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.exam-say__avatar {
  width: 140px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.exam-say__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(248, 250, 252, 0.35)) drop-shadow(0 0 26px rgba(56, 189, 248, 0.22));
}

.exam-say__bubble {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.exam-say__bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 22px;
  width: 18px;
  height: 18px;
  background: rgba(15, 23, 42, 0.55);
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  transform: rotate(45deg);
}

.exam-say__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: .10em;
  color: rgba(226, 232, 240, 0.75);
}

.exam-qText {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(248, 250, 252, 0.92);
}

/* 誕生日入力 */
.exam-birthday__row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.exam-field__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.78);
  margin-bottom: 8px;
}

.exam-input {
  width: 120px;
  max-width: 34vw;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.55);
  color: rgba(248, 250, 252, 0.92);
  outline: none;
}

.exam-input:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.exam-sep {
  color: rgba(226, 232, 240, 0.7);
}

.exam-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.70);
  line-height: 1.7;
}

/* 選択肢 */
.exam-choices {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.exam-choice {
  display: flex;
  gap: 10px;
  align-items: center;

  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  user-select: none;
}

.exam-choice:hover {
  border-color: rgba(56, 189, 248, 0.75);
}

.exam-choice input {
  accent-color: var(--primary);
}

.exam-choice__text {
  color: rgba(248, 250, 252, 0.92);
  line-height: 1.6;
}

.exam-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ボタン */
.exam-btn {
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exam-btn:hover {
  border-color: rgba(56, 189, 248, .9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .25);
}

.exam-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
}

.exam-btn.-primary {
  border: 1px solid rgba(56, 189, 248, .85);
  background:
    radial-gradient(circle at 30% 0%, #e0f2fe, transparent 60%),
    linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #0b1120;
}

.exam-btn.-tweet {
  border: 1px solid rgba(250, 204, 21, .75);
  background: rgba(250, 204, 21, 0.12);
}

/* 正誤表示 */
.exam-judge {
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(5, 10, 25, 0.25);
}

.exam-judge__text {
  margin: 0;
  color: rgba(248, 250, 252, 0.92);
  line-height: 1.7;
}

/* 結果 */
.exam-result__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.exam-result__title {
  margin: 0;
  font-size: 18px;
  letter-spacing: .10em;
  color: rgba(248, 250, 252, 0.92);
}

.exam-result__meta {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
  letter-spacing: .08em;
}

.exam-result__box {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
}

.exam-result__label {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .16em;
  color: rgba(226, 232, 240, 0.70);
}

.exam-result__const {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: .08em;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

.exam-result__msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(248, 250, 252, 0.92);
}

.exam-actions--result {
  justify-content: space-between;
}

@media (max-width: 640px) {
  .exam-say {
    grid-template-columns: 90px 1fr;
  }

  .exam-say__avatar {
    width: 90px;
  }

  .exam-actions--result {
    justify-content: flex-end;
  }
}

/* =========================
   ノイズ演出（条件発火）
   ========================= */
.exam-noise {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 1px,
      rgba(0, 0, 0, 0.0) 2px,
      rgba(0, 0, 0, 0.0) 4px);
  filter: contrast(120%) brightness(90%);
}

body.is-noise .exam-noise {
  opacity: 0.9;
  animation: examNoiseFlicker 420ms steps(2, end) 1;
}

@keyframes examNoiseFlicker {
  0% {
    transform: translate(0, 0);
    opacity: 0.15;
  }

  25% {
    transform: translate(-2px, 1px);
    opacity: 0.85;
  }

  55% {
    transform: translate(2px, -1px);
    opacity: 0.55;
  }

  80% {
    transform: translate(-1px, -2px);
    opacity: 0.95;
  }

  100% {
    transform: translate(0, 0);
    opacity: 0;
  }
}


/* === EXAM: result box layout (image small on the left) === */
.exam-result__box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exam-result__characterImage {
  width: 120px;
  /* ←ここが“確実に小さくする”指定 */
  max-width: 28vw;
  /* スマホで暴れない保険 */
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.exam-result__text {
  flex: 1 1 auto;
  min-width: 0;
}

/* 端末が小さい時は少しだけ縮める */
@media (max-width: 600px) {
  .exam-result__characterImage {
    width: 96px;
  }
}

/* === EXAM RESULT: character image glow === */
.exam-result__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.exam-result__characterImage {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 10px;

  /* グロー（青系＋白） */
  filter:
    drop-shadow(0 0 6px rgba(120, 200, 255, 0.55)) drop-shadow(0 0 16px rgba(60, 150, 255, 0.35)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
}

.exam-result__text {
  flex: 1;
  min-width: 0;
}

.staff-doc {
  margin: 0 14px 14px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(255, 255, 255);
  background: rgb(129, 0, 26);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.staff-doc--archive {
  border-color: rgba(168, 168, 168, 0.26);
  background: rgb(37, 37, 37);
}

.staff-doc__label {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: rgb(161, 0, 0);
  background: rgba(255, 255, 255);
}

.staff-doc__title {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(253, 253, 253);
}

.staff-doc__meta {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(226, 232, 240);
}

.staff-doc__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(226, 232, 240);
}

.staff-doc__body+.staff-doc__body {
  margin-top: 8px;
}

.redacted {
  display: inline-block;
  padding: 0 0.25em;
  background: rgba(226, 232, 240, 0.9);
  color: transparent;
  user-select: none;
}

.deleted-note {
  color: rgb(255, 64, 64);
  letter-spacing: 0.08em;
}

.staff-message--faded {
  color: rgba(226, 232, 240, 0.46);
}

/* ===================================================================
   クリア後の世界線シフト（表示出し分け）
   judge: js/cleared-state.js が <html> に .arg-cleared を付与する。
     data-arg-when="precleared" … クリア前のみ表示（クリア後は隠す）
     data-arg-when="cleared"    … クリア後のみ表示（クリア前は隠す）
   既定（クラス未付与＝クリア前）では cleared 要素を隠すため、
   JS が無効・失敗しても安全に「クリア前の姿」になる。
   =================================================================== */
html:not(.arg-cleared) [data-arg-when="cleared"] { display: none !important; }
html.arg-cleared [data-arg-when="precleared"] { display: none !important; }