/* Quiz Style */
.quiz-container {
	max-width: 800px;
	margin: 40px auto;
	font-family: 'Noto Sans JP', sans-serif;
}

.quiz-screen {
	display: none;
}

.quiz-screen.active {
	display: block;
}

/* Intro */
.quiz-title {
	text-align: center;
	color: #005ea6;
	margin-bottom: 30px;
	font-size: 2.2em;
	font-weight: bold;
}

.quiz-rules {
	background: #f8fbff;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #ddecff;
	margin-bottom: 30px;
}

.quiz-rules h3 {
	margin-top: 0;
	color: #444;
}

.quiz-rules ul {
	margin: 10px 0 0 20px;
	list-style-type: disc;
}

.quiz-settings {
	background: #fff;
	padding: 30px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	border-radius: 8px;
	text-align: center;
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 10px;
	font-weight: bold;
}

#quiz-nickname {
	padding: 10px;
	font-size: 16px;
	width: 100%;
	max-width: 300px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.checkbox-group label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 1.1em;
}

.checkbox-group input[type="checkbox"] {
	transform: scale(1.5);
}

.mode-description {
	font-size: 0.9em;
	margin-bottom: 20px;
	text-align: center;
}

.mode-description.warning {
	color: #d9534f;
}

.mode-description.info {
	color: #5bc0de;
}

.btn-start {
	background: #e65100;
	color: #fff;
	font-size: 1.5em;
	padding: 15px 50px;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	font-weight: bold;
	transition: transform 0.2s, box-shadow 0.2s;
	box-shadow: 0 4px 0 #bf360c;
}

.btn-start:hover {
	transform: translateY(2px);
	box-shadow: 0 2px 0 #bf360c;
}

.btn-start:active {
	transform: translateY(4px);
	box-shadow: none;
}

/* Ranking List */
.ranking-preview {
	margin-top: 50px;
}

.ranking-list {
	list-style: none;
	padding: 0;
	margin: 0;
	background: #fff;
	border: 1px solid #eee;
}

.ranking-list li {
	padding: 10px;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.ranking-list li span:nth-child(1) {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-right: 10px;
}

.ranking-list li span:nth-child(2) {
	width: 80px;
	text-align: center;
	flex-shrink: 0;
	font-weight: bold;
}

.ranking-list li span:nth-child(3) {
	width: 140px;
	text-align: right;
	flex-shrink: 0;
}

.ranking-list li:nth-child(1) {
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
	font-weight: bold;
	color: #8b6914;
	box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
	border-left: 4px solid #d4af37;
}

.ranking-list li:nth-child(2) {
	background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 50%, #e8e8e8 100%);
	font-weight: bold;
	color: #4a4a4a;
	box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
	border-left: 4px solid #a8a8a8;
}

.ranking-list li:nth-child(3) {
	background: linear-gradient(135deg, #f4c430 0%, #cd7f32 50%, #f4c430 100%);
	font-weight: bold;
	color: #5c3317;
	box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
	border-left: 4px solid #b8860b;
}

.ranking-list .ranking-date {
	font-size: 0.85em;
	color: #666;
	margin-left: 10px;
	opacity: 0.8;
}

/* Quiz Play */
.quiz-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	background: #333;
	color: #fff;
	padding: 10px 20px;
	border-radius: 4px;
}

.badge {
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 0.8em;
	background: #999;
}

.badge.ranking {
	background: #e65100;
	font-weight: bold;
}

.badge.practice {
	background: #5bc0de;
}

#timer-area {
	font-size: 1.5em;
	font-weight: bold;
	margin-left: 15px;
	font-family: monospace;
}

.quiz-progress {
	font-size: 0.9em;
}

.quiz-card {
	background: #fff;
	border: 1px solid #e1e4e8;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.question-box h2 {
	margin-top: 0;
	font-size: 1.4em;
	line-height: 1.6;
	margin-bottom: 30px;
	color: #2c3e50;
}

/* Difficulty Badge Styles */
.quiz-difficulty-badge {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 0.85em;
	font-weight: bold;
	margin-bottom: 20px;
	text-align: center;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quiz-difficulty-badge.diff-1 {
	background: linear-gradient(135deg, #a8e6cf 0%, #81c784 100%);
	color: #1b5e20;
	border: 2px solid #66bb6a;
}

.quiz-difficulty-badge.diff-2 {
	background: linear-gradient(135deg, #ffeb99 0%, #ffd54f 100%);
	color: #f57c00;
	border: 2px solid #ffb300;
}

.quiz-difficulty-badge.diff-3 {
	background: linear-gradient(135deg, #ffcc80 0%, #ff9800 100%);
	color: #bf360c;
	border: 2px solid #f57c00;
}

.quiz-difficulty-badge.diff-4 {
	background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
	color: #fff;
	border: 2px solid #b71c1c;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	}

	50% {
		transform: scale(1.05);
		box-shadow: 0 4px 8px rgba(198, 40, 40, 0.3);
	}
}


.options-box button.option-btn {
	display: block;
	width: 100%;
	text-align: left;
	padding: 15px 20px;
	margin-bottom: 10px;
	background: #f8f9fa;
	border: 2px solid #e9ecef;
	border-radius: 6px;
	font-size: 1em;
	cursor: pointer;
	transition: all 0.2s;
	position: relative;
}

.options-box button.option-btn:hover {
	background: #e2e6ea;
	border-color: #adb5bd;
}

.options-box button.option-btn.selected {
	border-color: #007bff;
	background: #e7f1ff;
	color: #007bff;
}

.options-box button.option-btn.correct {
	border-color: #28a745;
	background: #d4edda;
	color: #155724;
}

.options-box button.option-btn.wrong {
	border-color: #dc3545;
	background: #f8d7da;
	color: #721c24;
}

/* Feedback */
.feedback-area {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 2px solid #eee;
	animation: fadeIn 0.3s;
}

.feedback-msg {
	font-size: 1.5em;
	font-weight: bold;
	margin-bottom: 15px;
}

.feedback-msg.correct-msg {
	color: #28a745;
}

.feedback-msg.wrong-msg {
	color: #dc3545;
}

.explanation-box {
	background: #f6fafd;
	border-left: 4px solid #2980b9;
	padding: 15px;
	margin-bottom: 20px;
	font-size: 0.95em;
	line-height: 1.6;
	color: #444;
}

.btn-next {
	display: inline-block;
	padding: 12px 40px;
	background: #007bff;
	color: #fff;
	font-size: 1.2em;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.btn-next:hover {
	background: #0069d9;
}

/* Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 9999;
	display: flex;
	justify-content: center;
	align-items: center;
	animation: fadeIn 0.3s;
}

.modal-content {
	background: #fff;
	padding: 40px;
	border-radius: 12px;
	text-align: center;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
	position: relative;
	top: -50px;
	/* slight offset */
}

.modal-content h2 {
	font-size: 2em;
	color: #e65100;
	margin-top: 0;
}

.result-score .val {
	font-size: 3em;
	font-weight: bold;
	color: #333;
}

.result-score .total {
	font-size: 1.5em;
	color: #999;
}

.rank-display {
	font-size: 2em;
	color: #005ea6;
	font-weight: bold;
}

.result-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 30px;
}

.btn-action {
	padding: 12px;
	font-size: 1em;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
}

.btn-action.primary {
	background: #007bff;
	color: #fff;
	border: none;
}

.btn-action.secondary {
	background: #6c757d;
	color: #fff;
	border: none;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* SP Responsive */
@media (max-width: 600px) {
	.result-score .val {
		font-size: 2.5em;
	}

	.btn-start {
		font-size: 1.2em;
		padding: 12px 30px;
		width: 100%;
	}

	.quiz-header {
		flex-direction: column;
		gap: 5px;
		text-align: center;
	}
}