.js-hero {
	background: linear-gradient(135deg, #e0f2fe 0%, #eff6ff 47%, #f5f3ff 100%);
	min-height: 430px;
}

.js-hero-copy {
	max-width: 620px;
	z-index: 2;
}

/* ฟอนต์ไทยมีส่วนหัว/วรรณยุกต์สูง จึงต้องเผื่อระยะบรรทัดของหัวข้อฮีโร่เพิ่มขึ้น */
.js-hero-copy h1 {
	line-height: 1.35;
}

.js-hero-art {
	display: none;
	position: absolute;
	inset: 0 0 0 auto;
	width: 58%;
	height: 100%;
	object-fit: cover;
	object-position: 62% center;
	-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 25%);
	mask-image: linear-gradient(to right, transparent 0%, #000 25%);
}

.js-stat-chip {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	padding: .375rem .75rem;
	border-radius: .75rem;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
	color: #374151;
	font-size: .75rem;
	font-weight: 700;
}

.js-primary-btn,
.js-game-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 48px;
	padding: .75rem 1.25rem;
	border-radius: .75rem;
	font-weight: 800;
	transition: transform .15s ease, background-color .15s ease, color .15s ease;
}

.js-primary-btn {
	background: #4f46e5;
	color: #fff;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, .25);
}

.js-primary-btn:hover {
	background: #4338ca;
	transform: translateY(-1px);
}

.js-game-btn {
	background: #fff;
	box-shadow: 0 0 0 1px #e5e7eb;
	color: #374151;
}

.js-game-btn:hover {
	box-shadow: 0 0 0 1px #a5b4fc;
	color: #4f46e5;
	transform: translateY(-1px);
}

.js-primary-btn:focus-visible,
.js-game-btn:focus-visible,
.js-card:focus-visible {
	outline: 3px solid #c7d2fe;
	outline-offset: 3px;
}

.js-card {
	width: 100%;
	transition: transform .15s ease, box-shadow .15s ease;
}

.js-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px -12px rgba(15, 23, 42, .32);
}

.js-card-done {
	box-shadow: 0 0 0 2px #a7f3d0;
}

.js-card-art {
	height: 176px;
}

.js-card-art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.js-card:hover .js-card-art img {
	transform: scale(1.045);
}

.js-card-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(30, 27, 75, .92) 0%, rgba(30, 27, 75, .35) 62%, transparent 84%);
}

.js-card-arrow {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	flex: 0 0 auto;
	border-radius: .75rem;
	background: #eef2ff;
	color: #4f46e5;
	font-size: .75rem;
	transition: transform .15s ease, background-color .15s ease, color .15s ease;
}

.js-card:hover .js-card-arrow {
	transform: translateX(2px);
	background: #4f46e5;
	color: #fff;
}

/* สารบัญในหน้าเรียน: ป๊อปอัปกึ่งกลาง ใช้ภาษาภาพเดียวกับสารบัญในเกม
   รายการจริงทำให้หาและกดข้ามไปยังหน้าที่ต้องการได้ทันที */
.js-lesson-toc-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .375rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: .5rem .6875rem;
	border-radius: .75rem;
	background: #fff;
	color: #3730a3;
	font-size: .8125rem;
	font-weight: 800;
	line-height: 1;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.js-lesson-toc-trigger:hover {
	background: #e0e7ff;
	color: #312e81;
}

.js-lesson-toc-trigger:active {
	transform: translateY(1px);
}

.js-lesson-toc-trigger:focus-visible,
.js-lesson-toc-close:focus-visible,
.js-lesson-toc-row:focus-visible {
	outline: 3px solid #fde68a;
	outline-offset: 3px;
}

.js-lesson-toc-layer {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
	background: rgba(30, 27, 75, .58);
	backdrop-filter: blur(3px);
}

.js-lesson-toc-panel {
	width: min(100%, 35rem);
	max-height: min(88dvh, 46rem);
	display: flex;
	flex-direction: column;
	padding: .875rem .75rem .75rem;
	border-radius: 1.25rem;
	background: radial-gradient(120% 80% at 50% 0%, #4338ca 0%, #312e81 45%, #1e1b4b 100%);
	box-shadow: inset 0 0 0 1px rgba(199, 210, 254, .38), 0 7px 8px rgba(15, 23, 42, .44);
	color: #f8fafc;
	overflow: hidden;
}

.js-lesson-toc-head {
	display: flex;
	align-items: center;
	gap: .625rem;
	padding: 0 .125rem;
}

.js-lesson-toc-head-icon {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	flex: 0 0 auto;
	border-radius: .875rem;
	background: linear-gradient(180deg, #fff, #c7d2fe);
	box-shadow: 0 3px 0 rgba(49, 46, 129, .55);
	color: #312e81;
	font-size: 1.0625rem;
}

.js-lesson-toc-head h2 {
	margin: 0;
	color: #fff;
	font-size: calc(1.1875rem * var(--reading-scale, 1));
	font-weight: 900;
	line-height: 1.2;
	text-wrap: balance;
}

.js-lesson-toc-head p {
	margin: .125rem 0 0;
	color: #c7d2fe;
	font-size: calc(.8125rem * var(--reading-scale, 1));
	font-weight: 800;
	line-height: 1.45;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.js-lesson-toc-close {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	flex: 0 0 auto;
	border-radius: .75rem;
	background: rgba(255, 255, 255, .12);
	box-shadow: inset 0 0 0 1px rgba(199, 210, 254, .3);
	color: #e0e7ff;
	font-size: 1rem;
	transition: background-color .18s ease, color .18s ease;
}

.js-lesson-toc-close:hover {
	background: rgba(255, 255, 255, .2);
	color: #fff;
}

.js-lesson-toc-body {
	min-height: 0;
	flex: 1;
	display: grid;
	gap: .875rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin-top: .875rem;
	padding: .125rem .125rem .25rem;
	-webkit-overflow-scrolling: touch;
}

.js-lesson-toc-group {
	display: grid;
	gap: .5rem;
}

.js-lesson-toc-group h3 {
	display: flex;
	align-items: center;
	gap: .4375rem;
	margin: 0;
	padding: 0 .125rem;
	color: #c7d2fe;
	font-size: calc(.8125rem * var(--reading-scale, 1));
	font-weight: 900;
	line-height: 1.4;
}

.js-lesson-toc-group h3 span {
	margin-left: auto;
	padding: .0625rem .4375rem;
	border-radius: 999px;
	background: rgba(199, 210, 254, .18);
	color: #e0e7ff;
	font-size: calc(.75rem * var(--reading-scale, 1));
	font-weight: 800;
}

.js-lesson-toc-row {
	display: flex;
	align-items: center;
	gap: .625rem;
	width: 100%;
	min-height: 3rem;
	padding: .5rem .6875rem;
	border-radius: .875rem;
	background: rgba(255, 255, 255, .1);
	box-shadow: inset 0 0 0 1px rgba(199, 210, 254, .26);
	color: #fff;
	text-align: left;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.js-lesson-toc-row:hover {
	background: rgba(255, 255, 255, .18);
}

.js-lesson-toc-row:active {
	transform: scale(.99);
}

.js-lesson-toc-row.is-current {
	background: linear-gradient(180deg, rgba(251, 191, 36, .26), rgba(255, 255, 255, .1));
	box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .7);
}

.js-lesson-toc-number {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	flex: 0 0 auto;
	border-radius: .625rem;
	background: #c7d2fe;
	color: #312e81;
	font-size: calc(.8125rem * var(--reading-scale, 1));
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.js-lesson-toc-row.is-current .js-lesson-toc-number {
	background: linear-gradient(180deg, #fde68a, #f59e0b);
	color: #422006;
}

.js-lesson-toc-copy {
	min-width: 0;
	flex: 1;
}

.js-lesson-toc-copy strong,
.js-lesson-toc-copy small {
	display: block;
}

.js-lesson-toc-copy strong {
	color: #fff;
	font-size: calc(.9375rem * var(--reading-scale, 1));
	font-weight: 800;
	line-height: 1.35;
	text-wrap: pretty;
	overflow-wrap: anywhere;
}

.js-lesson-toc-copy small {
	margin-top: .125rem;
	color: #a5b4fc;
	font-size: calc(.75rem * var(--reading-scale, 1));
	font-weight: 700;
	line-height: 1.4;
	text-wrap: pretty;
}

.js-lesson-toc-current {
	flex: 0 0 auto;
	color: #fbbf24;
	font-size: 1rem;
}

@media (max-width: 420px) {
	.js-lesson-toc-layer {
		padding: .5rem;
	}

	.js-lesson-toc-panel {
		max-height: calc(100dvh - 1rem);
		padding: .75rem .625rem .625rem;
		border-radius: 1rem;
	}

	.js-lesson-toc-body {
		margin-top: .75rem;
	}
}

/* สไลด์นิยามในหน้าเรียน: ใช้สีเต็มพื้นผิวแทนแถบสีหนาทางซ้าย
   สีแต่ละประเภทคงต่างกัน แต่จัดลำดับให้อ่านเป็น หัวคำ → คำอธิบาย → ตัวอย่าง */
body.js-shell .vd-defs {
	gap: 12px;
}

body.js-shell .vd-def {
	position: relative;
	border: 0;
	border-radius: 14px;
	padding: 13px 15px 14px;
	box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .12);
}

body.js-shell .vd-def-term {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 2px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .82);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .07);
}

body.js-shell .vd-def-desc {
	margin-top: 7px;
	color: #334155;
}

body.js-shell .vd-def-ex {
	margin-top: 9px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .78);
}

body.js-shell .vd-def.t-nn,
body.js-shell .vd-def.t-pum {
	background: #eff6ff;
	box-shadow: inset 0 0 0 1px #bfdbfe;
}

body.js-shell .vd-def.t-gn {
	background: #f5f3ff;
	box-shadow: inset 0 0 0 1px #ddd6fe;
}

body.js-shell .vd-def.t-sn,
body.js-shell .vd-def.t-nap {
	background: #fff1f2;
	box-shadow: inset 0 0 0 1px #fecdd3;
}

body.js-shell .vd-def.t-it {
	background: #fdf2f8;
	box-shadow: inset 0 0 0 1px #fbcfe8;
}

body.js-shell .vd-def.t-sn .vd-def-term,
body.js-shell .vd-def.t-nap .vd-def-term {
	color: #be123c;
}

/* หัวข้อชุดการันต์บางสไลด์ใช้แถบซ้ายแบบเดียวกัน จึงปรับภาษาภาพให้ตรงกัน */
body.js-shell .vd-kset-head {
	border-left: 0;
	padding: 5px 10px;
	border-radius: 10px;
	background: #eef2ff;
}

/* หน้าจบบท: ให้ความสำเร็จ ความคืบหน้า และก้าวถัดไปอ่านเป็นลำดับเดียวกัน */
.js-completion-body {
	padding: clamp(1.5rem, 4.5vh, 3rem) clamp(1.25rem, 4vw, 3rem);
}

.js-completion-content {
	width: min(100%, 36rem);
	margin: auto;
}

.js-completion-seal {
	display: grid;
	place-items: center;
	width: 5rem;
	height: 5rem;
	margin: 0 auto;
	border-radius: 1rem;
	background: #d1fae5;
	box-shadow: inset 0 0 0 1px #a7f3d0;
	color: #059669;
	font-size: 2.35rem;
}

.js-completion-kicker {
	margin-top: 1.25rem;
	color: #047857;
	font-size: .875rem;
	font-weight: 800;
	line-height: 1.4;
}

.js-completion-title {
	margin-top: .25rem;
	color: #111827;
	font-size: 2rem;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.25;
	text-wrap: balance;
}

.js-completion-lesson {
	max-width: 36rem;
	margin: .65rem auto 0;
	color: #4b5563;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.55;
	text-wrap: pretty;
}

.js-completion-progress {
	margin-top: 1.5rem;
	padding: 1rem 1.125rem 1.125rem;
	border-radius: 1rem;
	background: #f8fafc;
	box-shadow: inset 0 0 0 1px #e0e7ff;
	text-align: left;
}

.js-completion-progress-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	color: #4b5563;
	font-size: .875rem;
	font-weight: 700;
}

.js-completion-progress-head strong {
	color: #3730a3;
	font-size: 1.125rem;
	font-weight: 800;
}

.js-completion-progress-track {
	height: .625rem;
	margin-top: .625rem;
	overflow: hidden;
	border-radius: 999px;
	background: #e5e7eb;
}

.js-completion-progress-track > div {
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #fbbf24, #10b981);
	transition: width .5s ease;
}

.js-completion-next {
	margin-top: 1rem;
	padding: 1.125rem 1.25rem;
	border-radius: 1rem;
	background: #eef2ff;
	box-shadow: inset 0 0 0 1px #c7d2fe;
	text-align: left;
}

.js-completion-next p {
	margin: 0;
	color: #4338ca;
	font-size: .8125rem;
	font-weight: 800;
	line-height: 1.4;
}

.js-completion-next h4 {
	margin: .25rem 0 0;
	color: #1e1b4b;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
}

.js-completion-next span {
	display: block;
	margin-top: .35rem;
	color: #4f46e5;
	font-size: .9375rem;
	font-weight: 700;
	line-height: 1.45;
}

.js-completion-all-done {
	margin: 1.5rem 0 0;
	color: #047857;
	font-size: 1rem;
	font-weight: 800;
}

.js-completion-actions {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: .75rem;
	padding: 1rem;
	border-top: 1px solid #f3f4f6;
}

.js-completion-primary,
.js-completion-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .625rem;
	min-height: 3.25rem;
	border-radius: .75rem;
	font-size: 1rem;
	font-weight: 800;
	transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.js-completion-primary {
	padding: .75rem 1.25rem;
	background: #4f46e5;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, .25);
	color: #fff;
}

.js-completion-primary:hover {
	background: #4338ca;
	transform: translateY(-1px);
}

.js-completion-secondary {
	padding: .75rem 1rem;
	background: #fff;
	box-shadow: inset 0 0 0 1px #c7d2fe;
	color: #4338ca;
}

.js-completion-secondary:hover {
	background: #eef2ff;
}

.js-completion-primary:focus-visible,
.js-completion-secondary:focus-visible {
	outline: 3px solid #c7d2fe;
	outline-offset: 3px;
}

@media (min-width: 768px) {
	.js-hero-art {
		display: block;
	}

	.js-hero-copy {
		width: 58%;
	}
}

@media (max-width: 767px) {
	.js-hero {
		min-height: 0;
		padding-top: 190px;
	}

	.js-hero::before {
		content: "";
		position: absolute;
		inset: 0 0 auto;
		height: 190px;
		background:
			linear-gradient(to bottom, transparent 55%, #eaf4ff 100%),
			url("/assets/game/journey-study/hero.jpg?v=20260801.6") 64% 42% / cover no-repeat;
	}
}

@media (max-width: 520px) {
	.js-completion-body {
		padding: 1.5rem 1rem;
	}

	.js-completion-seal {
		width: 4.25rem;
		height: 4.25rem;
		font-size: 2rem;
	}

	.js-completion-title {
		font-size: 1.625rem;
	}

	.js-completion-lesson {
		font-size: .9375rem;
	}

	.js-completion-progress,
	.js-completion-next {
		padding: 1rem;
	}

	.js-completion-next h4 {
		font-size: 1.125rem;
	}

	.js-completion-actions {
		grid-template-columns: 1fr;
		padding: .75rem;
	}

	.js-completion-secondary {
		min-height: 3rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.js-primary-btn,
	.js-game-btn,
	.js-card,
	.js-card-art img,
	.js-card-arrow,
	.js-lesson-toc-trigger,
	.js-lesson-toc-close,
	.js-lesson-toc-row,
	.js-completion-primary,
	.js-completion-secondary,
	.js-completion-progress-track > div {
		transition: none;
	}
}
