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

html {
	scroll-behavior: smooth;
}

body {
	font-family: "Helvetica Neue",
		Arial,
		"Hiragino Kaku Gothic ProN",
		"Hiragino Sans",
		Meiryo,
		sans-serif;
	background: #000;
	color: #fff;
	padding: 20px;
	font-size: 18px;
}

a {
	text-decoration: none;
	color: #94ebff;
}

p {
	margin: 20px 0;
}

ul {
	list-style: none;
}

/* ヘッダー */
header {
	text-align: center;
	margin-bottom: 30px;
	padding: 20px;
}

.header-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	text-decoration: none;
}

.logo-container {
	display: flex;
	align-items: center;
	margin-bottom: 0;
}

.site-logo {
	width: 100px;
	height: 100px;
	transition: transform 6s ease-out;
}

.site-logo:hover {
	filter: drop-shadow(0 0 20px rgba(0, 210, 255, 0.6));
	transform: rotate(360deg);
}

.header-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: left;
}

.site-title {
	font-size: 2.5rem;
	margin: 0;
	font-weight: bold;
	line-height: 1.2;
}

.site-subtitle {
	font-size: 1rem;
	margin: 0;
	line-height: 1.4;
}

/* メインコンテナ */
main.game-page {
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 20px;
	position: relative;
	margin: 0 auto;
	max-width: 1100px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

h1 {
	font-size: 2rem;
	margin-bottom: 10px;
	font-weight: bold;
}

.category-title {
	text-align: center;
}

.game-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 20px auto;
	max-width: 700px;
}

.game-tags {
	margin: 20px auto;
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

.game-meta {
	display: flex;
	gap: 20px;
	margin-top: 40px;
	margin-bottom: 0;
	color: #aaa;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.game-tags a {
	background: #165766;
	border-radius: 20px;
	padding: 12px;
	text-decoration: none;
	color: #fff;
	transition: all 0.3s ease;
}

.related-games-title {
	font-size: 1.5rem;
	margin-bottom: 10px;
	font-weight: bold;
	text-align: center;
}

/* ゲーム一覧 */
.games-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin: 20px;
}

.game-card {
	background: #222;
	border-radius: 10px;
	padding: 12px;
	transition: all 0.3s ease;
	border: 1px solid #111;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
}

.game-card:hover {
	transform: translateY(-5px);
	border-color: #00d2ff;
	background: rgba(255, 255, 255, 0.05);
	box-shadow: 0 10px 30px rgba(0, 210, 255, 0.2);
}

.more-card {
	background: #333;
}

.more-card:hover {
	background: rgba(255, 255, 255, 0.12);
}

.game-icon {
	width: 100px;
	height: 100px;
	margin-bottom: 20px;
}

.games-list .game-name {
	font-size: 1.1rem;
	font-weight: bold;
	margin-bottom: 12px;
	height: 2.2rem;
	line-height: 1.1rem;
}

.games-list .game-desc {
	color: #fff;
	font-size: 0.9rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ナビゲーションメニュー */
nav {
	margin-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 20px;
}

.nav-menu {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
	margin: 0;
}

.nav-menu li a {
	color: #fff;
	text-decoration: none;
	font-weight: bold;
	padding: 8px 16px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.1);
	transition: all 0.3s ease;
	display: block;
}

.nav-menu li a:hover,
.nav-menu li a.current-parent {
	background: #00d2ff;
	color: #000;
	transform: translateY(-2px);
}

/* 子カテゴリ一覧 */
.child-categories-list {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 20px auto 30px;
	max-width: 800px;
}

.child-category-link {
	display: inline-block;
	padding: 8px 16px;
	padding-top: 12px;
	border-radius: 20px;
	background: rgba(42, 146, 113, 0.2);
	border: 1px solid rgba(42, 146, 113, 0.4);
	color: #fff;
	text-decoration: none;
	font-size: 0.9rem;
}

.child-category-link:hover {
	background: rgba(42, 146, 113, 0.6);
	border-color: #00d2ff;
	color: #fff;
}

.child-category-link.current-category {
	background: #00d2ff;
	color: #000;
	border-color: #00d2ff;
}

/* 広告・パンくず */
.adsense {
	width: 100%;
	height: 280px;
	text-align: center;
	margin: 30px auto;
}

.breadcrumb-separator {
	margin: 0 10px;
	color: #666;
}

/* ページネーション */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 40px 0;
	gap: 10px;
}

.page-link {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	min-width: 45px;
	height: 45px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	color: #fff;
	text-decoration: none;
	font-weight: bold;
	transition: all 0.3s ease;
	background: rgba(255, 255, 255, 0.05);
}

.page-link:hover:not(.current) {
	background: rgba(0, 210, 255, 0.2);
	border-color: #00d2ff;
	color: #fff;
}

.page-link.current {
	background: #00d2ff;
	color: #000;
	border-color: #00d2ff;
	cursor: default;
}

.page-ellipsis {
	color: #999;
	font-size: 1.2rem;
}

/* フッター */
footer {
	text-align: center;
	margin-top: 20px;
}

footer .site-title {
	font-size: 1.2rem;
}

footer .links {
	margin-top: 30px;
}

footer .links li {
	margin: 20px 10px;
}

#copyright {
	margin: 20px 0px;
	font-size: 1.1rem;
}

.site-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
}

.site-links a {
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 20px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	transition: all 0.4s;
}

.site-links a:hover {
	transform: translateY(-5px);
}

.site-links .site-icon {
	width: 80px;
	height: 80px;
}

.site-links .site-name {
	font-size: 1.1rem;
	font-weight: bold;
	color: #00d2ff;
}

.site-links .site-desc {
	font-size: 0.95rem;
	color: #ccc;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
	body {
		padding: 0;
	}

	main.game-page {
		border-radius: 0;
	}

	#site-title {
		font-size: 1.5rem;
	}

	.site-links {
		grid-template-columns: 1fr;
	}

	.site-links a {
		margin: 0 20px;
	}
}

@media (max-width: 600px) {
	.pagination {
		flex-wrap: wrap;
		gap: 6px;
	}

	.page-link.page-prev,
	.page-link.page-next {
		display: none;
	}
}

/* ==========================================================================
   ゲーム共通（canvas シェル）
   ========================================================================== */

.game-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(10, 12, 18, 0.98);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 16px;
	box-sizing: border-box;
	overflow: hidden;
	gap: 12px;
	animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.ready-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	width: 100%;
	max-width: 300px;
}

.ready-text {
	font-size: 3rem;
	font-weight: 900;
	color: #1E90FF;
	text-shadow: 0 0 10px rgba(30, 144, 255, 0.5);
	letter-spacing: 4px;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}

	50% {
		transform: scale(1.05);
		opacity: 1;
	}

	100% {
		transform: scale(1);
		opacity: 0.8;
	}
}

.progress-bar-bg {
	width: 100%;
	height: 8px;
	background: #1a202c;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid #2d3748;
}

.progress-bar {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, #1E90FF, #00D2FF);
	transition: width 0.05s linear;
}

#animation-box {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	max-width: 960px;
	aspect-ratio: 960 / 540;
	margin: 0 auto;
	background-color: #ccc;
	opacity: 0;
}

#animation-box.is-animating {
	animation: animBoxExpand 1s ease-out;
}

@keyframes animBoxExpand {
	0% {
		transform: translate(-50%, -50%) scaleX(0) scaleY(0);
		opacity: 1;
	}

	60% {
		transform: translate(-50%, -50%) scaleX(1) scaleY(0.002);
		opacity: 1;
	}

	100% {
		transform: translate(-50%, -50%) scaleX(1) scaleY(1);
		opacity: 0;
	}
}

.canvas-wrap {
	position: relative;
	margin: 0 auto;
	opacity: 0;
	animation: fadeIn 0.5s ease-out 0.5s forwards;
}

#game-canvas {
	display: block;
	background: #0b0f18;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	touch-action: none;
	margin: 0 auto;
}

:fullscreen .canvas-wrap,
:-webkit-full-screen .canvas-wrap {
	width: 100vw !important;
	max-width: 100vw !important;
	height: 100vh !important;
	max-height: 100vh !important;
	aspect-ratio: auto !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}

:fullscreen #game-canvas,
:-webkit-full-screen #game-canvas {
	width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	aspect-ratio: auto !important;
	border: none !important;
	border-radius: 0 !important;
}

.pseudo-fullscreen {
	position: fixed;
	inset: 0;
	height: 100svh;
	z-index: 9999;
}

.game-hud {
	position: absolute;
	top: 10px;
	left: 12px;
	right: 12px;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
	color: #fff;
	font-weight: 700;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
	font-size: 1rem;
}

.overlay-content-area {
	width: 100%;
	max-width: 420px;
}

.message-card {
	background: #1a202c;
	border: 1px solid #2d3748;
	border-radius: 12px;
	padding: 28px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: center;
}

.message-title {
	font-size: 1.8rem;
	font-weight: 800;
	color: #00D2FF;
}

.message-desc {
	color: #ccc;
	margin: 0;
	line-height: 1.6;
}

.next-btn,
.ranking-btn,
.large-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 700;
	padding: 12px 28px;
	border-radius: 8px;
	color: #fff;
}

.next-btn,
.large-btn {
	background: linear-gradient(90deg, #1E90FF, #00D2FF);
}

.ranking-btn {
	background: #2d3748;
}

.game-controls .flex-row {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.info-box {
	margin-top: 32px;
}

.info-box ul {
	list-style: disc;
	padding-left: 1.4em;
	margin: 12px 0 24px;
	line-height: 1.7;
}

.info-title {
	font-size: 1.3rem;
	margin-bottom: 8px;
}

.game-hud,
#game-message-area {
	display: none !important;
}

.game-control-btn {
	position: absolute !important;
	top: 16px !important;
	z-index: 10000 !important;
	background: #2d3748 !important;
	border: 1px solid #4a5568 !important;
	width: 40px !important;
	height: 40px !important;
	padding: 0 !important;
	border-radius: 6px !important;
	color: #fff !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.2s ease !important;
}

.game-control-btn:hover {
	background: #4a5568 !important;
	border-color: #718096 !important;
}

#close-overlay-btn {
	right: 16px !important;
}

#fullscreen-btn {
	right: 64px !important;
}

#fullbrowser-btn {
	right: 112px !important;
}

.pseudo-fullscreen .canvas-wrap {
	width: 100vw !important;
	max-width: 100vw !important;
	height: 100vh !important;
	max-height: 100vh !important;
	aspect-ratio: auto !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}

.pseudo-fullscreen #game-canvas {
	width: 100% !important;
	max-width: 100% !important;
	height: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	aspect-ratio: auto !important;
	border: none !important;
	border-radius: 0 !important;
}

#exit-confirm-modal {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	z-index: 10001 !important;
}

.exit-modal-actions {
	margin-top: 10px !important;
	gap: 12px !important;
	display: flex !important;
	justify-content: center !important;
}

#exit-cancel-btn {
	position: static !important;
	padding: 10px 24px !important;
	border-radius: 8px !important;
	font-size: 1rem !important;
	color: #fff !important;
	cursor: pointer !important;
}

#exit-ok-btn {
	padding: 10px 24px !important;
	font-size: 1rem !important;
	cursor: pointer !important;
}