/* เพื่อนบ้านแสนดี: the game's look on the web (src/first/Kit.luau): the sky and the row of little houses, chunky
   buttons with a thick dark outline and a darker lip, frosted glass, white words with a dark outline, Kanit. */
:root {
	--ink: #1c1830;
	--sky-top: #549cff;
	--sky-bottom: #a4deff;
	--town-a: #78b6fa;
	--town-b: #6aaaf6;
	--navy: #2458be;
	--text: #22304f;
	--muted: #4d5d7e;
	--paper: #f3f9ff;
	--green: #60de5c; --green-lip: #228c3a;
	--blue: #54acff; --blue-lip: #245cc4;
	--yellow: #ffd240; --yellow-lip: #ce8014;
	--pink: #ff78ba; --pink-lip: #ba3276;
	--purple: #aa78ff; --purple-lip: #6038be;
	--red: #f65860; --red-lip: #a02438;
	--coral: #ff9648; --coral-lip: #c44e20;
	--grey: #b0b6c6; --grey-lip: #646a7e;
	--r: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
	font-weight: 400;
	color: var(--text);
	background: var(--paper);
	line-height: 1.55;
	overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
html[data-lang="th"] [lang="en"], html[data-lang="en"] [lang="th"] { display: none !important; }
.wrap { width: min(1160px, 100% - 32px); margin: 0 auto; }

/* white words with a thick dark outline, as in the game */
.word {
	font-weight: 900;
	color: #fff;
	letter-spacing: 0.2px;
	text-shadow:
		3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
		2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
		0 6px 0 var(--ink);
}

/* ---------- the bar ---------- */
.bar {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; gap: 12px;
	padding: 10px max(16px, calc((100% - 1160px) / 2));
	background: rgba(84, 156, 255, 0.72);
	backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	border-bottom: 2px solid rgba(255, 255, 255, 0.55);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; min-width: 0; }
.nb { white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 11px; border: 3px solid var(--ink); }
.brand .word { font-size: 21px; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 3px 0 var(--ink); }
.sp { flex: 1; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.28); border: 2px solid rgba(255, 255, 255, 0.6); }
.lang button {
	font: 700 14px "Kanit", sans-serif; color: #fff; background: transparent; border: 0; padding: 4px 11px;
	border-radius: 999px; cursor: pointer;
}
html[data-lang="th"] .lang [data-l="th"], html[data-lang="en"] .lang [data-l="en"] { background: var(--ink); }

/* ---------- chunky buttons ---------- */
.btn {
	--face: var(--green); --lip: var(--green-lip);
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	font: 800 20px/1.1 "Kanit", sans-serif; color: #fff; text-decoration: none; white-space: nowrap; cursor: pointer;
	padding: 14px 26px 19px;
	border: 4px solid var(--ink); border-radius: 22px;
	background: var(--face);
	box-shadow: inset 0 -7px 0 var(--lip), 0 5px 0 var(--ink);
	text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 3px 0 var(--ink);
	transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
	-webkit-tap-highlight-color: transparent;
}
.btn::before { /* the gloss */
	content: ""; position: absolute; left: 8px; right: 8px; top: 5px; height: 34%;
	border-radius: 14px; background: rgba(255, 255, 255, 0.28); pointer-events: none;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 -4px 0 var(--lip), 0 1px 0 var(--ink); }
.btn .ico { width: 1.15em; height: 1.15em; fill: #fff; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; filter: drop-shadow(0 2px 0 var(--ink)); }
.btn--green { --face: var(--green); --lip: var(--green-lip); }
.btn--xl { font-size: 26px; padding: 18px 34px 24px; border-radius: 26px; }
.btn--sm { font-size: 16px; padding: 7px 16px 11px; border-radius: 16px; border-width: 3px; box-shadow: inset 0 -5px 0 var(--lip), 0 3px 0 var(--ink); }
.btn--sm::before { top: 4px; left: 6px; right: 6px; border-radius: 10px; }
.btn--dark { --face: #34405e; --lip: #1d2540; }
.btn--glass {
	--lip: rgba(28, 24, 48, 0.18);
	background: rgba(255, 255, 255, 0.24);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border-color: rgba(255, 255, 255, 0.85);
	box-shadow: inset 0 -6px 0 var(--lip), 0 4px 0 rgba(28, 24, 48, 0.35);
}
.btn--glass::before { background: rgba(255, 255, 255, 0.2); }

/* ---------- the sky (hero, last call) ---------- */
.sky { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); }
.clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud {
	position: absolute; left: 0; width: 160px; height: 56px; border-radius: 999px; background: #fff; opacity: 0.88;
	animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 70px; height: 70px; left: 26px; top: -34px; }
.cloud::after { width: 54px; height: 54px; left: 82px; top: -22px; }
@keyframes drift { from { transform: translateX(-260px) scale(var(--s, 1)); } to { transform: translateX(calc(100vw + 260px)) scale(var(--s, 1)); } }
.town { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; }
.house { position: absolute; bottom: 0; }
.house::before { /* the roof: a square on its corner, as in the game */
	content: ""; position: absolute; left: 50%; top: 0; width: 72%; aspect-ratio: 1; background: inherit;
	transform: translate(-50%, -50%) rotate(45deg); border-radius: 5px;
}

.hero { padding: 44px 0 140px; min-height: min(820px, 100vh); }
.hero__in { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.logo { width: min(560px, 100%); height: auto; filter: drop-shadow(0 10px 0 rgba(28, 24, 48, 0.18)); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-0.6deg); } }
.hero h1 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.25; margin: 18px 0 12px; }
.lead { color: #fff; font-size: clamp(17px, 1.5vw, 20px); font-weight: 500; max-width: 560px; text-shadow: 0 2px 0 rgba(28, 24, 48, 0.5), 0 0 12px rgba(36, 88, 190, 0.45); }
.cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 26px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 22px 0 0; list-style: none; }
.pills li {
	font-weight: 700; font-size: 15px; color: #fff; padding: 5px 14px; border-radius: 999px;
	background: rgba(36, 88, 190, 0.55); border: 2px solid rgba(255, 255, 255, 0.7);
}
.hero__shot { position: relative; }
.frame {
	border: 5px solid var(--ink); border-radius: 26px; overflow: hidden; background: #fff;
	box-shadow: 0 0 0 5px #fff inset, 0 10px 0 var(--ink), 0 24px 50px rgba(28, 24, 48, 0.25);
}
.frame img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.tilt { transform: rotate(2.2deg); }
.topic {
	position: absolute; left: -26px; bottom: -34px; max-width: 330px;
	background: #fff; color: var(--text); border: 4px solid var(--ink); border-radius: 20px; padding: 12px 16px 14px;
	box-shadow: 0 6px 0 var(--ink); font-weight: 500; font-size: 16px; line-height: 1.4;
}
.topic b {
	display: inline-block; font-weight: 800; font-size: 13px; color: #fff; background: var(--navy);
	border-radius: 999px; padding: 1px 10px; margin-bottom: 6px;
}
.topic span { display: block; }
.found {
	position: absolute; right: -10px; top: -22px; display: flex; align-items: center; gap: 8px;
	font-weight: 800; font-size: 16px; color: #fff; background: var(--green); border: 4px solid var(--ink);
	border-radius: 999px; padding: 6px 16px 8px; box-shadow: inset 0 -5px 0 var(--green-lip), 0 5px 0 var(--ink);
	text-shadow: 0 2px 0 var(--ink);
}
.found .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.float { animation: float 4.5s ease-in-out infinite; }
.float--2 { animation-delay: -2s; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- sections ---------- */
.sec { padding: 76px 0; }
.sec--light { background: var(--paper); }
.sec--sky { background: linear-gradient(180deg, #d7eeff, #bfe3ff); }
.sec h2 { font-size: clamp(30px, 4vw, 46px); text-align: center; line-height: 1.2; }
.sub { text-align: center; color: var(--muted); font-size: 18px; margin-top: 10px; }

.card {
	position: relative; background: #fff; border: 4px solid var(--ink); border-radius: var(--r);
	box-shadow: 0 7px 0 var(--ink); padding: 26px 22px 24px;
}
.card h3 { font-weight: 800; font-size: 22px; color: var(--ink); margin: 6px 0 6px; line-height: 1.3; }
.card p { color: var(--muted); font-size: 16px; }
.n {
	position: absolute; top: -22px; left: 18px; width: 46px; height: 46px; display: grid; place-items: center;
	font-weight: 900; font-size: 24px; color: #fff; background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%;
	box-shadow: inset 0 -5px 0 var(--yellow-lip); text-shadow: 0 2px 0 var(--ink);
}
.steps { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.art {
	width: 76px; height: 76px; border-radius: 20px; border: 4px solid var(--ink); display: grid; place-items: center; margin: 6px 0 10px;
	box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18);
}
.art svg { width: 46px; height: 46px; fill: #fff; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.art--green { background: var(--green); }
.art--blue { background: var(--blue); }
.art--yellow { background: var(--yellow); }

.places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.place {
	background: #fff; border: 4px solid var(--ink); border-radius: var(--r); overflow: hidden;
	box-shadow: 0 7px 0 var(--ink); transition: transform 0.18s ease;
}
.place:hover { transform: translateY(-4px) rotate(-0.4deg); }
.pic { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 4px solid var(--ink); background: #cfe6f7; }
.pic img, .pic svg { width: 100%; height: 100%; object-fit: cover; }
.txt { padding: 14px 18px 18px; }
.txt h3 { font-weight: 800; font-size: 21px; color: var(--ink); line-height: 1.3; }
.where { color: var(--muted); font-size: 15px; margin-top: 4px; }

.tiles { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tile {
	--face: var(--blue); --lip: var(--blue-lip);
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px;
	min-height: 168px; padding: 18px 12px 20px; border: 4px solid var(--ink); border-radius: 22px; background: var(--face);
	box-shadow: inset 0 -8px 0 var(--lip), 0 6px 0 var(--ink); text-align: center;
	transition: transform 0.15s ease;
}
.tile::before { content: ""; position: absolute; left: 8px; right: 8px; top: 6px; height: 30%; border-radius: 14px; background: rgba(255, 255, 255, 0.22); }
.tile:hover { transform: translateY(-3px) scale(1.02); }
.tile svg { width: 74px; height: 74px; fill: #fff; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; flex: 1; }
.tile b { font-weight: 800; font-size: 18px; color: #fff; line-height: 1.25; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 3px 0 var(--ink); }
.tile--red { --face: var(--red); --lip: var(--red-lip); }
.tile--green { --face: var(--green); --lip: var(--green-lip); }
.tile--blue { --face: var(--blue); --lip: var(--blue-lip); }
.tile--pink { --face: var(--pink); --lip: var(--pink-lip); }
.tile--yellow { --face: var(--yellow); --lip: var(--yellow-lip); }
.tile--purple { --face: var(--purple); --lip: var(--purple-lip); }
.tile--coral { --face: var(--coral); --lip: var(--coral-lip); }
.tile--grey { --face: var(--grey); --lip: var(--grey-lip); }

.feats { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.glass {
	background: rgba(255, 255, 255, 0.55); border: 3px solid rgba(255, 255, 255, 0.95); border-radius: var(--r);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	box-shadow: 0 10px 30px rgba(36, 88, 190, 0.12); padding: 20px 22px;
}
.glass h3 { font-weight: 800; font-size: 20px; color: var(--ink); }
.glass p { color: var(--muted); font-size: 16px; margin-top: 4px; }

.steps--start .card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 34px; }
.steps--start .card .btn { margin-top: 12px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tips { list-style: none; padding: 0; margin: 36px auto 0; max-width: 760px; display: grid; gap: 10px; }
.tips li { position: relative; padding: 10px 16px 10px 48px; background: #fff; border: 3px solid #cfe1f5; border-radius: 16px; color: var(--muted); }
.tips li::before {
	content: ""; position: absolute; left: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 7px;
	background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
	border: 2px solid var(--ink);
}

.rules { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rule {
	--face: var(--green); --lip: var(--green-lip);
	padding: 18px 12px 22px; text-align: center; border: 4px solid var(--ink); border-radius: 20px; background: var(--face);
	box-shadow: inset 0 -7px 0 var(--lip), 0 5px 0 var(--ink);
}
.rule b { font-weight: 800; font-size: 20px; color: #fff; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 3px 0 var(--ink); }
.rule--blue { --face: var(--blue); --lip: var(--blue-lip); }
.rule--pink { --face: var(--pink); --lip: var(--pink-lip); }
.rule--yellow { --face: var(--yellow); --lip: var(--yellow-lip); }

.end { padding: 90px 0 170px; text-align: center; }
.end__in { position: relative; z-index: 2; }
.end h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.25; }
.end .cta { justify-content: center; margin-top: 30px; }

.foot { background: var(--ink); color: #c9d3ea; padding: 26px 0 34px; text-align: center; }
.foot a { color: #fff; font-weight: 700; text-decoration: none; }
.foot .small { font-size: 13px; margin-top: 6px; opacity: 0.75; }

.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 60;
	background: var(--ink); color: #fff; font-weight: 700; padding: 10px 20px; border-radius: 999px;
	transition: transform 0.25s ease, opacity 0.25s; pointer-events: none; opacity: 0;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
	.hero__in { grid-template-columns: 1fr; gap: 54px; }
	.hero__copy { text-align: center; }
	.logo { margin: 0 auto; }
	.lead { margin: 0 auto; }
	.cta, .pills { justify-content: center; }
	.hero__shot { max-width: 620px; margin: 0 auto 30px; }
	.places, .feats { grid-template-columns: repeat(2, 1fr); }
	.tiles { grid-template-columns: repeat(4, 1fr); }
	.steps { grid-template-columns: 1fr; gap: 34px; max-width: 620px; margin-left: auto; margin-right: auto; }
	.rules { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.bar { gap: 8px; }
	.brand .word { font-size: 15px; }
	.hero h1 { font-size: 27px; }
	.brand img { width: 34px; height: 34px; }
	.hero { padding-top: 26px; }
	.btn--xl { font-size: 22px; padding: 15px 26px 21px; }
	.places, .feats { grid-template-columns: 1fr; }
	.tiles { grid-template-columns: repeat(2, 1fr); gap: 14px; }
	.tile { min-height: 144px; }
	.tile svg { width: 54px; height: 54px; }
	.topic { left: 6px; right: 6px; max-width: none; bottom: -46px; font-size: 15px; }
	.found { right: 6px; top: -20px; font-size: 14px; }
	.sec { padding: 60px 0; }
	.town { height: 90px; }
}
@media (max-width: 350px) {
	.brand .word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	html { scroll-behavior: auto; }
}
