/* PlayNagi 共通スタイル（ホーム用） */
:root {
  /* 地。黒ではなく墨紺。彩度のある色は画面の5%までに抑える */
  --bg: #0B0E12;
  --bg-soft: #12161C;
  --panel: #12161C;
  --panel-hover: #171C24;
  --sunken: #080A0D;
  --line: #232A33;
  --line-strong: #313A46;
  /* 文字。純白は使わない（残像が出るため） */
  --text: #DCE2EA;
  --text-sub: #959EAB;
  --text-weak: #7E8896;
  /* 押せるものの色は銅ひとつ。前の青紫と黄の二色使いをやめる（2026-09-17） */
  --brand1: #C4703F;
  --brand2: #C4703F;
  --accent-hi: #D8854F;
  --ink: #120C07;      /* 銅の上に置く文字 */
  --data: #56A79A;     /* 数値・進み具合 */
  --warn: #C05A6E;     /* 危険・失敗 */
  --gold: #C9A45C;     /* 画面で一番大事な数字ひとつだけ */
  /* 角は落とす。丸みで「全部同じ顔」に見えていた */
  --radius: 0px;
  --radius-pill: 2px;
  --mono: ui-monospace, SFMono-Regular, Menlo, "Noto Sans Mono", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* 選択の抑止。
   iPhone で一覧をなぞったり長押ししたりすると画面全体が青く選択される。
   カードを指で押す作りなので、選択できて得することは無い。
   本文のうち「読ませたい文章」だけは選べるまま残す（説明文・更新履歴）。 */
body {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  /* 拡大の抑止（2026-08-20 人間の指示）。
     一覧は縦に長いので none にはできない——指で送れなくなる。
     pan-y なら縦送りは残したまま、二本指の拡大と二度叩きの拡大だけ止まる。
     押すだけの要素（カード・札・タブ）は none にしてよい。 */
  touch-action: pan-y;
}
a, button, .card, .chip, .tab, [role="button"] { touch-action: manipulation; }
html { touch-action: pan-y; }
p, .game-desc, .update-body, article p, .section-note {
  -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}
/* ロゴは画像（gpt-image で生成した紋章と文字。2026-09-27 人間の指示で差し替え） */
.logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
}
.logo-mark { display: block; width: auto; height: 36px; }
@media (max-width: 380px) { .logo-mark { height: 30px; } }
.header-note {
  margin-left: auto;
  color: var(--text-sub);
  font-size: 12px;
  white-space: nowrap;
}

/* ヒーロー */
.hero {
  padding: 40px 0 8px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(22px, 4.5vw, 34px);
  font-weight: 800;
  line-height: 1.35;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: clamp(13px, 2.5vw, 15px);
}

/* 検索・フィルタ */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 20px 0 4px;
}
.search {
  flex: 1 1 240px;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search:focus { border-color: var(--brand1); }
.search::placeholder { color: var(--text-sub); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tag-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-sub);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.tag-btn:hover { color: var(--text); border-color: var(--brand1); }
.tag-btn.active {
  color: #fff;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  border-color: transparent;
}

/* ゲームグリッド */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding: 24px 0 48px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent, var(--brand1)) 60%, var(--line-strong));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.card .thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  font-size: 52px;
  background:
    radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--card-accent, var(--brand1)) 16%, transparent), transparent 62%),
    linear-gradient(160deg, var(--bg-soft), var(--panel));
}
.card .thumb .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h2 { font-size: 16px; font-weight: 700; }
.card .desc { font-size: 13px; color: var(--text-sub); flex: 1; }
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
}
.card .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.card .chip {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.card .play {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--card-accent, var(--brand1)) 72%, var(--panel));
  border-radius: var(--radius-pill);
  padding: 9px 0;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-sub);
  padding: 48px 0;
}

/* フッター */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--text-sub);
  font-size: 12px;
  text-align: center;
}
.site-footer a { color: var(--brand1); }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card .thumb { font-size: 40px; }
  .header-note { display: none; }
}

/* ============================================================
   更新情報リーチ（docs/strategy/update-reach-design.md）
   ============================================================ */

.header-link {
  margin-left: auto;
  color: var(--text-sub);
  font-size: 13px;
  white-space: nowrap;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: color .2s, border-color .2s;
}
.header-link:hover { color: var(--text); border-color: var(--brand1); }

/* 前回訪問以降の差分バナー */
.update-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px auto 0;
  max-width: 560px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--brand1);
  border-radius: var(--radius);
}
.update-banner .pulse {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: var(--brand2);
  box-shadow: none;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: none; }
  100% { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .update-banner .pulse { animation: none; }
}
.update-banner .banner-text { flex: 1; font-size: 14px; }
.update-banner .banner-btn {
  flex: none;
  background: var(--brand1);
  color: var(--ink); border: none; border-radius: var(--radius-pill);
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}

/* プレイ直後の文脈ストリップ（?from=<slug>） */
.from-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.from-strip .from-msg { font-size: 15px; font-weight: 700; }
.from-strip .from-next {
  margin-left: auto;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: color-mix(in srgb, var(--card-accent, var(--brand1)) 78%, var(--panel));
}

/* 特別フィルタ（新着・未プレイ） */
.tag-btn.special { border-color: var(--brand1); color: var(--text); }

/* カードのバッジ */
.card .thumb .badge.new { background: var(--gold); color: var(--ink); }
.card .thumb .badge.unplayed { background: var(--panel-hover); color: var(--text); border: 1px solid var(--line); }

/* 更新履歴ページ */
.timeline { padding: 24px 0 48px; max-width: 720px; margin: 0 auto; }
.tl-group { margin-bottom: 28px; }
.tl-date {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700;
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.tl-count {
  font-size: 11px; font-weight: 500; color: var(--text-sub);
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 1px 10px;
}
.tl-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--card-accent, var(--brand1));
  border-radius: var(--radius-pill);
  transition: background .18s, transform .18s;
}
.tl-item:hover { background: var(--panel-hover); transform: translateX(3px); }
.tl-emoji { font-size: 30px; flex: none; }
.tl-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tl-desc { font-size: 12px; color: var(--text-sub); }
.tl-played, .tl-unplayed {
  flex: none; font-size: 11px; border-radius: var(--radius-pill); padding: 2px 10px;
}
.tl-played { color: var(--text-sub); border: 1px solid var(--line); }
.tl-unplayed { color: var(--ink); background: var(--gold); font-weight: 700; }

@media (max-width: 480px) {
  .update-banner { flex-wrap: wrap; }
  .update-banner .banner-text { flex: 1 1 100%; }
  .from-strip .from-next { margin-left: 0; flex: 1 1 100%; text-align: center; }
}

/* 更新履歴の行（新作 / 追加コンテンツ） */
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-label {
  flex: none; font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill); padding: 1px 7px;
}
.tl-label.game { background: var(--gold); color: var(--ink); }
.tl-label.addition { background: var(--brand1); color: #fff; }
.tl-series {
  font-size: 11px; color: var(--text-sub);
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0 6px;
}

/* ホームの主軸: 人気・更新・カテゴリ */
.home-section { margin-top: 34px; }
.section-heading,
.all-games-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.section-heading h2,
.all-games-heading h2 {
  font-size: clamp(20px, 4vw, 27px);
  line-height: 1.25;
}
.section-kicker {
  color: var(--brand1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  margin-bottom: 2px;
}
.section-note {
  max-width: 420px;
  color: var(--text-sub);
  font-size: 12px;
  text-align: right;
}
.section-link {
  color: var(--accent-hi);
  font-size: 13px;
  font-weight: 700;
}
.section-link:hover { color: #fff; }

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
  gap: 14px;
}
.rank-one {
  position: relative;
  min-height: 260px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--brand1);
  border-radius: var(--radius-pill);
  box-shadow: none;
}
.rank-one::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  bottom: -100px;
  border-radius: 50%;
  background: rgba(196, 112, 63, .16);
}
.rank-crown {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 2;
  color: #ffe47a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.rank-one-emoji {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 138px;
  aspect-ratio: 1;
  border-radius: var(--radius-pill);
  font-size: 72px;
  background: rgba(8, 11, 25, .42);
  border: 1px solid rgba(255, 255, 255, .1);
  transform: rotate(-3deg);
}
.rank-one-copy { position: relative; z-index: 2; min-width: 0; }
.rank-one-copy h3 {
  margin-bottom: 8px;
  font-size: clamp(24px, 4.5vw, 36px);
  line-height: 1.15;
}
.rank-one-copy p {
  color: #b6bedc;
  font-size: 14px;
  max-width: 48ch;
}
.rank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.primary-action {
  color: var(--ink);
  background: var(--brand1);
  border: 1px solid var(--brand1);
}
.primary-action:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.secondary-action {
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .18);
}

.ranking-list {
  list-style: none;
  display: grid;
  gap: 8px;
}
.rank-item {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.rank-item.is-top { border-color: rgba(201, 164, 92, .45); }
.rank-number {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-sub);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}
.rank-item.is-top .rank-number {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums; color: var(--gold); }
.rank-emoji { font-size: 28px; text-align: center; }
.rank-item-copy { display: flex; flex-direction: column; min-width: 0; }
.rank-item-copy a {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-item-copy a:hover { color: var(--accent-hi); }
.rank-meta { color: var(--text-sub); font-size: 11px; }

.inline-stage {
  margin-top: 14px;
  overflow: hidden;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.inline-stage[hidden] { display: none; }
.inline-stage-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #51cf66;
  box-shadow: none;
}
.inline-stage-head button {
  min-width: 64px;
  min-height: 36px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font: inherit;
  cursor: pointer;
}
.inline-stage iframe {
  display: block;
  width: 100%;
  height: min(720px, 74svh);
  min-height: 520px;
  background: var(--bg);
  border: 0;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.recent-card {
  position: relative;
  overflow: hidden;
  min-height: 152px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--update-accent, var(--brand1));
  border-radius: var(--radius-pill);
  transition: background .18s, transform .18s;
}
.recent-card:hover { background: var(--panel-hover); transform: translateY(-2px); }
.recent-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-sub);
  font-size: 10px;
}
.recent-kind {
  color: #fff;
  background: rgba(196, 112, 63, .3);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-weight: 800;
}
.recent-card strong { font-size: 14px; line-height: 1.4; }
.recent-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-sub);
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.all-games-heading { margin-top: 40px; margin-bottom: 8px; }

.primary-action:focus-visible,
.secondary-action:focus-visible,
.inline-stage-head button:focus-visible,
.rank-item-copy a:focus-visible,
.recent-card:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .ranking-layout { grid-template-columns: 1fr; }
  .ranking-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rank-item {
    grid-template-columns: 26px 36px minmax(0, 1fr);
    min-height: 68px;
    padding: 8px;
  }
  .rank-meta { display: none; }
  .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .hero { padding-top: 26px; }
  .section-heading { align-items: flex-start; }
  .section-note { max-width: 180px; }
  .rank-one {
    min-height: 0;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 15px;
    padding: 52px 16px 20px;
  }
  .rank-one-emoji { width: 78px; border-radius: var(--radius-pill); font-size: 42px; }
  .rank-one-copy h3 { font-size: 22px; }
  .rank-one-copy p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .rank-actions { margin-top: 14px; }
  .primary-action,
  .secondary-action { flex: 1 1 100%; }
  .ranking-list { grid-template-columns: 1fr; }
  .inline-stage iframe { height: 68svh; min-height: 480px; }
  .recent-grid { grid-template-columns: 1fr; }
  .recent-card { min-height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .recent-card,
  .rank-one-emoji { transition: none; transform: none; }
}

/* ============================================================
   ホームの可読性・動線の改善
   - 日本語見出しが単語の途中で折れる問題
   - モバイルでファーストビューにプレイ導線が入らない問題
   ============================================================ */

/* 日本語見出しは既定だと任意の文字位置で折れ、「無/料」のように語が割れる。
   auto-phrase は文節単位で折り返す（非対応ブラウザは従来どおりで害がない）。 */
.hero h1,
.section-heading h2,
.all-games-heading h2,
.rank-one-copy h3,
.card h2 {
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

/* 注記はチップ化して1行に収める（「暫定」の明示は維持する） */
.section-note.is-chip {
  flex: none;
  max-width: none;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  color: var(--text-sub);
}

@media (max-width: 560px) {
  /* ヒーローを圧縮し、1位カードの「この画面で遊ぶ」を初回表示内へ入れる */
  .hero { padding: 18px 0 4px; }
  .hero h1 { font-size: 21px; }
  .hero p { margin-top: 6px; font-size: 12px; }
  .home-section { margin-top: 20px; }
  .section-heading,
  .all-games-heading { gap: 8px; margin-bottom: 10px; }
  .section-heading h2,
  .all-games-heading h2 { font-size: 19px; }

  /* 左右分割だと注記が細い柱に潰れるため、縦に積んで全幅で読ませる */
  .section-heading { flex-wrap: wrap; align-items: center; }
  .section-note { max-width: none; text-align: left; font-size: 11px; }

  .rank-one { padding: 46px 14px 18px; }
  .all-games-heading { margin-top: 28px; }
}

/* hidden 属性は UA の display:none を author の display:flex が打ち消してしまうため、
   空の枠が残っていた。対象要素で明示的に無効化する。 */
.from-strip[hidden],
.update-banner[hidden],
.home-section[hidden],
.inline-stage[hidden],
.rank-actions [hidden] { display: none !important; }

/* 66本規模でのタグ導線（2026-08-17）
   タグ30種になると、既定表示のままでは画面が導線で埋まる。
   「もっと見る」と「畳む」を見た目でも他のボタンと区別する。 */
.tag-btn.tag-more { border-style: dashed; opacity: .9; }

/* ---- 難易度 ----
   遊ぶ人が自分に合うものを選べるようにする。数字だけでは伝わらないので、
   語（やさしい／ふつう／むずかしい）と、埋めた点の数の両方で出す。
   色は3段だけにする。5段すべてを別色にすると読み分けの負担が増えて、
   かえって「どれが自分向けか」が分からなくなる。 */
.diffbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.diffbar-label { color: var(--text-sub); font-size: 13px; }
.diffbtn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text-sub);
  border-radius: var(--radius-pill); padding: 6px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: background .15s, color .15s, border-color .15s;
}
.diffbtn:hover { background: var(--panel-hover); color: var(--text); }
.diffbtn.is-on { color: var(--ink); font-weight: 700; border-color: transparent; }
.diffbtn.diff-easy.is-on { background: #7ed492; }
.diffbtn.diff-mid.is-on  { background: #f0c860; }
.diffbtn.diff-hard.is-on { background: #f08a6a; }
.diffbtn:focus-visible { outline: 2px solid var(--brand1); outline-offset: 2px; }

/* 既存の .card .thumb .badge（詳細度3）に負けないよう、同じ深さで書く。
   NEW／未プレイは左上に出るので、難易度は左下へ置いて重ならないようにする。 */
.card .thumb .badge.diff {
  position: absolute; left: 10px; bottom: 10px; top: auto; right: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  background: rgba(11, 14, 18, .82);
  border: 1px solid rgba(255, 255, 255, .16);
}
/* 点は <i>。インライン要素のままだと width/height が効かないので inline-block にする */
.card .thumb .badge.diff .dots { display: inline-flex; gap: 3px; }
.card .thumb .badge.diff .dots i {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.card .thumb .badge.diff.diff-easy { color: #9fe6ae; }
.card .thumb .badge.diff.diff-mid  { color: #f5d585; }
.card .thumb .badge.diff.diff-hard { color: #f5a68b; }
.card .thumb .badge.diff.diff-easy .dots i.on { background: #7ed492; }
.card .thumb .badge.diff.diff-mid  .dots i.on { background: #f0c860; }
.card .thumb .badge.diff.diff-hard .dots i.on { background: #f08a6a; }

/* ---- カードのプレイ映像 ----
   カーソルを載せている間だけ、サムネイルの上に重ねて流す。
   絵文字はその間だけ隠す（消すのではなく透かす。読み込みに失敗したときは
   is-previewing が付かないので、絵文字がそのまま残る）。 */
.card .thumb .preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
  border-radius: inherit;
}
.card.is-previewing .thumb .preview { opacity: 1; }
.card .thumb .emoji { transition: opacity .22s ease; }
/* タイトル画面から起こしたアイコン。絵文字と同じ場所に、同じ大きさの正方形として置く。
   サムネの流れ（16:9 の枠）に参加させず、絶対配置で枠の中に収める。in-flow の img は
   高さ % が効かず原寸で置かれ、枠を押し広げて同じ段のカードの位置をずらしていた。 */
.card .thumb .thumb-icon {
  position: absolute; left: 50%; top: 50%;
  height: 62%; width: auto; aspect-ratio: 1 / 1; max-width: 72%;   /* 枠の高さに合わせた正方形 */
  transform: translate(-50%, -56%);                                 /* 左下の難易度バッジの上に収める */
  object-fit: cover;
  border-radius: var(--radius-pill); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  transition: opacity .22s ease, transform .22s ease;
}
.card:hover .thumb .thumb-icon { transform: translate(-50%, -56%) scale(1.04); }
.card.is-previewing .thumb .thumb-icon { opacity: 0; }
.rank-one-emoji:has(.rank-one-poster) { background: rgba(8, 11, 25, .42); padding: 0; overflow: hidden; }
.rank-one-poster { width: 100%; height: 100%; border-radius: var(--radius-pill); object-fit: cover; display: block; }
.rank-poster { width: 42px; height: 42px; border-radius: var(--radius-pill); object-fit: cover; display: block; border: 1px solid rgba(255, 255, 255, .1); }
@media (prefers-reduced-motion: reduce) { .card:hover .thumb .thumb-icon { transform: translate(-50%, -56%); } }
.card.is-previewing .thumb .emoji { opacity: 0; }
/* プレイ映像の1フレーム目。枠いっぱいに敷き、ホバー映像はこの上に重なる */
.card .thumb .thumb-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}
/* バッジは映像の上に残す。何を見ているのかが分からなくなるため */
.card .thumb .badge { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .card .thumb .preview { display: none; }
}

/* ---- 人気・最近更新のアイテム背景に流す控えめなプレイ映像 ----
   ホバー待ちにせず常時再生するため、透過度を落として文字の可読性を保つ。
   本文・見出しは z-index を上げて映像より前面に固定する。 */
.item-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .22;
  z-index: 0;
  pointer-events: none;
}
.rank-item > *:not(.item-bg-video),
.recent-card > *:not(.item-bg-video) {
  position: relative;
  z-index: 2;
}

/* 動きを減らす設定では映像を出さない。代わりに置く止め絵（.item-bg-still）は残す */
@media (prefers-reduced-motion: reduce) {
  video.item-bg-video { display: none; }
}


/* ---- 審査・サイト情報ページ ---- */
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 10px 0 0;
}
.site-footer-links a {
  color: var(--brand1);
  text-underline-offset: 3px;
}
.legal-page {
  max-width: 820px;
  padding-top: 28px;
  padding-bottom: 48px;
}
.legal-card {
  padding: clamp(20px, 4vw, 38px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.legal-card h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.25;
}
.legal-card h2 {
  margin: 30px 0 10px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.4;
}
.legal-card p,
.legal-card li {
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.85;
}
.legal-card ul {
  padding-left: 1.4em;
}
.legal-kicker {
  margin: 0 0 8px;
  color: var(--brand1);
  font-size: 11px !important;
  font-weight: 900;
  letter-spacing: .12em;
}
.legal-meta {
  margin: 0 0 18px;
  color: var(--text-sub);
  font-size: 12px !important;
}
.legal-note {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.legal-card a {
  color: var(--brand1);
  text-underline-offset: 3px;
}


/* Reading pages: constrain figures and allow tables/code to scroll within the card. */
.blog-post { overflow-wrap: anywhere; }
.blog-post figure { margin: 24px 0; }
.blog-post img { display: block; max-width: 100%; height: auto; margin: auto; border-radius: var(--radius-pill); }
.blog-post .diagram { overflow-x: auto; background: #fff; border-radius: var(--radius-pill); padding: 8px; }
.blog-post .diagram img { min-width: 520px; }
.blog-post figcaption { margin-top: 8px; color: var(--text-sub); font-size: 13px; line-height: 1.7; }
.blog-post pre, .table-scroll { max-width: 100%; overflow-x: auto; }
.blog-post pre { padding: 16px; background: var(--bg); border-radius: var(--radius-pill); white-space: pre; }
.blog-post table { border-collapse: collapse; width: 100%; font-size: 14px; }
.blog-post th, .blog-post td { padding: 10px; border: 1px solid var(--line); text-align: left; min-width: 80px; }
.blog-post a, .site-footer a { text-underline-offset: 3px; }
.content-play { display: inline-block; padding: 12px 18px; border: 1px solid var(--brand1); border-radius: var(--radius-pill); }
.blog-list, .guide-list, .static-list { display: grid; gap: 14px; padding: 0; list-style: none; }
.blog-list li, .guide-list li, .static-list li { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.blog-list a, .guide-list a, .static-list a { display: block; }
.blog-list span, .blog-list small, .static-list span, .static-list small { display: block; margin-top: 8px; color: var(--text-sub); line-height: 1.7; }
.guide-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
/* トップの読みもの：既定は閉じた小さな帯。開くと題名と日付だけの一覧 */
.blog-fold { border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); }
.blog-fold > summary { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; min-height: 44px; box-sizing: border-box; }
.blog-fold > summary::-webkit-details-marker { display: none; }
.blog-fold > summary::after { content: "＋"; margin-left: auto; color: var(--text-sub); font-size: 13px; }
.blog-fold[open] > summary::after { content: "－"; }
.blog-fold > summary .section-kicker { margin: 0; }
.blog-fold-title { font-size: 14px; font-weight: 700; }
.blog-fold-count { color: var(--text-sub); font-size: 12px; }
.blog-fold-lead { margin: 0 14px 10px; color: var(--text-sub); font-size: 12px; line-height: 1.7; }
.blog-list.is-compact { gap: 0; margin: 0; border-top: 1px solid var(--line); }
.blog-list.is-compact li { padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.blog-list.is-compact li:last-child { border-bottom: 0; }
.blog-list.is-compact a { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.6; }
.blog-list.is-compact strong { flex: 1; font-weight: 600; }
.blog-list.is-compact small { flex: none; margin: 0; font-size: 11px; }
.blog-ad { margin: 40px 0; }

html.reading-page, html.reading-page body { touch-action: auto; }

/* ---- PC 専用作品の印（ADR-0004）----
   一覧カードでは難易度の印（左下）の右隣、ほかでは文中に小さく置く */
.card .thumb .badge.pc-only {
  position: absolute; right: 10px; bottom: 10px; top: auto; left: auto;
  z-index: 2;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1;
  color: #e8f0ff; background: rgba(36, 72, 140, .9);
  border: 1px solid rgba(160, 196, 255, .45);
}
.pc-only-chip {
  display: inline-block;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1.4;
  color: #e8f0ff; background: rgba(36, 72, 140, .9);
  border: 1px solid rgba(160, 196, 255, .45);
  vertical-align: middle;
}
.rank-one-copy > .pc-only-chip { margin-bottom: 6px; }
