* { box-sizing: border-box; }
:root {
  --brand-gradient: linear-gradient(#E33A73, #E33A73);
}
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #262626;
  background: #fdfdfd;
}
/* 韓国語ページは韓国語のフォントを先に。日本語フォントでハングルを出すと
   環境によって豆腐や混植になる（Yu Gothic はハングルを持たない） */
html[lang="ko"] body { font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
/* sticky footer（twidougaのmin-h-screen flex flex-colパターンを踏襲） */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ヘッダー（twidouga構成を踏襲） ────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-gradient);
}
.header-row {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  position: relative;
}
.header-row--pc { display: none; }
.site-logo {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
  /* サイト名はラテン文字なので、言語に関係なく同じフォントで出す。
     html[lang=ko] の body に韓国語フォント(Malgun Gothic)を当てた結果、ロゴだけ
     字面と縦位置が日本語ページとずれた（2026-10-09に指摘）。body の既定と同じ並びを明示する。 */
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  /* 縦位置はflexの中央揃えだけで決める。以前は top:-2px で場当たり的にずらしていた。
     ここを flex にするのは、中のリンクが inline-flex のままだと
     **インライン要素としてベースライン揃えになる**ため。
     アイコン(26px)と文字(24px)で高さが違うと、ベースラインの計算結果が
     行ボックスの中央と一致せず、中央に揃えたつもりでもずれる。
     flexコンテナの子にしてしまえばベースラインの計算自体が入らない。 */
  display: flex;
  align-items: center;
  line-height: 1;
}
/* スマホは中央寄せ。**text-align では効かない**（flexの子はテキストではないため）ので
   justify-content で寄せる。 */
.header-row--mobile .site-logo { flex: 1; justify-content: center; }
.site-logo a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; line-height: 1; }
.header-spacer { width: 32px; }

.hamburger {
  width: 32px;
  height: 28px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: transform 0.2s, opacity 0.2s;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.3);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav-link {
  display: block;
  padding: 12px 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.mobile-nav-link.is-active {
  background-color: #BF2A5E;
  color: #fff;
  font-weight: 700;
}

.pc-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
}
.pc-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-left: 1px dotted rgba(255,255,255,0.6);
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}
.pc-nav a:hover { text-decoration: underline; }
/* 言語の切り替え（日本語⇔한국어）。twidouga の tdgRenderLangSwitcher と同じ形:
   ヘッダー直下の右端にプルダウン、見出しと並ぶよう負のマージンで下に食い込ませる。
   position:relative + z-index は、食い込ませた分だけ後続の見出しに重なって
   クリックを奪われるのを防ぐ（twidouga が 2026-08-06 に踏んだ）。 */
.lang-select-wrap { display: flex; justify-content: flex-end; padding: 6px 12px 0 0; margin-bottom: -34px; position: relative; z-index: 20; }
.lang-select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #E33A73; color: #BF2A5E;
  font-weight: 700; font-size: 13px; background: #fff; cursor: pointer; font-family: inherit;
}
.pc-nav a.is-active {
  background-color: #fff;
  color: #E33A73;
  font-weight: 900;
  height: 36px;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  border-radius: 8px 8px 0 0;
  border-left: none;
  text-decoration: none;
}

/* PC用ヘッダーへ切り替える幅。ナビは中央に絶対配置なので、ロゴと重ならない幅が要る。
   2026-10-29 に「X動画ランキング」を足して日本語で約860pxまで重なるようになったため 640→900 */
@media (min-width: 900px) {
  .header-row--mobile { display: none; }
  .header-row--pc { display: flex; justify-content: space-between; }
  .mobile-nav { display: none !important; }
}

/* ── フッター（twidouga構成を踏襲） ────────────────────── */
.site-footer {
  text-align: center;
  color: #fff;
  font-size: 12px;
  padding: 14px 0;
  background: var(--brand-gradient);
}

/* ── SNSシェアカード（twidougaのinclude/share.phpを踏襲） ── */
.share-bar {
  position: sticky;
  top: 36px;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-top: 8px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ── メインコンテンツ（twidougaのmax-w-screen-xl mx-auto px-3 py-6を踏襲） ── */
main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 12px;
  box-sizing: border-box;
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  scroll-margin-top: 60px;
}
.add-form input[type="text"] {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid #dbdbdb;
  border-radius: 8px;
  font-size: 14px;
}
.add-form button {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--brand-gradient);
}
.error-box {
  background: #fdeceb;
  border: 1px solid #e0245e;
  color: #c0122f;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ── グリッド（twidougaのMasonryグリッドと同じ構成） ───── */
#grid-wrap { text-align: center; max-width: 924px; margin: 0 auto; }
.page-heading {
  text-align: center;
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: #262626;
}
/* ここに .rank-badge の絶対配置版があったが削除した。
   instaCardHtml() に順位を渡す呼び出し元が1つも無く使い手がいないのに、
   position:absolute だけが下の .rank-badge（ランキングページ用）へ残り、
   「第N位」がサムネ左上へ重なって元投稿ボタンと被っていた。
   下の規則は position を上書きしていないので、ここを消すのが正しい直し方。
   グリッドカードに順位を出したくなったら .grid-item .rank-badge と
   スコープを付けて書き足すこと。 */
  z-index: 2;
}
/* ── ランキング（twidougaのranking_t1.php構成を踏襲） ───── */
#rank-wrap { max-width: 844px; margin: 0 auto; padding: 0 12px; }
.rank-tabs { display: flex; justify-content: center; gap: 8px; margin: 0 auto 8px; max-width: 360px; }
.rank-tabs + .rank-tabs { margin-bottom: 20px; }
.rank-tab-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 999px;
  border: 2px solid #833AB4;
  background: #fff;
  color: #833AB4;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.rank-tab-btn[data-active="true"] { background: #833AB4; color: #fff; }
#rank-grid {
  display: grid;
  /* **幅を固定にしない。** 640〜843px（タブレットや横向き）では2列化が
     効かないので、260px固定だと画面からはみ出す。上限260pxの可変トラックに
     して狭いときだけ縮ませる（twidouga の .rank-grid と同じ）。 */
  grid-template-columns: repeat(3, minmax(0, 260px));
  justify-content: center;
  gap: 36px 20px;
}
.rank-item { position: relative; }
/* ランキングの途中に挟む広告。グリッドの横一列を全部使って中央に置く */
.rank-ad-row { grid-column: 1 / -1; display: flex; justify-content: center; }
.rank-ad-row .ad-box { margin: 0; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 18px;
  margin-bottom: 8px;
  font-size: 15px;
}
.rank-card { position: relative; }
.rank-card .thumb-wrap {
  /* 260x462 はちょうど 9:16。列幅に追従させてもPCの見た目は変わらない */
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-card .thumb-wrap img.thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.rank-source-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #BF2A5E;
  font-weight: 600;
  /* 保存0件のときは中身が空になる。min-heightが無いと、そのカードだけ
     高さが縮んでランキングの行がガタつく */
  min-height: 20px;
}
@media (max-width: 639px) {
  /* **スマホは2列。** twidouga が 2026-09-11 に1列から変更したのに合わせた。
     カード幅は画面に追従させ、縦横比は1列のときと同じ 9:16 のまま。
     1画面に2〜4件見えるようになる。 */
  #rank-grid { grid-template-columns: repeat(2, 1fr); justify-items: stretch; gap: 18px 10px; }
  .rank-card .thumb-wrap { width: 100%; height: auto; aspect-ratio: 9 / 16; }
  .rank-badge { padding: 3px 12px; font-size: 13px; margin-bottom: 6px; }
  .rank-meta  { font-size: 12px; min-height: 18px; }
  /* カードが半分の幅になるので、上に載るボタン類も一段小さくしないと
     サムネを覆ってしまう。twidouga には無い要素なのでこちらで決める */
  .rank-source-btn { width: 26px; height: 26px; top: 6px; left: 6px; }
  .rank-source-btn svg { width: 14px; height: 14px; }
  .rank-card .media-type-badge { font-size: 14px; top: 6px; right: 6px; padding: 5px 9px; }
  .rank-card .media-type-badge.is-video,
  .rank-card .media-type-badge.is-photo { padding: 5px 6px; }
  .rank-card .media-type-badge svg { width: 16px; height: 16px; }
}

.loading-spinner {
  text-align: center;
  padding: 24px 0;
  color: #999;
  font-size: 13px;
}
.loading-spinner.hidden { display: none; }

/* ── 広告枠 ────────────────────────────────────────────
   **中身と区別が付くようにラベルを付ける。**
   waqool のタグは 300x250 の iframe で、幅も高さも属性で固定されている。
   こちらで大きさを触らない（レイアウトが崩れるより、はみ出す方がまだ直しやすい）。 */
.ad-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px auto;
  width: 300px;
  max-width: 100%;
}
.ad-label {
  font-size: 10px;
  color: #b0b0b0;
  letter-spacing: 2px;
  margin-bottom: 3px;
  align-self: flex-start;
}
.ad-box iframe { display: block; border: 0; }

/* 取得できた後に出す保存手順。**目立たせる。**
   ここを見落とすと「保存したのに端末に無い」で終わる。 */
.save-howto {
  max-width: 420px;
  margin: 12px auto 0;
  padding: 10px 12px;
  background: #FDF2F8;
  border: 1px solid #F9A8D4;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: #8F1741;
  text-align: left;
}
.save-howto strong { color: #c1123f; }

/* リアルタイムのグリッド内に置く広告カード。
   Masonry の columnWidth=180 / gutter=6 なので、列2つぶん = 366px に合わせる。
   中の iframe は 300x250 固定なので中央に寄せる。 */
/* **.grid-item.grid-item--ad と2つ重ねて書く。** 単独の .grid-item--ad だと、
   下にある .grid-item { width: 180px } と詳細度が同じで後勝ちされ、広告枠が1列幅になる。
   Masonry も1列ぶんとして置くので、300px の広告が隣のカードに重なった（2026-10-20、
   waqool を初めて実際に配信した日に発覚。それまで止めていたので表に出なかった）。 */
.grid-item.grid-item--ad { width: 366px; }
.grid-item--ad .ad-box { margin: 0 auto; }
/* スマホ（2列）も上の 366px のまま。2列ぶんの幅で、中の 300px の広告は margin:auto で中央に来る
   （以前は 300px にしていて、2列の左に寄っていた。2026-10-22 iPhone Safari で指摘）。
   **max-width: 100% を付けない。** Masonry は最初の配置の時、カードを絶対配置にしてから測るので、
   その瞬間は親(#video-grid)の幅がほぼ0になっている。% 指定だとそれを基準に縮み、
   1列ぶんと判定されて隣の列に重なった（2026-10-22。最初の2枠だけ。追加読み込み分は親の幅が決まった後なので無事だった）。 */
@media (max-width: 389px) {
  /* 画面が狭くて1列しか入らない時（375px の iPhone など。列は 180px）。
     枠は列と同じ幅にする。.ad-box は max-width:100% で 180px に縮み、中の 300px の iframe は
     align-items:center で左右へ均等にはみ出す＝列の中央に来る。横に並ぶカードが無いので重ならない。 */
  .grid-item.grid-item--ad { width: 180px; }
}

/* リアルタイムの「もっと読み込む」。自動読み込みの上限に達した時だけ出る
   （上限の理由は realtime.php のJSコメント参照）。
   **.hidden は既存の .loading-spinner.hidden と同じ書き方に揃える。**
   hidden 属性ではなくクラスで開閉しているので、[hidden] との詳細度の
   食い違い（通報ダイアログで踏んだやつ）は起きない。 */
.load-more-wrap { text-align: center; margin: 24px 0 8px; }
.load-more-wrap.hidden { display: none; }
.load-more-btn {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 40px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.load-more-btn:hover { opacity: 0.88; }
#video-grid { display: inline-block; opacity: 0; transition: opacity 0.6s; }
.grid-item {
  width: 180px;
  position: relative;
  margin-bottom: 6px;
  display: inline-block;
  vertical-align: top;
  margin-right: 6px;
}
.grid-item img.thumb {
  width: 180px;
  height: auto;
  border-radius: 10px;
  display: block;
  background: #f4f4f4;
}
/* 無限スクロールで追加した直後のカード。
   Masonryは管理下の要素をposition:absoluteで配置するが、DOMに入れた直後はまだ
   配置前なので素の位置(左上・全幅)に一瞬現れ、その後あるべき場所へ飛ぶ。
   これが「次のページが組み込まれていく」動きとして見えていたので、
   配置が終わるまで隠しておき、終わってからふわっと出す。 */
.grid-item.is-appending { visibility: hidden; opacity: 0; }
.grid-item.is-appended  { opacity: 1; transition: opacity 0.35s ease; }
.grid-item .source-icon-btn {
  /* 2026-10-09: 左下 → 左上。左下には通報ボタンも置いていて重なり、
     後から描かれる通報が上に乗って「元投稿へ飛ぶボタンが無い」状態だった。
     通報は右下の「⋯」メニューに移した。 */
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ── メディア種別の表示（リアルタイム/ランキング共通） ─────────────
   文字のバッジ(VIDEO/PHOTO)は10pxで一目では読めなかったため、アイコン表示にした。
   3種類とも右上に揃え、サイトの3色で色分けしている。
     動画     … ピンク #E33A73 ＋ 再生アイコン
     複数枚   … 灰     #475569 ＋ 重なった四角アイコン＋枚数
     単一画像 … 紫     #833AB4 ＋ 写真アイコン
   1枚のカードに出す種別表示は1つだけ。
   位置を左上にしないのは、ランキングの元投稿ボタン(.rank-source-btn)が左上にあり
   重なってしまうため。
   ※色分けをやめて元の半透明黒に戻す場合は、下のis-video/is-carousel/is-photoの
     背景色を rgba(0,0,0,0.68) に揃えるだけでよい。 */
.media-type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* 明るいサムネイルでも輪郭が出るように影と薄い白枠を付ける */
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  border: 1.5px solid rgba(255,255,255,0.55);
  box-sizing: border-box;
  pointer-events: none;   /* 下のリンクをクリックできるようにする */
  z-index: 2;
}
.media-type-badge.is-video    { background: rgba(227,58,115,0.94); }  /* #E33A73 */
.media-type-badge.is-carousel { background: rgba(71, 85,105,0.94); }  /* #475569 */
.media-type-badge.is-photo    { background: rgba(131,58,180,0.96); }  /* #833AB4 */
/* 数字が付かないバッジは丸く見えるよう左右の余白を詰める */
.media-type-badge.is-video,
.media-type-badge.is-photo { padding: 6px 7px; }

/* ランキングはサムネが大きいので一段大きくする */
.rank-card .media-type-badge { font-size: 18px; top: 9px; right: 9px; padding: 8px 13px; }
.rank-card .media-type-badge.is-video,
.rank-card .media-type-badge.is-photo { padding: 8px 9px; }
.rank-card .media-type-badge svg { width: 22px; height: 22px; }

.empty {
  text-align: center;
  color: #8e8e8e;
  padding: 60px 0;
}

/* ── 規約・ポリシー系ページ（twidougaのpolicy-wrapを踏襲、配色はinstatest側に合わせる） ── */
.policy-wrap {
  max-width: 760px; margin: 0 auto; background: #fff; border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 4px 16px rgba(227,58,115,0.1);
  line-height: 1.8; color: #333;
}
.policy-wrap h2 { text-align: center; color: #262626; font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.policy-wrap h3 { color: #E33A73; font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
.policy-wrap p, .policy-wrap li { font-size: 14.5px; }
.policy-wrap ul { padding-left: 1.4em; margin: 8px 0; }
.policy-wrap .updated { text-align: center; color: #888; font-size: 12.5px; margin-bottom: 24px; }
.policy-wrap a { color: #E33A73; text-decoration: underline; }

/* お問い合わせフォーム */
.contact-form { margin-top: 20px; }
.contact-form label { display: block; font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid #999; border-radius: 8px; font-size: 15px; font-family: inherit;
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form button {
  margin-top: 20px; width: 100%; height: 46px; border: none; border-radius: 8px;
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; background: var(--brand-gradient);
}
.contact-note { font-size: 12.5px; color: #888; margin-top: 10px; }
.form-error {
  background: #fdeceb; border: 1px solid #e0245e; color: #c0122f;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px;
}
.form-done {
  background: #eafaf1; border: 1px solid #2ecc71; color: #1e8449;
  border-radius: 8px; padding: 14px; font-size: 14.5px;
}
/* ボット対策のハニーポット。人間には見えない位置に置き、埋まっていたら送信を破棄する */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── フッターのリンク ───────────────────────────────── */
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 0; margin-bottom: 6px; }
/* フッター下段のサイト名。リンク列との間隔をここで持つ（.site-footerのpaddingとは別） */
.footer-note { opacity: 0.85; letter-spacing: 0.5px; }
.footer-disclaimer { margin: 10px auto 0; max-width: 560px; font-size: 11px; line-height: 1.6; opacity: 0.8; }
.footer-links a {
  color: #fff; text-decoration: none; font-size: 12px; padding: 0 10px;
  border-left: 1px dotted rgba(255,255,255,0.6);
}
.footer-links a:first-child { border-left: none; }
.footer-links a:hover { text-decoration: underline; }

/* ── 抽出結果1件分の表示（getinsta.php単発結果・carousel.phpのSplideスライド共通） ── */
.splide__slide { text-align: center; }
.insta-thumb-bar, .insta-thumb-img { width: 300px; }
@media (min-width: 640px) {
  .insta-thumb-bar, .insta-thumb-img { width: 420px; }
}
.insta-thumb-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 auto 6px; }
.insta-pill-btn {
  height: 32px; padding: 0 10px; border-radius: 16px; background: var(--brand-gradient); display: inline-flex;
  align-items: center; gap: 5px; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.insta-thumb-img { border-radius: 15px; display: block; margin: 0 auto; }
.insta-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.insta-carousel-badge {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ── ページ上部の説明文 ─────────────────────────────────
   meta description と同じ文章を画面にも出す。meta だけだと利用者には見えず、
   ページが何なのかを伝える文章がグリッドの上に一切無い状態になる。 */
.page-lead {
  max-width: 640px; margin: 0 auto 18px; padding: 0 14px;
  font-size: 13px; line-height: 1.8; color: #666; text-align: center;
}

/* 期間タブをページ下部に再掲したときの余白。上部のタブと間隔が違うだけ */
.rank-tabs--bottom { margin-top: 28px; }

/* ── ページ下部の説明文（includes/page_copy.php が出力する） ──────
   一覧やランキングは中身が画像とリンクばかりで本文が無い。
   検索エンジンから見て「このページが何なのか」を判断する材料になる。 */
.page-copy {
  max-width: 760px; margin: 36px auto 8px; padding: 24px 16px 8px;
  border-top: 1px solid #eee;
  color: #333; font-size: 14px; line-height: 1.9; text-align: left;
}
.page-copy h2 {
  margin: 0 0 14px; padding-bottom: 8px;
  font-size: 17px; font-weight: 800; color: #262626;
  border-bottom: 2px solid #E33A73;
}
.page-copy h3 {
  margin: 20px 0 6px;
  font-size: 15px; font-weight: 700; color: #BF2A5E;
}
.page-copy p { margin: 0; }
.page-copy-links { margin-top: 8px !important; font-size: 13px; }
.page-copy-links a { color: #E33A73; font-weight: 700; text-decoration: none; }
.page-copy-links a:hover { text-decoration: underline; }
.page-copy-sep { margin: 0 8px; color: #ccc; }

/* ランキングの見出し。アイコンはSVG、文字はHTML（期間で変わるため） */
.rank-title { text-align: center; margin: 0 0 16px; }
.rank-title a {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.rank-title span { color: #262626; font-weight: 800; font-size: 22px; }

/* ── 解説ページ（howto.php） ─────────────────────────────
   一覧やランキングと違い中身が入れ替わらないページなので、読み物として組む */
.guide-wrap {
  max-width: 820px; margin: 0 auto; background: #fff; border-radius: 16px;
  padding: 32px 26px; box-shadow: 0 4px 16px rgba(227,58,115,0.10);
  line-height: 1.85; color: #333; text-align: left;
}
.guide-wrap h1 {
  text-align: center; color: #262626; font-size: 26px; font-weight: 800; margin: 0 0 6px;
}
.guide-lead { text-align: center; color: #666; font-size: 14px; margin: 0 0 26px; }
.guide-wrap h2 {
  color: #BF2A5E; font-size: 20px; font-weight: 800; margin: 34px 0 12px;
  padding-left: 10px; border-left: 5px solid #E33A73;
}
.guide-wrap h3 { color: #BF2A5E; font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.guide-wrap p, .guide-wrap li, .guide-wrap dd { font-size: 14.5px; }
.guide-wrap ol { padding-left: 1.5em; margin: 10px 0; }
.guide-wrap ol li { margin-bottom: 8px; }
.guide-wrap a { color: #E33A73; text-decoration: underline; }
.guide-cta {
  display: block; text-align: center; background: var(--brand-gradient, #E33A73);
  color: #fff !important; font-weight: 800; text-decoration: none !important;
  padding: 14px; border-radius: 999px; margin: 18px auto; max-width: 360px;
}
.guide-faq dt { font-weight: 700; color: #262626; margin-top: 16px; }
.guide-faq dd { margin: 4px 0 0; }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.guide-links a {
  flex: 1 1 180px; text-align: center; background: #FDF2F8; border: 1px solid #FBCFE8;
  border-radius: 10px; padding: 12px; text-decoration: none !important;
  color: #BF2A5E !important; font-weight: 700;
}
.guide-close { margin-top: 24px; }
@media (max-width: 600px) {
  .guide-wrap { padding: 22px 16px; border-radius: 12px; }
  .guide-wrap h1 { font-size: 21px; }
  .guide-wrap h2 { font-size: 17px; }
}

/* ── 通報 ───────────────────────────────────────────── */
/* カードの隅に置く小さなボタン。目立ちすぎると誤爆が増え、
   小さすぎると見つけられないので、サムネに重ねて薄く出す */
.report-btn {
  position: absolute; left: 6px; bottom: 6px;
  width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,0.45); color: #fff;
  opacity: 0.55; transition: opacity 0.15s, background 0.15s;
}
.report-btn:hover, .report-btn:focus-visible { opacity: 1; background: rgba(211,51,51,0.85); }
.grid-item, .rank-card { position: relative; }

/* 保存結果・カルーセルの下に置く行 */
.report-inline {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  margin: 10px 0 0; font-size: 12px; color: #8e8e8e;
}
.report-inline .report-btn { position: static; opacity: 0.8; }

/* ── タイル右下の「⋯」メニュー（twidouga の thumb-menu に合わせた） ──
   **メニューの開閉は hidden 属性。** .tile-menu に display を書くと [hidden] を
   打ち消す（通報ダイアログで踏んだ型）ので、[hidden] 側を明示して必ず勝たせる。 */
.tile-menu-wrap { position: absolute; right: 4px; bottom: 4px; z-index: 3; }
.tile-menu-btn {
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,0.55); display: inline-flex; align-items: center; justify-content: center;
}
.tile-menu-btn:hover, .tile-menu-btn[aria-expanded="true"] { background: rgba(0,0,0,0.8); }
.tile-menu {
  position: absolute; right: 0; bottom: 34px; min-width: 128px;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.tile-menu[hidden] { display: none; }
.tile-menu-item {
  display: block; width: 100%; padding: 10px 14px; text-align: left; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: #262626; text-decoration: none;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.tile-menu-item + .tile-menu-item { border-top: 1px solid #eee; }
.tile-menu-item:hover { background: #f5f5f5; }
/* メニュー内の通報は .report-btn の absolute 配置を使わない（ダイアログの配線だけ借りる） */
.tile-menu .report-btn { position: static; width: 100%; height: auto; border-radius: 0; opacity: 1; color: #c1123f; }
.tile-menu .report-btn:hover { background: #fdecea; }
/* ランキングはサムネが大きいのでボタンも一段大きく */
.rank-card .tile-menu-wrap { right: 9px; bottom: 9px; }
.rank-card .tile-menu-btn { width: 32px; height: 32px; }
.rank-card .tile-menu { bottom: 38px; }

/* ダイアログ */
/* **hidden 属性より先に display を決めない。**
   ブラウザ標準の [hidden]{display:none} は属性セレクタで詳細度(0,1,0)。
   .report-modal もクラスで(0,1,0)と同じ強さなので、後から読まれるこのファイルが勝つ。
   その結果 hidden が付いていても display:flex のままになり、
   **ページを開いた瞬間から通報ダイアログが出っぱなしになっていた**（本番で発生）。
   JS側は modal.hidden で開閉しているので、閉じているつもりで閉じていなかった。
   下の [hidden] 付きルールで明示的に打ち消す。 */
.report-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); padding: 16px;
}
.report-modal[hidden] { display: none; }
.report-box {
  background: #fff; border-radius: 14px; padding: 22px 20px;
  width: 100%; max-width: 420px; text-align: left;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.report-box h2 { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: #262626; }
.report-lead { margin: 0 0 14px; font-size: 13px; color: #666; line-height: 1.7; }
.report-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.report-reason {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; color: #333; padding: 8px 10px;
  border: 1px solid #eee; border-radius: 8px;
}
.report-reason:hover { border-color: #E33A73; background: #FDF2F8; }
#report-note {
  width: 100%; box-sizing: border-box; font-size: 13px; padding: 8px;
  border: 1px solid #ddd; border-radius: 8px; resize: vertical; font-family: inherit;
}
.report-msg { margin: 10px 0 0; font-size: 13px; font-weight: 700; }
.report-msg.is-ok    { color: #2a7; }
.report-msg.is-error { color: #d33; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.report-cancel, .report-send {
  border: none; border-radius: 999px; padding: 10px 20px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.report-cancel { background: #f0f0f0; color: #555; }
.report-send   { background: var(--brand-gradient, #E33A73); color: #fff; }
.report-send:disabled { opacity: 0.6; cursor: default; }

/* Turnstile のウィジェット。**入力欄とボタンの行の外に、中央寄せで置く。**
   行の中に入れると入力欄とボタンの間に割り込む（twidouga も行の外に置いている）。
   未設定の時は中身が空になるので、その時に余白だけ残らないよう :empty で潰す。 */
/* 「リアルタイム・ランキングに載せない」。入力行のすぐ下、URL取得ボタンの真下に右寄せ */
.save-unlisted { display: flex; flex-direction: column; align-items: flex-end; margin-top: 8px; gap: 2px; }
.save-unlisted label { font-size: 13px; color: #444; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.save-unlisted input { width: 16px; height: 16px; accent-color: #E33A73; cursor: pointer; }
.save-unlisted-note { font-size: 11px; color: #999; }
.save-unlisted-done { font-size: 12px; color: #8e8e8e; margin-top: 4px; }
.save-turnstile { display: flex; justify-content: center; margin-top: 16px; }
.save-turnstile:empty { display: none; margin-top: 0; }
/* 問い合わせフォームも同じ扱い */
.contact-turnstile { display: flex; justify-content: center; margin: 4px 0; }
.contact-turnstile:empty { display: none; margin: 0; }
