/* erogate 年齢確認ゲート。外部フォント・外部画像なし（端末の標準フォントだけ）。
   未同意のときだけ <head> の判定が html.eg-age-gate-active を付ける。 */

/* 背景のスクロールを止める */
html.eg-age-gate-active,
html.eg-age-gate-active body {
	overflow: hidden !important;
}

/* 幕: フッターのダイアログが届く前から本文を覆う（描画直後のちらつき防止） */
html.eg-age-gate-active::before {
	content: "";
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483646;
	background: rgba(12, 12, 14, 0.92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.eg-age-gate {
	display: none;
}

/* hidden 属性があっても、判定が付けたクラスで表示する（JS の実行前から出す） */
html.eg-age-gate-active .eg-age-gate {
	display: flex;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483647;
	box-sizing: border-box;
	margin: 0;
	padding: 16px;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: transparent;
	color: #1d1d1f;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	text-align: center;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.eg-age-gate__dialog {
	box-sizing: border-box;
	width: 100%;
	max-width: 400px;
	margin: auto; /* 縦に収まらないときは上から読めるよう、align-items ではなく margin で中央に置く */
	padding: 28px 20px 20px;
	border-radius: 16px;
	background: #ffffff;
	color: #1d1d1f;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	overflow-wrap: anywhere;
}

.eg-age-gate__dialog:focus {
	outline: none;
}

.eg-age-gate .eg-age-gate__site,
.eg-age-gate .eg-age-gate__title,
.eg-age-gate .eg-age-gate__text,
.eg-age-gate .eg-age-gate__note {
	padding: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.eg-age-gate .eg-age-gate__site {
	margin: 0 0 4px;
	color: #6e6e73;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.4;
}

.eg-age-gate .eg-age-gate__title {
	margin: 0 0 8px;
	color: inherit;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.4;
}

.eg-age-gate .eg-age-gate__text {
	margin: 0 0 20px;
	color: #3a3a3c;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.eg-age-gate .eg-age-gate__actions {
	display: flex;
	gap: 12px;
	margin: 0;
}

.eg-age-gate .eg-age-gate__btn {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	flex: 1 1 0;
	min-width: 0;
	min-height: 52px;
	margin: 0;
	padding: 12px 16px;
	border: 2px solid #1d1d1f;
	border-radius: 12px;
	box-shadow: none;
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	touch-action: manipulation;
}

.eg-age-gate .eg-age-gate__btn--yes {
	background: #1d1d1f;
	color: #ffffff;
}

.eg-age-gate .eg-age-gate__btn--yes:hover {
	background: #3a3a3c;
	border-color: #3a3a3c;
}

.eg-age-gate .eg-age-gate__btn--no {
	background: #ffffff;
	color: #1d1d1f;
}

.eg-age-gate .eg-age-gate__btn--no:hover {
	background: #f2f2f2;
}

.eg-age-gate .eg-age-gate__btn:focus-visible {
	outline: 3px solid #0a64d8;
	outline-offset: 3px;
}

.eg-age-gate .eg-age-gate__note {
	margin: 16px 0 0;
	color: #6e6e73;
	font-size: 0.75rem;
	line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
	.eg-age-gate__dialog {
		background: #2c2c2e;
		color: #f5f5f7;
		box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 40px rgba(0, 0, 0, 0.6);
	}

	.eg-age-gate .eg-age-gate__site,
	.eg-age-gate .eg-age-gate__note {
		color: #a1a1a6;
	}

	.eg-age-gate .eg-age-gate__text {
		color: #d1d1d6;
	}

	.eg-age-gate .eg-age-gate__btn {
		border-color: #f5f5f7;
	}

	.eg-age-gate .eg-age-gate__btn--yes {
		background: #f5f5f7;
		color: #1c1c1e;
	}

	.eg-age-gate .eg-age-gate__btn--yes:hover {
		background: #d1d1d6;
		border-color: #d1d1d6;
	}

	.eg-age-gate .eg-age-gate__btn--no {
		background: #2c2c2e;
		color: #f5f5f7;
	}

	.eg-age-gate .eg-age-gate__btn--no:hover {
		background: #3a3a3c;
	}

	.eg-age-gate .eg-age-gate__btn:focus-visible {
		outline-color: #64a8ff;
	}
}
