/* EMDB 共通カード一覧（inc/emdb_cards.php）
 * .emdb-cards            一覧ラッパー（data-per-page / data-total）
 * .emdb-cards--{variant} ページ別調整（creator / brand / game / game-list）
 * .emdb-cards--nothumb   サムネなし（music）
 * .emdb-card             1 枚。hidden 属性で 2 ページ目以降を隠す（JS が切替）
 */
.emdb-cards {
	--cards-gap: 12px;
	--cards-line: #e5e5e5;
	--cards-muted: #777;
	--cards-label-bg: #f2f2f2;
	--cards-accent: #e9608a;
	--cards-label-w: 5.5em;   /* 行ラベルの固定幅（そろえる） */
	margin: 0 0 2.2em;
}
.emdb-cards__heading .emdb-cards__count {
	display: inline-block;
	font-size: 0.6em;
	font-weight: normal;
	color: var(--cards-muted, #777);
	background: #f2f2f2;
	border-radius: 999px;
	padding: 2px 10px;
	vertical-align: middle;
	margin-left: 4px;
}
.emdb-cards__heading .emdb-cards__refresh {
	font-size: 0.5em;
	font-weight: normal;
	margin-left: 8px;
	vertical-align: middle;
	opacity: 0.6;
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 3px;
	padding: 1px 6px;
}
.emdb-cards__empty { color: var(--cards-muted); }

/* グリッド: PC 3 列 / タブレット 2 列 / スマホ 1 列 */
.emdb-cards__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cards-gap);
}
@media screen and (max-width: 1023px) { .emdb-cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media screen and (max-width: 560px)  { .emdb-cards__grid { grid-template-columns: minmax(0, 1fr); } }

/* カード */
.emdb-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--cards-line);
	border-radius: 6px;
	overflow: hidden;
	transition: box-shadow .15s, transform .15s;
}
.emdb-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.emdb-card[hidden] { display: none; }

/* ---- サムネ ---- */
.emdb-card__thumb {
	position: relative;
	display: block;
	background: #f3f3f3;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	text-decoration: none;
}
.emdb-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* ゲーム: 縦長のパッケージ画像を切らずに全体表示 */
.emdb-card--game .emdb-card__thumb { aspect-ratio: 4 / 3; background: #ececec; }
.emdb-card__thumb--contain img { object-fit: contain; }
/* 外部リンクのサムネ（ゲームページのパッケージ画像と同じ: 出典ドメインを下部に） */
.emdb-card__thumb--ext { cursor: alias; }
.emdb-card__ogp {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px;
	font-size: 11px;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
}
.emdb-card__ogp img { width: 16px; height: 16px; border-radius: 2px; background: #fff; }
.emdb-card__ogp-domain { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.emdb-card__ogp .fas { font-size: 10px; opacity: .9; }
.emdb-card__thumb--ext:hover .emdb-card__ogp { background: linear-gradient(to top, rgba(233, 96, 138, .85), rgba(233, 96, 138, 0)); }

/* サムネ四隅のオーバーレイ（動画: 種別 / 視聴サイト / 公開日 / 長さ） */
.emdb-card__ov { position: absolute; display: flex; gap: 4px; align-items: center; max-width: 70%; pointer-events: none; }
.emdb-card__ov--tl { top: 6px; left: 6px; }
.emdb-card__ov--tr { top: 6px; right: 6px; }
.emdb-card__ov--bl { bottom: 6px; left: 6px; }
.emdb-card__ov--br { bottom: 6px; right: 6px; }
.emdb-card__ovtext {
	font-size: 11px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 3px;
	color: #fff;
	background: rgba(0, 0, 0, .65);
	white-space: nowrap;
}
.emdb-card__ov .emdb-badge { background: rgba(0, 0, 0, .65); color: #fff; }
.emdb-src {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 3px;
	background: rgba(0, 0, 0, .65);
	color: #fff;
	font-size: 13px;
}
.emdb-src--youtube i { color: #ff3333; }
.emdb-src--videofile i { color: #ff8fb2; }
.emdb-src-txt { font-size: 9px; font-weight: bold; letter-spacing: .02em; }

/* ---- 本文 ---- */
.emdb-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px 12px;
	font-size: 12px;
	line-height: 1.5;
	color: #444;
}
.emdb-card__caption { font-size: 11px; color: var(--cards-muted); margin-bottom: 2px; }
.emdb-card__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.emdb-card .emdb-card__title {
	font-size: 14px;
	line-height: 1.4;
	font-weight: bold;
	margin: 0 0 8px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}
.emdb-card .emdb-card__title::before, .emdb-card .emdb-card__title::after { display: none; }
.emdb-card .emdb-card__title a { color: #333; text-decoration: none; }
.emdb-card .emdb-card__title a:hover { color: var(--cards-accent); text-decoration: underline; }

/* 行: ラベル列を固定幅にしてそろえる */
.emdb-card__meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.emdb-card__row { display: grid; grid-template-columns: var(--cards-label-w) minmax(0, 1fr); gap: 8px; align-items: start; min-width: 0; }
.emdb-card__label {
	font-size: 10px;
	line-height: 1.2;
	padding: 3px 5px;
	border-radius: 3px;
	background: var(--cards-label-bg);
	color: var(--cards-muted);
	margin-top: 2px;
	text-align: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.emdb-card__text { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.emdb-card__text a { color: #444; text-decoration: none; border-bottom: 1px dotted #bbb; }
.emdb-card__text a:hover { color: var(--cards-accent); border-bottom-color: var(--cards-accent); }
.emdb-card__sub { color: var(--cards-muted); font-size: 11px; }
.emdb-card__role { color: var(--cards-muted); }
.emdb-card__na { color: #aaa; }
/* 本人（色は PHP 側の inline style: EMDB_CARDS_SELF_COLOR） */
.emdb-card .emdb-card__name.is-self { border-bottom: 2px solid currentColor; }

/* クレジットの区切り。data-sep があればその記号（歌の＋ / × / ∞ など）、なければ「/」 */
.emdb-card__credits { display: inline; }
.emdb-card__credit { display: inline; }
.emdb-card__credit:not(:last-child)::after { content: "/"; color: #999; margin: 0 .45em; }
.emdb-card__credits[data-sep="＋"] .emdb-card__credit:not(:last-child)::after { content: "＋"; color: #444; margin: 0 .2em; }
.emdb-card__credits[data-sep="＆"] .emdb-card__credit:not(:last-child)::after { content: "＆"; color: #444; margin: 0 .2em; }
.emdb-card__credits[data-sep="×"]  .emdb-card__credit:not(:last-child)::after { content: "×";  color: #444; margin: 0 .2em; }
.emdb-card__credits[data-sep="∞"]  .emdb-card__credit:not(:last-child)::after { content: "∞";  color: #444; margin: 0 .2em; }
.emdb-card__credits[data-sep="、"] .emdb-card__credit:not(:last-child)::after { content: "、"; color: #444; margin: 0; }
.emdb-card__credits[data-sep=" "]  .emdb-card__credit:not(:last-child)::after { content: " ";  margin: 0 .2em; }

/* ---- フッター: 補足情報 + 大きめの詳細ボタン ---- */
.emdb-card__footer { margin-top: auto; padding-top: 10px; }
.emdb-card__footinfo {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-bottom: 8px;
	font-size: 11px;
	color: var(--cards-muted);
}
.emdb-card__footinfo .fa, .emdb-card__footinfo .fas, .emdb-card__footinfo .far { opacity: .7; }
.emdb-card__date { margin-left: auto; }
.emdb-card .emdb-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 38px;
	padding: 8px 12px;
	border: 1px solid var(--cards-accent);
	border-radius: 4px;
	background: #fff;
	color: var(--cards-accent);
	font-size: 13px;
	font-weight: bold;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.emdb-card .emdb-card__btn:hover { background: var(--cards-accent); color: #fff; }

/* ---- バッジ（タイトル上: 種別 / R-18 / 機種 / フル無料） ---- */
.emdb-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 3px;
	background: #f2f2f2;
	color: #555;
	white-space: nowrap;
}
.emdb-badge--cat { background: #eef3f8; color: #3b5b7a; }
.emdb-badge--free { background: #e8f6ec; color: #2d7a43; }
.emdb-badge--rating-r18 { background: #fdecf2; color: #c2185b; font-weight: bold; }
.emdb-badge--rating-all { background: #e8f6ec; color: #2d7a43; font-weight: bold; }
.emdb-badge--rating-both, .emdb-badge--rating-patch { background: #fff4e0; color: #9a6400; font-weight: bold; }
.emdb-badge--pf { background: #fafafa; border: 1px solid var(--cards-line); color: #555; }

/* ---- ページネーション ---- */
.emdb-cards__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 14px;
	font-size: 13px;
}
.emdb-cards__nav:empty { display: none; }
.emdb-cards__page, .emdb-cards__all {
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--cards-line);
	border-radius: 4px;
	background: #fff;
	color: #444;
	cursor: pointer;
	font: inherit;
	line-height: 32px;
}
.emdb-cards__page:hover, .emdb-cards__all:hover { border-color: var(--cards-accent); color: var(--cards-accent); }
.emdb-cards__page[aria-current="page"] { background: var(--cards-accent); border-color: var(--cards-accent); color: #fff; cursor: default; }
.emdb-cards__page:disabled { opacity: .35; cursor: default; }
.emdb-cards__gap { color: #999; padding: 0 2px; }
.emdb-cards__all { margin-left: 10px; }
.emdb-cards__nav-info { width: 100%; text-align: center; font-size: 11px; color: var(--cards-muted); }

/* ---- ページ別の調整（必要になったらここに足す） ---- */
/* .emdb-cards--creator {} */
/* .emdb-cards--brand {} */
/* .emdb-cards--game {} */
/* .emdb-cards--game-list {} */
