/* =========================================================
   Prologue · 약관 → 접속 안내 → 콘텐츠 → 시작
   ========================================================= */

body.prologue {
	background: #05070c;
}

#panorama {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	filter: saturate(1.05) brightness(0.62);
	background: #0d1420 url("/assets/mc/sky_0.jpg") center / cover;
}

.void {
	position: fixed;
	inset: 0;
	background:
		radial-gradient(ellipse at 50% 20%, rgba(20, 40, 80, 0.35), transparent 60%),
		linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.72));
	pointer-events: none;
}

.snow {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}

/* ---------------------------------------------------------
   타이틀
   --------------------------------------------------------- */
.title-screen {
	position: relative;
	z-index: 3;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 20px;
	text-align: center;
}

.title-logo {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 6px;
}
.title-logo img.mark {
	width: clamp(56px, 9vw, 88px);
	height: clamp(56px, 9vw, 88px);
	filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.55));
}
.title-logo h1 {
	font-family: var(--font-display);
	font-size: clamp(48px, 9vw, 96px);
	font-weight: 400;
	letter-spacing: 2px;
	color: #fff;
	text-shadow:
		4px 4px 0 #8e1b22,
		8px 8px 0 rgba(0, 0, 0, 0.45);
	animation: title-in 0.8s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes title-in {
	from { transform: scale(1.4); opacity: 0; }
}
.title-logo h1 b { font-weight: 400; color: #ff5a5f; }

.splash {
	position: relative;
	margin-bottom: 22px;
	font-size: 15px;
	color: var(--mc-yellow);
	text-shadow: 2px 2px 0 #3f3f00;
	transform: rotate(-2deg);
	animation: splash 0.5s infinite alternate steps(2);
}
@keyframes splash {
	to { scale: 1.04; rotate: 1deg; }
}

.title-sub {
	margin-bottom: 26px;
	font-size: 14px;
	color: #b9c6dd;
	text-shadow: 2px 2px 0 #000;
}

.title-menu {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: min(380px, 100%);
}

.title-footer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	padding: 0 20px;
	font-size: 11px;
	color: #8b96a8;
}
.title-footer a { color: #cfd8e6; text-decoration: underline; }

/* ---------------------------------------------------------
   모달 / 스테이지
   --------------------------------------------------------- */
.stage-wrap {
	position: relative;
	z-index: 5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	padding: 24px 16px 40px;
}

.stage-head {
	display: flex;
	align-items: center;
	gap: 14px;
	width: min(980px, 100%);
	margin: 0 auto 16px;
}
.stage-head .logo { font-size: 17px; }
.stage-head .logo img { width: 24px; height: 24px; }
.stage-steps {
	display: flex;
	gap: 6px;
	margin-left: auto;
	flex-wrap: wrap;
}
.stage-step {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	font-size: 11px;
	color: #8792a6;
	background: rgba(0, 0, 0, 0.55);
	border: 2px solid #000;
}
.stage-step i {
	display: grid;
	place-items: center;
	width: 16px;
	height: 16px;
	font-style: normal;
	font-size: 10px;
	background: #2c3444;
	color: #cfd8e6;
}
.stage-step.is-done { color: #a9d6b0; }
.stage-step.is-done i { background: var(--mc-green); color: #062008; }
.stage-step.is-active { color: #fff; }
.stage-step.is-active i { background: var(--mc-gold); color: #2a1c00; }

.stage {
	width: min(980px, 100%);
	margin: 0 auto;
	animation: stage-in 0.35s ease;
}
@keyframes stage-in {
	from { opacity: 0; transform: translateY(12px); }
}

/* 약관 단계 */
.terms-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: min(58vh, 560px);
	overflow-y: auto;
	padding-right: 6px;
}
.terms-item {
	padding: 14px 16px;
	background: rgba(0, 0, 0, 0.45);
	border: 2px solid #000;
}
.terms-item__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.terms-item__head b {
	font-size: 15px;
	font-weight: 400;
	color: #fff;
}
.terms-item__head span {
	margin-left: auto;
	font-size: 11px;
	color: var(--mc-yellow);
}
.terms-item p {
	font-size: 12.5px;
	color: #aeb8c9;
	line-height: 1.75;
	max-height: 92px;
	overflow-y: auto;
	padding-right: 6px;
	white-space: pre-line;
}
.terms-agree {
	display: flex;
	align-items: center;
	gap: 12px;
}
.terms-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	margin-top: 4px;
	border-top: 2px solid rgba(255, 255, 255, 0.08);
}

/* 접속 안내 단계 */
.connect-grid {
	display: grid;
	grid-template-columns: 1.25fr 0.75fr;
	gap: 16px;
}
.connect-steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}
.connect-step {
	display: flex;
	gap: 12px;
	padding: 12px;
	background: rgba(0, 0, 0, 0.35);
	border: 2px solid #000;
}
.connect-step .num {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	background: #2f3b4f;
	color: #fff;
	border: 2px solid #000;
}
.connect-step h4 { font-weight: 400; font-size: 15px; color: #fff; }
.connect-step p { font-size: 12.5px; color: #aeb8c9; margin-top: 2px; }

.address-card {
	position: relative;
	padding: 16px;
	margin-top: 12px;
	background: rgba(0, 0, 0, 0.55);
	border: 3px solid #000;
	box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.07);
}
.address-card__label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	color: var(--mc-gray);
}
.address-card__value {
	margin-top: 8px;
	font-size: 22px;
	color: var(--mc-green);
	text-shadow: 2px 2px 0 #002a00;
	letter-spacing: 1px;
	word-break: break-all;
}
.address-card--locked .address-card__value {
	color: #b9a06a;
	text-shadow: 2px 2px 0 #2a2100;
}
.address-card__hint {
	margin-top: 8px;
	font-size: 12px;
	color: #aeb8c9;
}

.reveal-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 20px;
	margin-top: 12px;
	text-align: center;
	background: rgba(0, 0, 0, 0.5);
	border: 2px dashed #3d4a60;
}
.reveal-box img { width: 44px; height: 44px; }
.reveal-box b { font-size: 28px; font-weight: 400; color: var(--mc-yellow); text-shadow: 3px 3px 0 #3f2f00; }

/* 콘텐츠(책) 단계 */
.book-stage {
	display: grid;
	grid-template-columns: 54px minmax(0, 1fr) 54px;
	align-items: center;
	gap: 16px;
	width: min(100%, 1180px);
	min-width: 0;
	margin-inline: auto;
}
.page-turn {
	position: relative;
	width: 54px;
	height: 84px;
	background: rgba(0, 0, 0, 0.55);
	border: 2px solid #000;
	image-rendering: pixelated;
}
.page-turn::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	translate: -50% -50%;
	width: 0;
	height: 0;
	border-block: 14px solid transparent;
}
.page-turn.prev::before { border-right: 18px solid #e8e0c8; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.page-turn.next::before { border-left: 18px solid #e8e0c8; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.page-turn:hover:not(:disabled)::before { border-right-color: #fff; border-left-color: #fff; }
.page-turn:disabled { opacity: 0.25; cursor: default; }

.book {
	position: relative;
	width: min(100%, 56svh, 440px);
	aspect-ratio: 0.81;
	min-width: 0;
	margin: 0 auto;
	background: url("../assets/mc/book.png") no-repeat 18.2% 1.3% / auto 142.2%;
	image-rendering: pixelated;
	filter: drop-shadow(0 14px 0 rgba(0, 0, 0, 0.35));
}
.book__spread {
	position: absolute;
	inset: 10% 9%;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 1% 2%;
	font-family: var(--font);
	color: #2c2010;
	box-sizing: border-box;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}
.book__page {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	width: 100%;
	padding: 0 4px;
	box-sizing: border-box;
}
.book__page--left {
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	gap: 4px;
	flex: 0 0 auto;
}
.book__page--right {
	flex: 1 1 0;
	font-size: clamp(12px, 1.15vw, 14px);
	line-height: 1.6;
	overflow-y: auto;
	overflow-x: hidden;
	overflow-wrap: break-word;
	word-break: keep-all;
	scrollbar-width: none;
}
.book__page--right::-webkit-scrollbar { display: none; }

.book__icon {
	width: clamp(48px, 6vw, 68px);
	height: clamp(48px, 6vw, 68px);
	object-fit: contain;
	image-rendering: pixelated;
	filter: drop-shadow(0 4px 0 rgba(80, 55, 25, 0.35));
}
.book__no {
	font-size: 11px;
	letter-spacing: 2px;
	color: #9a7b55;
}
.book__title {
	max-width: 100%;
	font-size: clamp(18px, 2vw, 24px);
	color: #1f1508;
	line-height: 1.3;
	overflow-wrap: break-word;
	word-break: keep-all;
}
.book__cat {
	padding: 1px 8px;
	font-size: 10px;
	color: #6b4a22;
	border: 1px solid #b89b6e;
	background: rgba(180, 150, 100, 0.18);
}
.book__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin-top: 2px;
}
.book__tags span {
	padding: 1px 6px;
	font-size: 10px;
	color: #4a3318;
	background: rgba(120, 90, 40, 0.16);
	border: 1px solid rgba(120, 90, 40, 0.3);
}
.book__body {
	width: 100%;
	min-width: 0;
	margin-top: 4px;
	overflow-wrap: break-word;
	word-break: keep-all;
}
.book__body p + p { margin-top: 8px; }
.book__body b { color: #8a1f1f; font-weight: 400; }
.book__pageno {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: auto;
	padding-top: 8px;
	font-size: 10px;
	color: #9a7b55;
}
.book-progress {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 14px;
	flex-wrap: wrap;
}
.book-progress i {
	width: 14px;
	height: 6px;
	background: #2b3342;
	border: 1px solid #000;
}
.book-progress i.is-read { background: var(--mc-green); }
.book-progress i.is-current { background: var(--mc-gold); }

.book-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
	flex-wrap: wrap;
}

/* 마지막 단계 */
.final-card {
	text-align: center;
	padding: 40px 24px;
}
.final-card .big-check {
	width: 72px;
	height: 72px;
	margin: 0 auto 12px;
	object-fit: contain;
}
.final-card h2 {
	font-size: 26px;
	font-weight: 400;
	color: #fff;
	text-shadow: 3px 3px 0 #1f5c2a;
	margin-bottom: 8px;
}
.final-card p { color: #b9c6dd; }
.final-info {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 24px auto;
	max-width: 640px;
}
.final-info div {
	padding: 12px;
	background: rgba(0, 0, 0, 0.4);
	border: 2px solid #000;
}
.final-info b { display: block; font-size: 17px; font-weight: 400; color: var(--mc-yellow); }
.final-info small { font-size: 11px; color: #8b96a8; }

/* 반응형 */
@media (max-width: 860px) {
	.connect-grid { grid-template-columns: 1fr; }
	.stage-wrap { padding: 12px 12px 16px; }
	.stage-head { margin-bottom: 8px; }
	.book-stage {
		grid-template-columns: 34px minmax(0, 1fr) 34px;
		gap: 8px;
		width: min(100%, 760px);
		margin-inline: auto;
	}
	.page-turn { width: 34px; height: 52px; }
	.page-turn.prev::before { border-right-width: 13px; border-top-width: 10px; border-bottom-width: 10px; }
	.page-turn.next::before { border-left-width: 13px; border-top-width: 10px; border-bottom-width: 10px; }
	.book {
		width: min(100%, 56svh, 440px);
		min-height: 0;
		box-sizing: border-box;
		filter: none;
	}
	.book__spread { padding: clamp(6px, 2vh, 12px) 2%; gap: 6px; }
	.book__page--left { gap: 5px; }
	.book__page--right { min-height: 0; }
	.book-progress { margin-top: 8px; }
	.book-bar { margin-top: 10px; }
}

@media (max-width: 560px) {
	.title-logo { gap: 8px; }
	.title-footer { position: static; margin-top: 28px; flex-direction: column; align-items: center; }
	.terms-bar { flex-direction: column; align-items: stretch; }
	.final-info { grid-template-columns: 1fr; }
	.stage-step span { display: none; }
	.book-stage { grid-template-columns: 28px minmax(0, 1fr) 28px; gap: 6px; }
	.page-turn { width: 28px; height: 48px; }
	.book {
		width: min(100%, 60svh, 440px);
		min-height: 0;
	}
	.book__spread { padding: clamp(6px, 2vh, 10px) 2%; }
	.book__page--right { font-size: clamp(12px, 3.2vw, 13px); line-height: 1.5; }
	.book-progress { margin-top: 6px; }
	.book-bar { gap: 8px; }
}
