/* =========================================
   1. 기본 디자인
   ========================================= */
body {
	font-family: 'Arial', sans-serif;
	background-color: #f0f0f0;
	color: #333;
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	text-align: center;
	user-select: none;
}

header {
	background-color: #FFFFFF;
	color: white;
	padding: 15px 40px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	width: fit-content;
	margin: 0px auto;
	border-radius: 0 0 15px 15px;
}

header h1 {
	margin: 0;
	display: inline-block;
	color: #000;
}

main {
	flex-grow: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
}

#gameContainer {
	position: relative;
	width: 800px;
	height: 450px;
	background-color: #000;
	border: 5px solid #607D8B;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

canvas {
	display: block;
	background-color: #AADDEE;
	width: 100%;
	height: 100%;
}

/* =========================================
   2. UI 및 버튼 스타일
   ========================================= */
.Intro,
.Overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 10;
}

.Intro {
	background-color: rgba(255, 255, 255, 0.95);
}

.Overlay {
	background-color: rgba(0, 0, 0, 0.8);
	display: none;
}

.popup-content {
	background-color: #fff;
	color: #333;
	padding: 40px;
	border-radius: 15px;
	width: 60%;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* 난이도 선택 버튼 그룹 */
.level-select-group {
	display: flex;
	gap: 15px;
	margin-bottom: 30px;
}

.btn-level {
	width: 200px;
	height: 150px;
	background-color: #fff;
	border: 4px solid #ccc;
	border-radius: 10px;
	font-size: 1.2em;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s;
	color: #555;
}

.btn-level .desc {
	display: block;
	font-size: 0.5em;
	margin-top: 5px;
	color: #888;
	font-weight: normal;
}

.btn-level:hover {
	transform: translateY(-3px);
}

/* 난이도 선택 상태 (Selected) */
.btn-level.selected {
	background-color: #E8F5E9;
	transform: scale(1.05);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 각 난이도별 선택 시 테두리/글자색 강조는 HTML 인라인 스타일로 보조하거나 JS로 처리 */
.btn-level.selected[data-level="PLAINS"] {
	border-color: #4CAF50;
	color: #2E7D32;
}

.btn-level.selected[data-level="FOREST"] {
	border-color: #795548;
	color: #4E342E;
}

.btn-level.selected[data-level="CAVE"] {
	border-color: #673AB7;
	color: #4527A0;
}

/* 공통 버튼 */
button {
	padding: 15px 30px;
	margin: 10px;
	border: none;
	border-radius: 8px;
	font-size: 1.1em;
	font-weight: bold;
	cursor: pointer;
	transition: transform 0.1s;
}

button:active {
	transform: translateY(2px);
}

.btn-start {
	background-color: #FF9800;
	color: white;
	min-width: 150px;
}

.btn-info {
	background-color: #2196F3;
	color: white;
}

.btn-retry {
	background-color: #FFFF00;
	color: black;
}

.btn-home {
	background-color: #e0e0e0;
	color: #333;
}

.btn-close {
	background-color: #607D8B;
	color: white;
}

/* 기존 CSS 아래에 추가해 주세요 */

/* 잠김 상태 버튼 스타일 */
.btn-level.locked {
	background-color: #e0e0e0;
	border-color: #999 !important;
	color: #999 !important;
	cursor: not-allowed;
	opacity: 0.7;
	position: relative;
}

.btn-level.locked:hover {
	transform: none;
	/* 잠긴 버튼은 움직이지 않음 */
	box-shadow: none;
}

/* 잠김 아이콘 및 텍스트 */
.lock-overlay {
	font-size: 0.8em;
	margin-top: 5px;
	color: #d32f2f;
	/* 빨간색 경고 텍스트 */
	font-weight: bold;
}

footer {
	margin-top: 20px;
	color: #888;
	font-size: 0.9em;
}
/* --- 도전과제 UI 스타일 --- */

/* 1. 도전과제 알림 팝업 (Toast) */
#achievementToast {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(-100px);
	/* 처음엔 위로 숨김 */
	background: rgba(0, 0, 0, 0.9);
	border: 2px solid #FFD700;
	color: white;
	padding: 15px 25px;
	border-radius: 30px;
	display: flex;
	align-items: center;
	gap: 15px;
	z-index: 100;
	transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	pointer-events: none;
	/* 클릭 방지 */
	min-width: 300px;
}

#achievementToast.show {
	transform: translateX(-50%) translateY(0);
}

.toast-icon {
	font-size: 30px;
}

.toast-text h4 {
	margin: 0;
	color: #FFD700;
	font-size: 14px;
}

.toast-text p {
	margin: 5px 0 0 0;
	font-size: 16px;
	font-weight: bold;
}

/* 2. 도전과제 목록 화면 */
#achievementList {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	/* 2열 배치 */
	gap: 10px;
	width: 80%;
	max-height: 60%;
	overflow-y: auto;
	margin-bottom: 20px;
}

.ach-item {
	background: #333;
	padding: 10px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid #555;
	opacity: 0.5;
	/* 기본은 잠겨있음 */
	transition: 0.3s;
}

.ach-item.unlocked {
	opacity: 1;
	border-color: #FFD700;
	background: #444;
	box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.ach-icon {
	font-size: 24px;
}

.ach-info h4 {
	margin: 0;
	font-size: 14px;
	color: #fff;
}

.ach-info p {
	margin: 3px 0 0 0;
	font-size: 11px;
	color: #aaa;
}
