@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Myanmar:wght@400;600;700&family=Inter:wght@400;600;700&display=swap');

:root {
	--bg: #f6f3ee;
	--surface: #ffffff;
	--text: #1d1b19;
	--muted: #6d665e;
	--line: #e7e1d8;
	--accent: #0b6e4f;
	--accent-text: #ffffff;
	--accent-soft: #e2f1eb;
	--warn: #a2501b;
	--radius: 18px;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.06);
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141311;
		--surface: #1f1d1a;
		--text: #f2eee8;
		--muted: #a49c91;
		--line: #34302b;
		--accent: #3fbf8f;
		--accent-text: #0a1f17;
		--accent-soft: #173229;
		--warn: #f0a46b;
		--shadow: none;
	}
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.55 'Inter', 'Noto Sans Myanmar', system-ui, sans-serif;
}

:lang(my) body, html[lang="my"] body { line-height: 1.8; }

a { color: var(--accent); }

main {
	max-width: 960px;
	margin: 0 auto;
	padding: 20px 16px 64px;
}

header.top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

header.top img { width: 44px; height: 44px; border-radius: 10px; }
header.top .name { font-weight: 700; font-size: 18px; }
header.top .spacer { flex: 1; }

.lang {
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	border-radius: 999px;
	padding: 6px 12px;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.hero { margin: 24px 0 20px; }
.hero h1 { font-size: clamp(26px, 6vw, 36px); line-height: 1.25; margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); }

.wallets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wallets span {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 14px;
	font-weight: 600;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 16px;
}

.pack {
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--line);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.pack .previews {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 78%;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 12px;
	background: var(--bg);
	scrollbar-width: none;
}
.pack .previews::-webkit-scrollbar { display: none; }
.pack .previews img {
	width: 100%;
	aspect-ratio: 390 / 274;
	object-fit: cover;
	border-radius: 10px;
	scroll-snap-align: start;
	background: var(--line);
}

.pack .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pack h2 { font-size: 18px; margin: 0; }
.pack p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.pack .buy { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 12px; }
.pack .price { font-weight: 700; font-size: 18px; }

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--accent-soft);
	color: var(--accent);
	border-radius: 999px;
	padding: 6px 12px;
	font-weight: 600;
	font-size: 14px;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	border-radius: 12px;
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	min-height: 44px;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.large { width: 100%; padding: 14px 18px; font-size: 17px; }
.button:disabled { opacity: 0.5; cursor: default; }

.section { margin-top: 40px; }
.section h2 { font-size: 20px; margin: 0 0 12px; }
.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: var(--shadow);
}
.owned-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

footer { margin-top: 48px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 16px; }

/* Checkout sheet */

dialog.sheet {
	border: none;
	padding: 0;
	background: var(--surface);
	color: var(--text);
	border-radius: 22px;
	width: min(440px, calc(100vw - 24px));
	max-height: calc(100dvh - 24px);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.3);
}
dialog.sheet::backdrop { background: rgb(0 0 0 / 0.45); }
@media (max-width: 520px) {
	dialog.sheet {
		margin: auto 0 0;
		width: 100vw;
		max-width: 100vw;
		border-radius: 22px 22px 0 0;
	}
}

.sheet .inner { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.sheet .head { display: flex; align-items: start; gap: 12px; }
.sheet .head h2 { margin: 0; font-size: 19px; flex: 1; }
.sheet .close {
	border: none; background: var(--bg); color: var(--text);
	width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; flex: none;
}
.sheet .amount { font-size: 28px; font-weight: 700; }

.qr-frame {
	align-self: center;
	background: #fff;
	padding: 12px;
	border-radius: 16px;
	border: 1px solid var(--line);
}
img.qr { display: block; width: min(260px, 70vw); height: auto; image-rendering: pixelated; }
img.qr.small { width: 180px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 12px; }

.steps { margin: 0; padding-left: 22px; color: var(--muted); font-size: 15px; }
.steps li { margin: 4px 0; }

.status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.status.warn { color: var(--warn); }

.spinner {
	width: 18px; height: 18px; border-radius: 50%;
	border: 2.5px solid var(--line); border-top-color: var(--accent);
	animation: spin 0.9s linear infinite; flex: none;
}
.handoff .spinner { margin: 12px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.paid { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.paid .check {
	width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 0;
	background: var(--accent-soft); color: var(--accent);
	display: grid; place-items: center; font-size: 34px; font-weight: 700;
}
.paid h3 { margin: 0; font-size: 21px; }

.handoff { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.fine { margin: 0; color: var(--muted); font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field input {
	font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px;
	border: 1px solid var(--line); background: var(--bg); color: var(--text);
}

.error { color: var(--warn); font-size: 14px; margin: 0; }
.center { text-align: center; }
.skeleton { height: 340px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); opacity: 0.6; }

.link-button {
	border: none; background: none; color: var(--accent); font: inherit; font-size: 14px;
	text-decoration: underline; cursor: pointer; padding: 6px; align-self: center;
}
