@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* =========================================
   1. 통합 테마 변수 (Variables)
   ========================================= */
:root {
	/* [라이트 모드] */
	--bg-page: #ffffff;
	--bg-header: #ffffff;
	--text-primary: #111;
	--text-secondary: #555555;
	--border-color: #dcdfe3;
	--button-bg: #e9e9ed;

	--item-bg: #f9f9f9;
	--item-hover: #eef2f5;

	--active-color: #2ecc71;
	--active-bg: #e8f8f5;
	--active-glow: rgba(46, 204, 113, 0.3);

	--spring-text: #2ecc71;
	--spring-bg: rgba(46, 204, 113, 0.1);
	--price-text: #e74c3c;
}

body[data-theme="dark"] {
	/* [다크 모드] */
	--bg-page: #12151f;
	--bg-header: #0d1017;
	--text-primary: #ffffff;
	--text-secondary: #8daac7;
	--border-color: #444c5e;
	--button-bg: #2a3245;

	--item-bg: #111;
	--item-hover: #2a3245;

	--active-color: #5260a0;
	--active-bg: #1a2141;
	--active-glow: rgba(82, 96, 160, 0.4);

	--spring-text: #4cd137;
	--spring-bg: rgba(76, 209, 55, 0.15);
	--price-text: #ff6b6b;
}

/* =========================================
   2. 기본 설정
   ========================================= */
*,
::before,
::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html {
	font-size: 62.5%;
} /* 1rem = 10px */

body {
	font-family: "Pretendard Variable", Pretendard, sans-serif;
	font-size: 1.7rem; /* 기본 폰트 큼직하게 */
	background-color: var(--bg-page);
	color: var(--text-primary);
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: background-color 0.3s ease, color 0.3s ease;
}

body.menu-open {
	overflow: hidden;
}
a {
	text-decoration: none;
	color: inherit;
}
ul {
	list-style: none;
}
button {
	font-family: inherit;
	border: none;
	background: transparent;
	cursor: pointer;
	color: inherit;
}

/* =========================================
   3. 헤더 & 네비게이션
   ========================================= */
.site-header {
	width: 100%;
	padding: 1.5rem 3rem;
	background-color: var(--bg-header);
	border-bottom: 1px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: sticky;
	top: 0;
	z-index: 900;
	transition: background-color 0.3s ease;
}

.header-logo a {
	font-size: 2.2rem;
	font-weight: 900;
	letter-spacing: -0.5px;
}
.header-logo a img {
	max-width: 150px;
}

.nav-links > ul {
	display: flex;
	gap: 1rem;
}
.nav-links li {
	position: relative;
}
.nav-links > ul > li > a {
	display: block;
	padding: 1rem 1.5rem;
	font-weight: 600;
	color: var(--text-secondary);
	border-radius: 8px;
	transition: 0.2s;
	font-size: 1.6rem;
}
.nav-links > ul > li > a:hover {
	background-color: var(--button-bg);
	color: var(--text-primary);
}

/* 드롭다운 */
.dropdown-menu {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	background-color: var(--bg-header);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 0.5rem 0;
	min-width: 20rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.2s ease;
	z-index: 1000;
}
.dropdown-menu li a {
	display: block;
	padding: 1.2rem 1.5rem;
	font-size: 1.6rem;
	color: var(--text-secondary);
}
.dropdown-menu li a:hover {
	background-color: var(--item-hover);
	color: var(--active-color);
}
.dropdown:hover .dropdown-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* 테마 버튼 */
#theme-toggle-btn {
	position: fixed;
	top: 1.5rem;
	right: 2rem;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 50%;
	background-color: var(--button-bg);
	border: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.4rem;
	z-index: 1000;
	transition: 0.2s;
}
#theme-toggle-btn:hover {
	transform: scale(1.1);
	filter: brightness(1.1);
}

/* 메인 레이아웃 */
.main-layout {
	width: 100%;
	max-width: 1200px;
	padding: 5rem 2rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.arc-title {
	margin-bottom: 4rem;
	font-size: 3rem;
	font-weight: 800;
	text-align: center;
}

/* =========================================
   4. 아크레이더스 컴포넌트
   ========================================= */
.arc-grid-container {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	gap: 6px;
	width: 100%;
	background-color: var(--bg-page);
	border: 2px solid var(--border-color);
	padding: 8px;
}

.arc-item {
	background-color: var(--item-bg);
	border: 1px solid var(--border-color);
	padding: 10px 6px;
	min-height: 100px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	text-align: center;
	cursor: pointer;
	user-select: none;
	position: relative;
	font-size: 1.4rem;
	transition: 0.1s;
}
.arc-item:hover {
	background-color: var(--item-hover);
	transform: translateY(-3px);
	z-index: 1;
}

.arc-item.active,
.arc-item.checked {
	border-color: var(--active-color);
	background-color: var(--active-bg);
	box-shadow: 0 0 15px var(--active-glow);
}
.arc-item.active::after,
.arc-item.checked::after {
	content: "✔";
	position: absolute;
	top: 4px;
	right: 6px;
	color: var(--active-color);
	font-size: 1.6rem;
	font-weight: bold;
}

.arc-number {
	width: 100%;
	text-align: left;
	font-weight: bold;
	color: var(--text-secondary);
	font-size: 1.2rem;
	padding-left: 4px;
}
.arc-name {
	word-break: keep-all;
	line-height: 1.3;
	font-weight: 600;
}
.arc-item.unknown {
	opacity: 0.5;
	font-style: italic;
}
.arc-item.empty {
	visibility: hidden;
	pointer-events: none;
}

/* =========================================
   5. 하단 요약 섹션 (Summary) - ★ 2열 그리드 적용 ★
   ========================================= */
.summary-wrapper {
	width: 100%;
	display: flex;
	gap: 3rem;
	margin-top: 5rem;
	padding-top: 3rem;
	border-top: 2px solid var(--border-color);
}

.summary-col {
	flex: 1;
	background-color: var(--item-bg);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	padding: 2.5rem;
	min-height: 300px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.summary-header {
	font-size: 2.2rem;
	font-weight: 800;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 2px solid var(--border-color);
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: var(--text-primary);
}

.count-badge {
	background-color: var(--button-bg);
	padding: 6px 16px;
	border-radius: 30px;
	font-size: 1.6rem;
	font-weight: bold;
	color: var(--text-primary);
}

.summary-col.owned {
	border-color: var(--active-color);
}
.summary-col.owned .summary-header {
	color: var(--active-color);
}
.summary-col.owned .count-badge {
	background-color: var(--active-bg);
	color: var(--active-color);
}

/* ★★★ 여기가 수정된 부분 (2열 그리드) ★★★ */
.summary-list {
	display: grid; /* Flex -> Grid 변경 */
	grid-template-columns: repeat(2, 1fr); /* 2열로 나눔 */
	gap: 0.2rem; /* 아이템 간격 */
	/* max-height: 500px; */
	overflow-y: auto;
	padding-right: 1rem;
}

.summary-list li {
	font-size: 1.5rem; /* 글자 크기 시원하게 */
	color: var(--text-primary);
	padding: 0.4rem 0.5rem;
	/* border-radius: 8px; */
	background-color: var(--bg-page);
	border: 1px solid #a9a9a98c;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: 0.2s;
	/* 2열일 때 내용이 길면 말줄임 */
	white-space: nowrap;
	overflow: hidden;
}
.summary-list li:hover {
	background-color: var(--item-hover);
}

.summary-list li span.num {
	font-weight: bold;
	color: var(--text-secondary);
	min-width: 25px;
	margin-right: 8px;
}
.summary-list li span.name {
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	width: 100%;
	text-align: right;
}
button#mobile-close {
	display: none;
}
/* =========================================
   6. 모바일 반응형
   ========================================= */
@media (max-width: 1024px) {
	.arc-grid-container {
		grid-template-columns: repeat(5, 1fr);
	}
}

@media (max-width: 768px) {
	.site-header {
		padding: 1.5rem 2rem;
	}

	button#mobile-close {
		display: block;
	}
	#theme-toggle-btn {
		right: 6rem;
		top: 1.2rem;
		width: 4rem;
		height: 4rem;
		font-size: 2rem;
	}
	#mobile-toggle {
		display: block;
		padding: 0.5rem;
		z-index: 900;
	}
	.icon-bar {
		display: block;
		width: 28px;
		height: 3px;
		background-color: var(--text-primary);
		margin: 6px 0;
		border-radius: 2px;
	}

	.nav-links {
		position: fixed;
		top: 0;
		right: 0;
		width: 75%;
		height: 100vh;
		background-color: var(--bg-page);
		padding: 8rem 2rem;
		z-index: 999;
		box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
		transform: translateX(100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
	}
	.nav-links.active {
		transform: translateX(0);
	}
	.nav-links > ul {
		flex-direction: column;
		gap: 0;
		width: 100%;
	}
	.nav-links > ul > li {
		width: 100%;
		border-bottom: 1px solid var(--border-color);
	}
	.nav-links > ul > li > a {
		padding: 2rem 0;
		font-size: 2rem;
	}

	.dropdown-menu {
		position: static;
		box-shadow: none;
		border: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		background-color: transparent;
		padding-left: 1.5rem;
	}
	.dropdown-menu li a {
		padding: 1.5rem 0;
		font-size: 1.7rem;
		color: var(--text-secondary);
	}

	#mobile-close {
		display: block;
		position: absolute;
		top: 1.5rem;
		right: 2rem;
		font-size: 3.5rem;
		color: var(--text-primary);
		cursor: pointer;
	}

	#mobile-backdrop {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.5);
		z-index: 950;
	}
	#mobile-backdrop.active {
		display: block;
	}

	.arc-grid-container {
		grid-template-columns: repeat(3, 1fr);
		border: none;
		background: transparent;
		padding: 0;
		gap: 8px;
	}
	.arc-item {
		border-radius: 8px;
		min-height: 90px;
	}
	.arc-item.empty,
	.arc-materials-detail {
		display: none;
	}

	.arc-table th,
	.arc-table td {
		padding: 1rem;
		font-size: 1.4rem;
	}

	/* 모바일에서 요약 섹션 배치 */
	.summary-wrapper {
		flex-direction: column; /* 세로 배치 */
		gap: 2rem;
	}
	/* 모바일에서도 2열 유지 (공간 충분) */
	.summary-list {
		grid-template-columns: repeat(2, 1fr);
	}
}
