/* リール：縦に1本ずつ。ダーク基調のサイトに合わせる（色は子テーマの --mf-* があれば使う） */
.mfgc-reel { max-width: 600px; margin: 0 auto; }
.mfgc-reel__note { font-size: .85em; opacity: .8; margin: 0 0 12px; }

.mfgc-reel__feed {
	height: 80vh;
	height: 80svh;
	overflow-y: auto;
	scroll-snap-type: y proximity;
	overscroll-behavior: contain;
	border-radius: 12px;
	outline-offset: 2px;
}

.mfgc-reel__item {
	scroll-snap-align: start;
	min-height: 80vh;
	min-height: 80svh;
	box-sizing: border-box;
	padding: 12px 8px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.mfgc-reel__head,
.mfgc-reel__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mfgc-reel__name { font-weight: 700; font-size: 1.05em; }
.mfgc-reel__count { font-size: .8em; opacity: .7; white-space: nowrap; }
.mfgc-reel__foot { font-size: .9em; }

.mfgc-reel__embed {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-height: 320px;
}
.mfgc-reel__embed .twitter-tweet,
.mfgc-reel__embed .twitter-tweet-rendered { margin: 0 auto !important; max-width: 100%; }
.mfgc-reel__fallback { align-self: center; opacity: .85; }

.mfgc-reel__nav { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.mfgc-reel__btn {
	padding: 8px 20px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .25);
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.mfgc-reel__btn:hover { border-color: #ff4d8d; }

@media (prefers-reduced-motion: reduce) {
	.mfgc-reel__feed { scroll-behavior: auto; }
}

/* 作品記事のページに埋め込むXの投稿 */
.mfgc-x-embed { margin: 16px 0; display: flex; flex-direction: column; align-items: center; }
.mfgc-x-embed .twitter-tweet { margin: 0 auto !important; }
.mfgc-x-embed__note { font-size: .8em; opacity: .7; margin: 6px 0 0; text-align: center; }

/* リールの見出し：作品名とクリエイター名 */
.mfgc-reel__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mfgc-reel__creator { font-size: .85em; opacity: .8; }

/* 埋め込みが出ないとき（センシティブ判定など）でもXで見られるボタン */
.mfgc-x-embed__open { margin: 10px 0 0; text-align: center; }
.mfgc-x-embed__btn,
.mfgc-reel__fallback {
	display: inline-block;
	padding: 10px 24px;
	border-radius: 999px;
	background: linear-gradient(90deg, #ff4d8d, #a855f7);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none;
}
.mfgc-reel__fallback { margin-top: 24px; }

/* 動画ファイルのプレーヤー */
.mfgc-video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 12px; object-fit: contain; }
.mfgc-x-embed--video { width: 100%; }
.mfgc-reel__embed .mfgc-video { max-height: 100%; }

/* bunny.net のプレーヤー */
.mfgc-bunny { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.mfgc-bunny__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mfgc-reel__embed .mfgc-bunny { max-height: 100%; }

/* 0.57.0：作品のアフィリエイトURLへのボタン（動画のすぐ下） */
.mfgc-reel__cta { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.mfgc-reel__cta a {
	flex: 1;
	max-width: 420px;
	display: block;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--mf-accent, #ff4d8d);
	color: #fff;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}
.mfgc-reel__cta a:hover { opacity: .9; color: #fff; }
.mfgc-reel__cta .mfgc-pr-label { margin-right: 0; }

/* 0.59.0：動画の下は「作品名 → クリエイター名 → タグ → MyFansボタン」だけにする */
.mfgc-reel__embed { position: relative; }
.mfgc-reel__embed > .mfgc-reel__count {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: .75em;
	opacity: 1;
	pointer-events: none;
}
.mfgc-reel__info { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.mfgc-reel__info .mfgc-reel__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	font-weight: 700;
	font-size: 1em;
	line-height: 1.45;
	color: inherit;
	text-decoration: none;
	word-break: break-all;
}
.mfgc-reel__info .mfgc-reel__name:hover { text-decoration: underline; }
.mfgc-reel__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.mfgc-reel__meta .mfgc-reel__creator {
	font-size: .9em;
	opacity: .85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}
.mfgc-reel__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mfgc-reel__tags li { margin: 0; padding: 0; list-style: none; }
.mfgc-reel__tags a {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .25);
	font-size: .8em;
	line-height: 1.5;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}
.mfgc-reel__tags a:hover { border-color: var(--mf-accent, #ff4d8d); }
.mfgc-reel__info .mfgc-reel__cta { margin-top: 4px; }
/* プロフィールへのリンク：作品のアフィリエイトURLがないクリエイターだけ。目立たせない */
.mfgc-reel__profile { margin: 0; text-align: center; font-size: .8em; opacity: .7; }
.mfgc-reel__profile a { color: inherit; }

/* 0.59.0：動画は、下の情報（作品名〜ボタン）が同じ画面に入る高さまで。縦長の bunny.net は幅を絞って比率を保つ */
.mfgc-reel__embed { align-items: center; min-height: 200px; }
.mfgc-reel__embed .mfgc-video { max-height: calc(80vh - 240px); max-height: calc(80svh - 240px); }
.mfgc-reel__embed .mfgc-bunny[style*="--mfgc-ratio"] {
	max-width: min(100%, 560px, calc((80vh - 240px) / var(--mfgc-ratio))) !important;
	max-width: min(100%, 560px, calc((80svh - 240px) / var(--mfgc-ratio))) !important;
}

/* 0.65.0：上の帯と右側のボタンは、スマホの全画面表示のときだけ出す */
.mfgc-reel__top,
.mfgc-reel__actions { display: none; }

/* 0.65.0：スマホ（600px以下）は全画面のリール（インスタのリール風）。
   画面いっぱいの黒地に1本ずつ、上下にスワイプで切り替え。下の情報（作品名・クリエイター・MyFansボタン）は動画の下、右側に縦のボタン。
   画面下にメニュー（子テーマのタブ）があるときは、--mfgc-reel-bottom にその高さを入れて、その上までにする */
@media (max-width: 600px) {
	body.mfgc-reel-page { overflow: hidden; }
	.mfgc-reel {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: var(--mfgc-reel-bottom, 0px);
		z-index: 9970;
		display: flex;
		flex-direction: column;
		max-width: none;
		margin: 0;
		background: #000;
		color: #fff;
	}
	.mfgc-reel__note,
	.mfgc-reel__nav,
	.mfgc-reel__embed > .mfgc-reel__count,
	.mfgc-reel__meta .mfgc-fav { display: none; }
	.mfgc-reel__top {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		z-index: 5;
		display: flex;
		align-items: center;
		gap: 8px;
		padding: calc(6px + env(safe-area-inset-top)) 12px 18px 4px;
		background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
		pointer-events: none;
	}
	.mfgc-reel__top > * { pointer-events: auto; }
	.mfgc-reel__back {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: none;
		color: #fff;
		cursor: pointer;
	}
	.mfgc-reel__heading {
		flex: 1;
		min-width: 0;
		overflow: hidden;
		font-weight: 700;
		font-size: 16px;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.mfgc-reel__pos { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
	.mfgc-reel__feed {
		flex: 1;
		height: auto;
		min-height: 0;
		border-radius: 0;
		scroll-snap-type: y mandatory;
	}
	.mfgc-reel__item {
		position: relative;
		height: 100%;
		min-height: 0;
		padding: 0;
		gap: 0;
		border: 0;
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}
	.mfgc-reel__embed {
		flex: 1;
		min-height: 0;
		align-items: center;
		background: #000;
		container-type: size;
	}
	.mfgc-reel__embed .mfgc-video {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
		object-fit: contain;
	}
	.mfgc-reel__embed .mfgc-bunny {
		max-width: 100% !important;
		max-height: 100%;
		border-radius: 0;
	}
	.mfgc-reel__embed .mfgc-bunny[style*="--mfgc-ratio"] {
		max-width: min(100cqw, 100cqh / var(--mfgc-ratio)) !important;
	}
	.mfgc-reel__actions {
		position: absolute;
		right: 6px;
		bottom: 64px;
		z-index: 3;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 14px;
	}
	.mfgc-reel__avatar {
		display: block;
		width: 42px;
		height: 42px;
		border: 2px solid #fff;
		border-radius: 50%;
		overflow: hidden;
		background: #333;
	}
	.mfgc-reel__avatar .mfgc-reel__avatar-img,
	.mfgc-reel__avatar img,
	.mfgc-reel__avatar .mfgc-noimage {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		border-radius: 50%;
		object-fit: cover;
		font-size: 16px;
		color: #fff;
	}
	.mfgc-reel__actions .mfgc-fav.mfgc-reel__fav {
		position: static;
		width: 44px;
		height: 44px;
		background: rgba(0, 0, 0, .35);
	}
	.mfgc-reel__act {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		padding: 0;
		border: 0;
		background: none;
		color: #fff;
		font: inherit;
		font-size: 11px;
		text-decoration: none;
		filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
		cursor: pointer;
	}
	.mfgc-reel__act:hover { color: #fff; }
	.mfgc-reel__sound .mfgc-reel__sound-on,
	.mfgc-reel__sound[aria-pressed="true"] .mfgc-reel__sound-off { display: none; }
	.mfgc-reel__sound[aria-pressed="true"] .mfgc-reel__sound-on { display: inline; }
	.mfgc-reel__info {
		gap: 6px;
		padding: 10px 14px 12px;
		background: #000;
	}
	.mfgc-reel__info .mfgc-reel__name { font-size: 14px; -webkit-line-clamp: 1; line-clamp: 1; }
	.mfgc-reel__tags { flex-wrap: nowrap; overflow: hidden; }
	.mfgc-reel__info .mfgc-reel__cta { margin-top: 2px; }
	.mfgc-reel__cta a { padding: 10px 16px; }
}
