/* ==========================================================================
   ゲームカテゴリ共通スタイル
   ========================================================================== */

/* ゲーム用全画面オーバーレイ */
.flash-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: 20px;
	box-sizing: border-box;
	overflow-y: auto;
	gap: 20px;
}

/* READY画面 */
.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.1s linear;
}

/* プレイエリア */
.flash-display {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	max-width: 480px;
	margin: auto;
	gap: 20px;
	box-sizing: border-box;
}

/* 回答入力エリアのレイアウト */
.overlay-content-area {
	width: 100%;
	max-width: 320px;
	margin: auto;
	box-sizing: border-box;
}

.overlay-label {
	display: block;
	text-align: center;
	font-size: 1.2rem;
	font-weight: bold;
	color: #a0aec0;
	margin-bottom: 20px;
}

.answer-display-wrapper {
	margin-bottom: 15px;
}

input.answer-input {
	width: 100%;
	font-size: 4rem;
	text-align: center;
	background: #141722;
	color: #fff;
	border: 2px solid #323d54;
	border-radius: 8px;
	padding: 5px 10px;
	box-sizing: border-box;
	font-weight: bold;
	box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.answer-input::placeholder {
	font-size: 1.1rem;
	font-weight: normal;
	color: #4a5568;
}

/* テンキーのグリッド */
.keypad-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 5px;
	max-width: 320px;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	align-items: center;
	align-content: center;
}

.key-btn {
	background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
	border: 1px solid #4a5568;
	color: #fff;
	font-size: 1.5rem;
	font-weight: bold;
	aspect-ratio: 1.2 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	cursor: pointer;
	user-select: none;
	margin: 2px;
	transition: all 0.1s ease;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.key-btn:active {
	transform: translateY(2px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	background: #1a202c;
}

.key-btn.action-key {
	font-size: 1.5rem;
	font-weight: 900;
}

.key-btn.clear-key {
	background: linear-gradient(135deg, #742a2a 0%, #5c2323 100%);
	border-color: #9b2c2c;
}

.key-btn.clear-key:active {
	background: #5c2323;
}

.key-btn.submit-key {
	background: linear-gradient(135deg, #22543d 0%, #1c4530 100%);
	border-color: #276749;
}

.key-btn.submit-key:active {
	background: #1c4530;
}

/* メッセージ表示エリア */
#game-message-area.overlay-content-area {
	max-width: 500px;
}

.message-card {
	background: #151a28;
	border: 2px solid #2d3748;
	border-radius: 16px;
	padding: 30px 20px;
	text-align: center;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
	position: relative;
	width: 100%;
	min-width: 450px;
	max-width: 500px;
	box-sizing: border-box;
}

@media (max-width: 480px) {
	.message-card {
		min-width: auto;
		width: 100%;
	}
}

.message-card.correct {
	border-color: #00FA9A;
	box-shadow: 0 0 20px rgba(0, 250, 154, 0.15);
}

.message-card.incorrect {
	border-color: #ff4d4d;
	box-shadow: 0 0 20px rgba(255, 77, 77, 0.15);
}

.message-title {
	display: block;
	font-size: 2.2rem;
	font-weight: 900;
	margin-bottom: 10px;
}

.correct .message-title {
	color: #00FA9A;
}

.incorrect .message-title {
	color: #ff4d4d;
}

.message-desc {
	font-size: 1.1rem;
	color: #a0aec0;
	margin-bottom: 25px;
}

/* ボタン */
.next-btn {
	display: inline-block;
	background: linear-gradient(135deg, #1E90FF, #00D2FF);
	color: #fff;
	border: none;
	padding: 12px 30px;
	font-size: 1.1rem;
	font-weight: bold;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3);
}

.next-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(30, 144, 255, 0.4);
}

.next-btn .btn-main-text {
	font-size: 1.2rem;
	display: block;
	margin-top: 5px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding-top: 5px;
}

.next-btn .btn-details-container {
	display: inline-block;
	text-align: left;
	margin: 8px auto;
	font-size: 0.95rem;
	line-height: 1.6;
}

.ranking-btn {
	position: absolute;
	top: -20px;
	right: 20px;
	background: #2d3748;
	color: #a0aec0;
	border: 1px solid #4a5568;
	padding: 6px 15px;
	font-size: 0.8rem;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ranking-btn:hover:not(:disabled) {
	color: #fff;
	border-color: #1E90FF;
	background: #1E90FF;
}

.ranking-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ニックネーム入力 */
.nickname-input-container {
	margin-bottom: 20px;
	text-align: left;
}

.nickname-input-container label {
	display: block;
	font-size: 0.9rem;
	color: #a0aec0;
	margin-bottom: 8px;
}

.nickname-input-container input {
	width: 100%;
	background: #1a202c;
	color: #fff;
	border: 2px solid #2d3748;
	border-radius: 8px;
	padding: 10px 15px;
	font-size: 1rem;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.nickname-input-container input:focus {
	outline: none;
	border-color: #1E90FF;
}

/* 星評価表示 */
.star-rating {
	color: #FFD700;
	font-size: 0.95rem;
	letter-spacing: 1px;
}

/* スタートボタンの中央揃え */
#start-btn,
#demo-btn {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ランキングエリア */
.ranking-container {
	margin-top: 40px;
}

.table-container {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.95rem;
}

th,
td {
	padding: 12px;
	border-bottom: 1px solid #2d3748;
}

th {
	color: #a0aec0;
	font-weight: bold;
	background: transparent;
}

td {
	color: #e2e8f0;
}

tr:hover td {
	background: rgba(255, 255, 255, 0.02);
}

/* もっと見るボタン */
.more-btn-wrapper {
	text-align: center;
	margin-top: 25px;
	margin-bottom: 15px;
}

.more-btn {
	background: none;
	color: #a0aec0;
	border: 1px solid #2d3748;
	padding: 8px 25px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	transition: all 0.2s ease;
	margin: 0 auto;
	display: inline-block;
}

.more-btn:hover {
	color: #fff;
	border-color: #4a5568;
	background: #2d3748;
}

.hidden {
	display: none !important;
}

/* ランキングタブ切り替え UI */
.ranking-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 16px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.tab-btn {
	padding: 8px 12px;
	background: #2d3748;
	border: 1px solid #4a5568;
	color: #a0aec0;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: bold;
	white-space: nowrap;
	transition: all 0.2s;
	display: inline-block;
	margin: 0 !important;
}

.tab-btn:hover {
	background: #4a5568;
	color: #fff;
}

.tab-btn.active {
	background: #1E90FF;
	border-color: #1E90FF;
	color: #fff;
}

