/**
 * ===== フロントエンド用 CSS =====
 * ファイル: assets/jpcw.css
 * WordPressプラグイン用に最適化
 */

/* 基本レイアウト */
.jpcw-wrapper {
	background-color: #f0f2f5;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
	min-height: 100vh;
	margin: 0;
	padding: 20px 0;
	font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
}

/* ゲームコンテナ */
.jpcw-game-container {
	text-align: center;
	width: auto;
	max-width: 600px;
	padding: 20px;
	background-color: #f9f9f9;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	animation: fadeIn 0.5s ease-out;
}

.jpcw-game-container h3 {
	color: #333;
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.8em;
	font-weight: 600;
}

/* ボード */
.jpcw-board {
	display: grid;
	grid-template-columns: repeat(12, 40px);
	grid-template-rows: repeat(12, 40px);
	width: 480px;
	height: 480px;
	border: 3px solid #333;
	margin: 20px auto;
	background-color: #fff;
	box-shadow: 0 4px 8px rgba(0,0,0,0.1);
	border-radius: 5px;
	overflow: hidden;
}

/* セル */
.jpcw-cell {
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	border: 1px solid #333;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #e8f4fd;
	box-sizing: border-box;
	position: relative;
	transition: background-color 0.2s ease;
	box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.1);
}

.empty-cell {
	background-color: #fff;
	border-color: #333;
}

/* 入力フィールド */
.crossword-input {
	width: 100%;
	height: 100%;
	border: none;
	text-align: center;
	font-size: 1.2em;
	font-weight: 500;
	box-sizing: border-box;
	background: transparent;
	color: #333;
	outline: none;
	padding: 0;
}

.crossword-input:focus {
	background-color: #e3f2fd;
	border: 2px solid #2196f3;
}

.crossword-input:disabled {
	background-color: #f0f0f0;
	color: #666;
}

/* 単語番号 */
.cell-number {
	position: absolute;
	top: 2px;
	left: 2px;
	font-size: 0.7em;
	font-weight: bold;
	color: #555;
	pointer-events: none;
}

/* コントロールボタン */
.jpcw-controls {
	margin-top: 20px;
	display: flex;
	justify-content: center;
	gap: 15px;
	flex-wrap: wrap;
}

.jpcw-controls button {
	padding: 10px 20px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	border: none;
	background-color: #007cba;
	color: white;
	border-radius: 6px;
	transition: all 0.3s ease;
}

.jpcw-controls button:hover {
	background-color: #005a87;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.jpcw-controls button:nth-child(2) {
	background-color: #28a745;
}

.jpcw-controls button:nth-child(2):hover {
	background-color: #1e7e34;
}

/* ステータス表示 */
.jpcw-status {
	margin-top: 20px;
	font-weight: 600;
	font-size: 1.1em;
	min-height: 28px;
	padding: 8px;
	border-radius: 5px;
	transition: all 0.3s ease;
}

/* ヒント表示 */
.jpcw-hints {
	text-align: left;
	padding: 20px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	max-width: 400px;
}

.jpcw-hints h4 {
	margin-top: 0;
	margin-bottom: 10px;
	border-bottom: 2px solid #eee;
	padding-bottom: 5px;
}

.jpcw-hints ul {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.95em;
}

.jpcw-hints li {
	margin-bottom: 8px;
}

/* メッセージスタイル */
.success { color: #155724; background-color: #d4edda; }
.info { color: #0c5460; background-color: #d1ecf1; }
.error { color: #721c24; background-color: #f8d7da; }

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
	.jpcw-wrapper {
		margin: 0.5rem;
		padding: 1rem;
	}
	
	.jpcw-controls {
		flex-direction: column;
		align-items: center;
	}
	
	.jpcw-controls button {
		width: 100%;
		max-width: 200px;
	}
	
	.jpcw-cell {
		width: 32px;
		height: 32px;
	}
	
	.crossword-input {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.jpcw-wrapper {
		padding: 0.75rem;
	}
	
	.jpcw-controls button {
		min-width: 120px;
		font-size: 13px;
		padding: 0.6rem 0.8rem;
	}
	
	.jpcw-cell {
		width: 28px;
		height: 28px;
	}
	
	.crossword-input {
		font-size: 14px;
	}
}

