/* Mud Cloth Stamp style.css. Afrohemian tokens, copied from /assets/css/style.css (do not change them). */
:root {
	--cream: #F6EEE2; --sand: #E9D8C0; --terra: #B5522B; --terra2: #8F3E1E; --ochre: #C98A2E; --green: #2E4A33; --ink: #2A1E17;
	--serif: "Cormorant Garamond", Georgia, serif; --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: 16px;
	/* the dark mud ground is the brand ink, so no new hex value is added */
	--mud: var(--ink);
	--ink2: rgba(42, 30, 23, .74);
	--line: rgba(42, 30, 23, .22);
	--gs: min(calc(100vw - 32px), calc(100vh - 372px), 340px);
	--isokit-line: rgba(42, 30, 23, .3); --isokit-ink: #2A1E17; --isokit-paper: #F6EEE2;
}
@supports (height: 100svh) { :root { --gs: min(calc(100vw - 32px), calc(100svh - 372px), 340px); } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink);
	font: 400 17px/1.65 var(--sans); overflow-x: hidden;
	padding-bottom: env(safe-area-inset-bottom);
}
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--ink); }
.noscript { padding: 24px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }

/* top bar */
.top {
	display: flex; align-items: center; gap: 6px; min-height: 52px;
	padding: 4px 12px; padding-top: max(4px, env(safe-area-inset-top));
	border-bottom: 1px solid var(--line);
}
.back { flex: 1; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; font-size: 15px; text-decoration: none; color: var(--terra2); font-weight: 500; white-space: nowrap; overflow: hidden; }
.top-r { display: flex; gap: 5px; }
.chip {
	min-height: 44px; min-width: 44px; padding: 0 9px; border-radius: 999px;
	border: 1.5px solid var(--line); background: transparent; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--sand); }
.land { display: none; margin: 0; padding: 6px var(--gutter); font-size: 14px; text-align: center; background: var(--sand); }
@media (orientation: landscape) and (max-height: 500px) { .land { display: block; } }

/* layout */
.app { padding: 0 var(--gutter); max-width: 760px; margin: 0 auto; }
.head { text-align: center; padding: 4px 0 0; }
.titles { display: flex; justify-content: center; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.title { margin: 0; font: 600 25px/1.15 var(--serif); letter-spacing: .02em; white-space: nowrap; }
.name { margin: 0; font: italic 500 19px/1.15 var(--serif); color: var(--ink2); white-space: nowrap; }
.hint { margin: 2px 0 0; font-size: 14px; line-height: 1.3; color: var(--ink2); min-height: 2.6em; }
.hint.nudge { color: var(--terra2); font-weight: 500; }
.play { display: flex; flex-direction: column; align-items: center; }

/* overview and target card */
.strip { display: flex; justify-content: center; align-items: flex-start; gap: 18px; margin: 4px 0 8px; }
.strip figure { margin: 0; text-align: center; }
.ov canvas { width: 84px; height: 112px; display: block; }
.target canvas { width: 112px; height: 112px; display: block; }
.target figcaption { font-size: 13px; line-height: 1.2; margin-top: 3px; color: var(--ink2); font-weight: 500; letter-spacing: .04em; }

/* grid: a canvas with one transparent button per square on top */
.gridwrap {
	position: relative; width: var(--gs); height: var(--gs); min-width: 200px; min-height: 200px;
	touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.gridwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cells { position: absolute; inset: 6px; display: grid; }
.cells button { border: 0; background: transparent; padding: 0; margin: 0; min-width: 44px; min-height: 44px; border-radius: 2px; }
.cells button:focus-visible { outline: 3px solid var(--ochre); outline-offset: -5px; }

/* controls */
.controls { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; width: 100%; max-width: 420px; flex-wrap: wrap; justify-content: center; }
.primary, .ghost { min-height: 46px; padding: 9px 16px; border-radius: 999px; font-weight: 500; font-size: 15px; letter-spacing: .02em; }
.primary { background: var(--terra2); color: var(--cream); border: 1.5px solid var(--terra2); }
.ghost { background: var(--cream); color: var(--ink); border: 1.5px solid var(--ink); }
.ghost:disabled { opacity: .45; cursor: default; }
.controls .ghost { padding: 9px 12px; white-space: nowrap; }
.stamps { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.stamps .label { font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; min-height: 46px; }
.stamps canvas { width: 22px; height: 22px; display: block; }
.stamp {
	min-height: 46px; min-width: 44px; padding: 4px 10px 4px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--cream);
	font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.stamp[aria-pressed="true"] { border: 2.5px solid var(--ink); background: var(--sand); }
.progress { margin: 4px 0 0; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; text-align: center; }
.link { min-height: 44px; padding: 0 4px; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; color: var(--ink); }
.links { margin: 6px 0 0; text-align: center; }
.small { font-size: 13px; color: var(--ink2); margin: 6px 0; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }

/* result */
.result { text-align: center; padding: 0 0 4px; }
.eyebrow { margin: 4px 0 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--terra2); font-weight: 600; }
.scene-wrap { position: relative; width: min(100%, 420px); height: min(62vw, 300px); margin: 0 auto; }
.scene-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.skip { position: absolute; right: 0; bottom: 0; min-height: 44px; }
.result h2 { margin: 2px 0 2px; font: 600 26px/1.2 var(--serif); }
.result p { margin: 0; }
.result .btns { justify-content: center; align-items: center; }
.news { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.news li { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--sand); border: 1px solid var(--ochre); }
.offer { margin: 14px 0 6px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: rgba(233, 216, 192, .45); text-align: left; }
.offer h3 { margin: 0 0 4px; font: 600 21px/1.25 var(--serif); }
.offer p { margin: 0 0 4px; font-size: 15px; }
.offer .btns { justify-content: flex-start; align-items: center; }

/* footer */
.foot { text-align: center; font-size: 13px; color: var(--ink2); padding: 18px var(--gutter) 24px; border-top: 1px solid var(--line); margin-top: 16px; }
.foot p { margin: 2px 0; }
.foot a { display: inline-block; padding: 12px 4px; min-height: 44px; min-width: 44px; color: var(--ink2); }

/* dialogs: cream, not white; backdrop in ink, not black (literal colours: older browsers drop variables in ::backdrop) */
dialog.sheet, dialog.isokit-gate, dialog.isokit-dlg {
	border: 0; border-radius: 18px; padding: 20px; width: min(calc(100vw - 24px), 480px); max-height: calc(100vh - 32px); overflow: auto;
	background: #F6EEE2; color: #2A1E17; box-shadow: 0 10px 40px rgba(42, 30, 23, .25);
}
dialog.sheet::backdrop, dialog.isokit-gate::backdrop, dialog.isokit-dlg::backdrop { background: rgba(42, 30, 23, .5); }
.sheet h2, .isokit-dlg h2 { margin: 0 0 8px; font: 600 26px/1.2 var(--serif); }
.sheet .eyebrow { margin: 0 0 4px; font-weight: 500; }
.sheet p { font-size: 16px; line-height: 1.6; }
.sheet details { margin: 10px 0; font-size: 14px; }
.sheet summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }
.sheet details li { margin: 6px 0; }
.sheet details a { display: inline-block; padding: 6px 0; }
.sheet .btns { justify-content: flex-end; }
.isokit-gate h2 { font: 600 25px/1.2 var(--serif); }
.isokit-gate .isokit-send { background: var(--terra2); color: var(--cream); border: 1.5px solid var(--terra2); border-radius: 999px; font-weight: 500; }
.isokit-gate .isokit-notnow { background: var(--cream); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; }
.isokit-gate .isokit-dl { background: var(--terra2); color: var(--cream); border-radius: 999px; }
.dlg-head h2 { margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 6px 0 4px; font-size: 14px; }
.stats b { font-variant-numeric: tabular-nums; }
.dlg-h3 { margin: 14px 0 6px; font: 600 19px/1.2 var(--serif); }
.tabs { display: flex; margin: 10px 0 6px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.tabs button { flex: 1; min-height: 44px; border: 0; background: var(--cream); font-size: 14px; font-weight: 500; }
.tabs button + button { border-left: 1.5px solid var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--cream); }
.isokit-dlg .isokit-album { margin: 6px 0 10px; }
.isokit-dlg .isokit-slot { border-radius: 6px; background: #E9D8C0; }
.isokit-dlg .isokit-slot.is-empty { background: transparent; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 8px; }
.badge-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.badge-list li { font-size: 13px; line-height: 1.3; padding: 6px 8px; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--ink2); }
.badge-list li.got { border: 1.5px solid var(--ochre); background: rgba(201, 138, 46, .12); color: var(--ink); }
.badge-list b { display: block; font-size: 14px; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 4px; }
.opts button {
	min-height: 56px; padding: 6px 4px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--cream);
	font-size: 14px; line-height: 1.25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.opts button small { font-size: 11.5px; color: var(--ink2); }
.opts button[aria-pressed="true"] { border: 2.5px solid var(--ink); background: var(--sand); }
.opts button:disabled { cursor: default; color: var(--ink2); background: transparent; border-style: dashed; }
.opts i { display: block; width: 28px; height: 18px; border-radius: 4px; border: 2px solid; }
.modes2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.isokit-album-big > button:last-child { background: var(--cream); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 18px; margin-top: 8px; }
.isokit-album-big .primary { margin-right: 8px; }
.isokit-album-big h2 { margin-top: 10px; }
.isokit-album-big .isokit-big { background: #E9D8C0; border-radius: 6px; padding: 8px; }

/* wide screens: strip and grid side by side */
@media (min-width: 760px) and (min-height: 700px) {
	:root { --gs: min(calc(100vh - 330px), 400px); }
	.ov canvas { width: 105px; height: 140px; }
	.target canvas { width: 140px; height: 140px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* narrow phones: keep Undo, Show me and two stamps on one row */
@media (max-width: 420px) {
	.controls { gap: 5px; }
	.controls .ghost { padding: 8px 10px; font-size: 14.5px; }
	.stamps { gap: 5px; }
	.stamp { padding: 4px 7px 4px 5px; font-size: 12.5px; gap: 3px; }
	.stamp canvas { width: 20px; height: 20px; }
}
