:root {
  /* 夜×藍×金の和モダン（TD「櫓戦記」の世界観に合わせた統一トーン） */
  --bg: #0c1017;
  --bg-soft: #131a27;
  --card: #141c2b;
  --card-hover: #1a2434;
  --line: #28324660; /* 半透明の罫 */
  --line-solid: #283246;
  --text: #eef2f7;
  --text-dim: #93a0b5;
  --gold: #d8b44a;
  --gold-soft: rgba(216, 180, 74, 0.14);
  --vermilion: #e0523d;
  --accent: var(--gold);
  --radius: 16px;
  --maxw: 960px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(760px 380px at 50% -150px, rgba(224, 82, 61, 0.10) 0%, rgba(12, 16, 23, 0) 58%),
    radial-gradient(1000px 520px at 50% -210px, rgba(216, 180, 74, 0.11) 0%, rgba(12, 16, 23, 0) 60%),
    radial-gradient(1200px 620px at 50% -260px, #1c2740 0%, rgba(12, 16, 23, 0) 62%),
    var(--bg);
}

/* 上辺のお祭り飾り罫（金×朱の水引色） */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent, var(--gold) 22%, var(--vermilion) 50%, var(--gold) 78%, transparent);
  opacity: 0.85;
}

a { color: var(--gold); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---- language switch ---- */
.topbar {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgba(20, 28, 43, 0.7);
  border: 1px solid var(--line-solid);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ---- account (sign-in) ---- */
.account-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(20, 28, 43, 0.7);
  border: 1px solid var(--line-solid);
  border-radius: 999px;
  padding: 6px 14px;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.account-btn:hover { color: var(--text); border-color: var(--gold); }
.account-btn.is-in {
  color: #14110f;
  background: var(--gold);
  border-color: var(--gold);
}
.account-btn.is-in::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: #2e7d32;
  vertical-align: middle;
}

.account-dialog {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-soft), var(--card));
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.account-dialog::backdrop { background: rgba(6, 9, 14, 0.6); backdrop-filter: blur(2px); }
.account-inner { position: relative; padding: 26px 24px 22px; }

.account-close {
  position: absolute;
  top: 12px; right: 12px;
  appearance: none;
  border: 0; background: transparent;
  color: var(--text-dim);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.account-close:hover { color: var(--text); }

.account-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.account-lead {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.account-google,
.account-email-btn {
  width: 100%;
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 11px 14px;
  transition: transform 0.12s ease, filter 0.15s ease, border-color 0.15s ease;
}
.account-google {
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.account-google::before {
  content: "";
  width: 18px; height: 18px;
  flex: 0 0 auto;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0 100%);
  -webkit-mask: radial-gradient(circle 8px at 50% 50%, transparent 6px, #000 6.5px);
  mask: radial-gradient(circle 8px at 50% 50%, transparent 6px, #000 6.5px);
  border-radius: 999px;
}
.account-google:hover { transform: translateY(-1px); filter: brightness(0.96); }

.account-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.account-or::before,
.account-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-solid);
}

.account-email {
  width: 100%;
  appearance: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(9, 13, 20, 0.6);
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 8px;
}
.account-email:focus { outline: none; border-color: var(--gold); }
.account-email-btn {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--gold);
}
.account-email-btn:hover { background: var(--gold-soft); }
.account-email-btn:disabled { opacity: 0.6; cursor: default; }

.account-msg {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  min-height: 1.2em;
  color: var(--text-dim);
}
.account-msg.ok { color: #7fce8b; }
.account-msg.err { color: #e0755f; }

.account-guest,
.account-signout {
  margin-top: 16px;
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.account-guest:hover,
.account-signout:hover { color: var(--text); }

.account-name {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
}
.account-field-label {
  display: block;
  margin: 4px 0 6px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}
.account-name-row {
  display: flex;
  gap: 8px;
}
.account-name-row .account-email {
  flex: 1;
  margin-bottom: 0;
}
.account-name-save {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #14110f;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 0 16px;
  white-space: nowrap;
  transition: filter 0.15s ease;
}
.account-name-save:hover { filter: brightness(1.06); }
.account-name-save:disabled { opacity: 0.6; cursor: default; }
.account-signedin-note { margin-top: 16px; }

/* ゲスト＝端末保存の注意書き（長期保存はアカウントを） */
.account-caveat {
  margin: 12px 0 0;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-dim);
  background: rgba(216, 180, 74, 0.08);
  border: 1px solid rgba(216, 180, 74, 0.28);
  border-radius: 10px;
}

/* 実績（アカウントダイアログ内・正式公開ゲームのみ） */
.account-achv { margin-top: 18px; border-top: 1px solid rgba(216, 180, 74, 0.25); padding-top: 14px; text-align: left; }
.achv-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.achv-title { font-weight: 800; font-size: 14px; color: var(--gold); }
.achv-total { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* 進捗バー（総合／ゲーム別で共用） */
.achv-prog { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.achv-head + .achv-prog { margin-bottom: 14px; }
.achv-prog-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #b9902f, var(--gold)); transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ゲーム＝開閉アコーディオン */
.achv-game { margin-bottom: 8px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.achv-game.complete { border-color: rgba(216, 180, 74, 0.4); background: rgba(216, 180, 74, 0.05); }
.achv-game-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 12px; margin: 0; border: 0; background: transparent;
  font-family: inherit; color: inherit; text-align: left; cursor: pointer;
}
.achv-game-head:hover { background: rgba(255, 255, 255, 0.04); }
.achv-game-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.achv-chev { flex: 0 0 auto; font-size: 10px; color: var(--text-dim); transition: transform .2s ease; transform: rotate(-90deg); }
.achv-game.open .achv-chev { transform: rotate(0deg); }
.achv-game-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achv-game.complete .achv-game-title { color: var(--gold); }
.achv-game-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 1 1 auto; max-width: 46%; }
.achv-game-meta .achv-prog { flex: 1 1 auto; min-width: 30px; }
.achv-game-count { flex: 0 0 auto; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.achv-game.complete .achv-game-count { color: var(--gold); }

/* 展開部（既定は閉じ） */
.achv-items { padding: 2px 12px 10px; }
.achv-game:not(.open) .achv-items { display: none; }
.achv-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; }
.achv-ic { font-size: 14px; line-height: 1.5; flex: 0 0 auto; width: 16px; text-align: center; }
.achv-item.unlocked .achv-ic { color: var(--gold); }
.achv-item.locked .achv-ic { color: var(--text-dim); opacity: 0.5; }
.achv-item.locked .achv-txt { opacity: 0.5; }
.achv-txt { display: flex; flex-direction: column; min-width: 0; }
.achv-name { font-size: 13px; font-weight: 600; color: var(--text); }
.achv-desc { font-size: 11.5px; color: var(--text-dim); }
.achv-pct { flex: 0 0 auto; margin-left: auto; align-self: center; font-size: 11px; color: var(--gold); background: rgba(216, 180, 74, 0.12); border: 1px solid rgba(216, 180, 74, 0.3); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

.account-signout {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  color: var(--text);
}
.account-signout:hover { border-color: var(--vermilion); color: var(--vermilion); }

.lang-switch button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: transparent;
  padding: 5px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-switch button:hover { color: var(--text); }

.lang-switch button[aria-pressed="true"] {
  color: #14110f;
  background: var(--gold);
}

/* ---- header / hero ---- */
.site-header {
  position: relative;
  overflow: visible; /* おみくじのポップを切り取らない（seigaihaは::beforeがinset:0で収まる） */
  padding: calc(56px + env(safe-area-inset-top)) 0 32px;
  border-bottom: 1px solid var(--line);
}
/* 背景装飾だけは header 内にクリップ */
.site-header::before { clip-path: inset(0); }

/* 青海波（せいがいは）風の淡い装飾 */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20px 24px, transparent 9px, rgba(216, 180, 74, 0.06) 10px, transparent 11px),
    radial-gradient(circle at 0px 24px, transparent 9px, rgba(216, 180, 74, 0.06) 10px, transparent 11px),
    radial-gradient(circle at 40px 24px, transparent 9px, rgba(216, 180, 74, 0.06) 10px, transparent 11px);
  background-size: 40px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
  mask-image: linear-gradient(180deg, #000, transparent 75%);
}

.site-header .wrap { position: relative; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: none;
  color: var(--gold);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  vertical-align: middle;
  background: var(--gold);
  opacity: 0.7;
}
.eyebrow::before { margin-right: 12px; }
.eyebrow::after { margin-left: 12px; }

/* 表示ユーティリティ（.hidden が無いとおみくじのポップ等が閉じない） */
.hidden { display: none !important; }
/* hidden 属性を最優先（display 指定に負けないように） */
[hidden] { display: none !important; }

/* ロゴ：水引の紋（頭）＋筆文字「みくじゲームズ」 */
.site-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 2px 0 0;
}
.brand-knot {
  width: clamp(122px, 32vw, 166px);
  height: auto;
  margin-bottom: -10px;
  pointer-events: none;
  user-select: none;
}
.brand-word {
  font-family: "BrandBrush", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(34px, 9vw, 56px);
  letter-spacing: 0.06em;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
}
.brand-word .accent {
  margin-left: 0.24em;
  color: var(--text);
}

/* 旧テキストロゴ用（フォールバック） */
.site-title { margin: 0; font-family: "BrandBrush", "Yu Mincho", serif; }

.site-catch {
  margin: 14px 0 0;
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.site-count {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.site-count b { color: var(--text); font-weight: 700; }

/* ================= ヘッダー配置＋おみくじ（小・タイトル右） ================= */
.site-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.hero-text { min-width: 0; }

/* マスコット（猫＋吹き出し）：ワードマーク直後・下線に底揃え */
.hub-mascot {
  flex: 0 0 auto; align-self: flex-end; position: relative;
  display: flex; align-items: flex-end;
}
.hub-neko {
  width: auto; height: 152px; margin-bottom: -30px;   /* 下線から出てくるように少し下へ */
  /* ヒゲ等の細い黒線が暗い背景に溶けないよう、クリーム色の細い縁取り＋落ち影 */
  filter:
    drop-shadow(1.2px 0 0 rgba(250, 246, 236, 0.9))
    drop-shadow(-1.2px 0 0 rgba(250, 246, 236, 0.9))
    drop-shadow(0 1.2px 0 rgba(250, 246, 236, 0.9))
    drop-shadow(0 -1.2px 0 rgba(250, 246, 236, 0.9))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
/* おみくじの一言は「みくじ(猫)」の担当＝猫の頭の上に吹き出しで表示
   （おみくじ結果ポップは右上から下方向に開くため、猫の上に置いて重なりを回避） */
.neko-say {
  position: absolute; left: 0; bottom: calc(100% + 12px);
  width: max-content; max-width: 260px; margin: 0; padding: 10px 15px; border-radius: 16px;
  background: #fbf7ee; color: #33291d; font-size: 13px; line-height: 1.6; font-weight: 500;
  text-align: left; border: 1px solid rgba(216, 180, 74, 0.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32); z-index: 4;
}
.neko-say::after {
  content: ""; position: absolute; bottom: -8px; left: 24px; width: 14px; height: 14px;
  background: #fbf7ee; border-right: 1px solid rgba(216, 180, 74, 0.55);
  border-bottom: 1px solid rgba(216, 180, 74, 0.55);
  transform: rotate(45deg); border-radius: 0 0 4px 0;
}
.neko-say[hidden] { display: none; }
/* コメントは猫が担当するので、おみくじウィジェット側の本文は隠す（レベル/今日の一本は残す） */
#mikuji-msg { display: none; }
@media (max-width: 720px) { .hub-neko { height: 112px; } }
@media (max-width: 480px) {
  .hub-mascot { align-self: flex-start; flex-direction: column; align-items: flex-start; }
  .hub-neko { height: 92px; }
  /* モバイルはヘッダーが縦に詰まっていて、吹き出しをどこに浮かせても
     ロゴか次のおみくじボタンのどちらかと衝突するため、絶対配置をやめて
     普通の行として猫の下に流す＝後続要素が自動で押し下げられ衝突しない */
  .neko-say { position: static; max-width: none; width: auto; margin-top: 8px; font-size: 12px; }
  .neko-say::after { display: none; }
}

/* ロゴ：Mikuji=朱 / Games=金 */
.brand-mi { color: var(--vermilion); }

/* おみくじ紋（ロゴ頭・favicon・OGPと共通デザイン） */
.brand-emblem {
  height: 0.92em;
  width: auto;
  vertical-align: -0.14em;
  margin-right: 0.3em;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

/* 小さなおみくじウィジェット */
.mikuji-mini { position: relative; flex: 0 0 auto; margin-top: 4px; margin-left: auto; }

.mikuji-trigger {
  appearance: none;
  border: 1px solid var(--line-solid);
  background: rgba(20, 28, 43, 0.55);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.mikuji-trigger:hover { border-color: var(--gold); color: var(--text); }

.mikuji-can { display: block; width: 26px; flex: 0 0 auto; transition: transform 0.15s ease; }
.mikuji-can svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)); }
.mikuji-trigger:hover .mikuji-can { transform: translateY(-2px); }

.mikuji-trigger-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }

/* 引いた後：ラベル→運勢バッジ（筆フォント） */
.mikuji-badge {
  display: none;
  font-family: "MikujiFortune", "Yu Mincho", "Noto Serif JP", serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.mikuji-mini.drawn .mikuji-trigger-label { display: none; }
.mikuji-mini.drawn .mikuji-badge { display: inline-block; }
.mikuji-badge.f-daikichi { color: #f0d27a; text-shadow: 0 0 10px rgba(216, 180, 74, 0.6); }
.mikuji-badge.f-kyo, .mikuji-badge.f-daikyo { color: #8aa0c0; }

/* 振るアニメ */
.mikuji-mini.shaking .mikuji-can { animation: mikuji-shake 0.66s ease; }
@keyframes mikuji-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-3px) rotate(-9deg); }
  35% { transform: translateX(3px) rotate(10deg); }
  55% { transform: translateX(-3px) rotate(-8deg); }
  75% { transform: translateX(2px) rotate(6deg); }
}
.mikuji-mini.shaking .mikuji-stick { animation: mikuji-stick 0.66s ease forwards; }
@keyframes mikuji-stick {
  0% { transform: translateY(0); }
  60% { transform: translateY(-1.5px); }
  100% { transform: translateY(-6px); }
}

/* 御籤（小さなポップ） */
.mikuji-result {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 30;
  width: 232px;
  padding: 16px 16px 14px;
  text-align: center;
  color: #2a2015;
  background: linear-gradient(180deg, #f7f0e2, #ece2cd);
  border-radius: 8px;
  border-top: 5px solid #b3372c;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.mikuji-result::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 22px;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: #b3372c;
}
.mikuji-result.reveal { animation: mikuji-reveal 0.34s ease; }
@keyframes mikuji-reveal {
  0% { transform: translateY(-8px) scale(0.96); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.mikuji-close {
  position: absolute;
  top: 6px;
  right: 8px;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #9a8c72;
  font-size: 13px;
  line-height: 1;
  padding: 2px;
}
.mikuji-close:hover { color: #5a4a34; }

.mikuji-level {
  display: block;
  margin-top: 2px;
  font-family: "MikujiFortune", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0.08em;
  color: #8a1f18;
}
.mikuji-level-en {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #93805f;
}
.mikuji-msg { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: #3a2c1c; }
.mikuji-pick { margin: 9px 0 0; font-size: 12px; color: #5a4a34; }
.mikuji-pick a { color: #8a1f18; font-weight: 800; text-decoration: none; }
.mikuji-pick a:hover { text-decoration: underline; }
.mikuji-note { margin: 9px 0 0; font-size: 10px; color: #a19175; }
.mikuji-mute {
  margin-top: 8px;
  appearance: none;
  border: 1px solid #d8cbb0;
  background: transparent;
  color: #8a7a5f;
  width: 30px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.mikuji-mute:hover { border-color: #b3372c; color: #8a1f18; }

/* 運勢ごとのアクセント */
.mikuji-result.f-daikichi { border-top-color: #d8b44a; }
.mikuji-result.f-daikichi::before { border-bottom-color: #d8b44a; }
.mikuji-result.f-daikichi .mikuji-level { color: #b8860b; text-shadow: 0 0 14px rgba(216, 180, 74, 0.5); }
.mikuji-result.f-kyo .mikuji-level,
.mikuji-result.f-daikyo .mikuji-level { color: #45526a; }
.mikuji-result.f-daikyo { border-top-color: #45526a; }
.mikuji-result.f-daikyo::before { border-bottom-color: #45526a; }

@media (max-width: 560px) {
  .mikuji-mini { flex-basis: 100%; display: flex; justify-content: flex-end; margin-top: 2px; }
}

/* ---- grid ---- */
main.wrap { flex: 1; padding-block: 36px 56px; }

.section-label {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, var(--card), #121826);
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    border-color 0.16s ease;
}

/* 上辺の金のアクセント（ホバーで灯る） */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  outline: none;
}

.card:hover::before,
.card:focus-visible::before { opacity: 1; }

/* サムネイル（カード上部にフルブリード） */
.card-thumb {
  margin: -22px -22px 4px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: #10151f;
  border-bottom: 1px solid var(--line-solid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.card:hover .card-thumb img,
.card:focus-visible .card-thumb img {
  transform: scale(1.04);
}

/* 画像が無い／失敗したときのモノグラム */
.card-thumb.noimg {
  background:
    radial-gradient(120% 130% at 28% 18%, #1e2a44 0%, #0e131d 70%);
}

.card-mono {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  opacity: 0.5;
  user-select: none;
}

.card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(216, 180, 74, 0.34);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.card-cta {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  border: 1px solid rgba(216, 180, 74, 0.5);
  padding: 5px 13px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.card:hover .card-cta,
.card:focus-visible .card-cta {
  color: #14110f;
  background: var(--gold);
  border-color: var(--gold);
}

.card-cta::after { content: " →"; }

.badge-new {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #14110f;
  background: var(--vermilion);
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(224, 82, 61, 0.4);
}

/* ベータ版バッジ */
.badge-beta {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #14110f;
  background: var(--gold, #d8b44a);
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(216, 180, 74, 0.4);
}

/* 制作中（COMING SOON）カード：表示するがクリック不可 */
.badge-wip {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #cdd6e4;
  background: #2a3446;
  border: 1px solid #3a4658;
  padding: 3px 9px;
  border-radius: 999px;
}

.card-wip {
  cursor: default;
  opacity: 0.68;
}

/* 制作中カードはホバー反応させない */
.card-wip:hover,
.card-wip:focus-visible {
  transform: none;
  border-color: var(--line-solid);
  box-shadow: none;
}
.card-wip:hover::before,
.card-wip:focus-visible::before { opacity: 0; }

.card-soon {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* スマホは2列のコンパクトなカード（サムネ中心で一覧しやすく）。
   ※基底 .game-grid / .card 群より後に置くこと（同スペシフィシティは後勝ち） */
@media (max-width: 560px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { padding: 14px; gap: 8px; border-radius: 13px; }
  .card-thumb { margin: -14px -14px 2px; border-radius: 13px 13px 0 0; }
  .card-title { font-size: 14px; letter-spacing: 0; line-height: 1.25; }
  .card-desc { display: none; }
  .card-tags { gap: 5px; }
  .tag { font-size: 10px; padding: 2px 8px; }
  .card-cta { font-size: 12px; }
  .card-soon { font-size: 12px; }
  .badge-new, .badge-beta, .badge-wip { top: 10px; right: 10px; font-size: 9px; padding: 2px 7px; }
}

/* ================= ハブ強化：挨拶・ヒーロー・並べ替え・お気に入り ================= */
.hub-greeting {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.hero { display: block; margin: 0 0 26px; }
/* CLS対策：今日の一本はJSで後入れ。挿入前だけ空間を予約し（:empty）、
   挿入後は自然サイズに戻す＝初回訪問の「0→カード出現」の押し下げを防ぐ */
.hero:empty { min-height: 224px; }
.hero-card {
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--card), #121826);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.hero-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 100% 0%, rgba(216, 180, 74, 0.10), transparent 55%);
  pointer-events: none;
}
.hero-card:hover, .hero-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  outline: none;
}
.hero-thumb {
  flex: 0 0 44%;
  max-width: 340px;
  background: #10151f;
  border-right: 1px solid var(--line-solid);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-body {
  flex: 1;
  min-width: 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.hero-label {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #14110f;
  background: var(--gold);
  padding: 3px 10px;
  border-radius: 999px;
}
.hero-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.02em; }
.hero-desc { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-dim); }
.hero-cta {
  align-self: flex-start;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #14110f;
  background: linear-gradient(180deg, #f2cd68, #d8a838);
  padding: 9px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(216, 180, 74, 0.28);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.hero-card:hover .hero-cta,
.hero-card:focus-visible .hero-cta {
  filter: brightness(1.05);
  box-shadow: 0 7px 22px rgba(216, 180, 74, 0.42);
}
.hero-cta::after { content: " ▶"; font-size: 10px; }

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.game-toolbar .section-label { margin: 0; }

.game-sort { display: flex; gap: 6px; flex-wrap: wrap; }
.game-sort button {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(20, 28, 43, 0.6);
  border: 1px solid var(--line-solid);
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.game-sort button:hover { color: var(--text); border-color: var(--gold); }
.game-sort button.on { color: #14110f; background: var(--gold); border-color: var(--gold); }

.card-fav {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  appearance: none;
  border: 0;
  background: rgba(9, 13, 20, 0.5);
  color: #d8cdbd;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  backdrop-filter: blur(3px);
  transition: color 0.15s ease, transform 0.12s ease;
}
.card-fav:hover { transform: scale(1.1); color: var(--gold); }
.card-fav.on { color: var(--gold); }

/* みんなのプレイ数（グローバル人気） */
.card-plays {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
/* プレイ数＋追加日のメタ行（サイトが更新されてる＝生きてる感を出す） */
.card-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.card-date { font-size: 11px; color: var(--text-dim); opacity: 0.75; letter-spacing: 0.02em; white-space: nowrap; }
.hero-plays { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* 広告：ダーク基調で白い広告枠が浮かないよう“スポンサーカード”に収める。
   手動広告ユニット（data-ad-slot付き <ins>）を <div class="ad-card"> で包んで使う。 */
.ad-card {
  margin: 26px auto 0;
  max-width: var(--maxw);
  background: var(--bg-soft);
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}
.ad-card > .ad-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ad-card .adsbygoogle { display: block; }

@media (max-width: 560px) {
  .hero-card { flex-direction: column; }
  .hero-thumb { flex-basis: auto; max-width: none; width: 100%; border-right: 0; border-bottom: 1px solid var(--line-solid); }
  .hero-body { padding: 14px 16px; }
  .hero-title { font-size: 18px; }
  .hero { margin-bottom: 20px; }
  .hero:empty { min-height: 440px; } /* 狭幅は縦積みで背が高い分、予約も大きく */
  .game-toolbar { margin-bottom: 12px; }
  .game-sort button { font-size: 11px; padding: 5px 10px; }
  .card-fav { top: 8px; left: 8px; width: 34px; height: 34px; font-size: 15px; }
}

/* サイト紹介（SEO用の静的テキスト） */
.site-intro {
  margin: 30px auto 0;
  max-width: 720px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
}

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  color: var(--text-dim);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.footer-nav a:hover { color: var(--gold); }

.site-footer small { font-size: 12px; letter-spacing: 0.04em; }

.empty { color: var(--text-dim); font-size: 14px; }

/* ================= 法務・情報ページ（プライバシーポリシー等） ================= */
.page-header {
  padding: 40px 0 22px;
  border-bottom: 1px solid var(--line);
}

.page-header .back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
}
.page-header .back:hover { color: var(--gold); }

.page-title {
  margin: 0;
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.page-updated {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.legal {
  max-width: 760px;
  padding-block: 30px 60px;
  line-height: 1.85;
  font-size: 15px;
  color: #d9e0ea;
}

.legal .lead { color: var(--text-dim); }

.legal h2 {
  margin: 34px 0 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

.legal h3 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.legal p { margin: 0 0 14px; }

.legal ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}
.legal li { margin: 6px 0; }

.legal a { color: var(--gold); word-break: break-all; }

.legal .note {
  margin-top: 34px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dim);
}
