/* One sheet for every page. Spacing is on a 4px scale (4 8 12 16 20 24 32 40 48 64);
   type sizes are 12 14 16 20 24 28 40; UI text has line-height 1.4–1.5, sentences 1.7–1.8.
   Everything a finger can press is at least 44px high with 8px to its neighbour and carries
   a 2px ink border; cards that are not links have no border. Measured by tools/craft-check.mjs. */
:root {
	--ink: #1f1a2e;
	--sub: #5b5670;
	--bg: #fff7e8;
	--card: #ffffff;
	--rail: #eadfca;
	--font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}
/* Chinese is set in a Chinese face: in a Japanese one its comma and full stop sit low and left. */
:root:lang(zh-tw) {
	/* The system face comes first for its line metrics and Latin; it has no Chinese glyphs, so those come from the next. */
	--font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
[hidden] {
	display: none !important;
}
html:not(.has-p) [data-only="result"],
html.has-p [data-only="explain"] {
	display: none !important;
}
:focus-visible {
	outline: 3px solid #2f55d4;
	outline-offset: 2px;
}
.wrap {
	max-width: 560px;
	margin-inline: auto;
	padding-inline: 16px;
}
.chara {
	display: block;
	flex: none;
}

/* header and footer */
.site-header .wrap {
	display: flex;
	align-items: center;
	height: 48px;
}
.brand {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.4;
	color: var(--ink);
	text-decoration: none;
}
.site-footer {
	margin-top: 48px;
	padding-block: 24px;
	border-top: 2px solid var(--rail);
}
.footer-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.footer-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-inline: 12px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ink);
}
.footer-note {
	margin: 16px 0 0;
	font-size: 12px;
	line-height: 1.7;
	color: var(--sub);
	text-align: center;
}

/* buttons */
.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 12px 24px;
	border: 2px solid var(--ink);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.btn-primary {
	background: var(--ink);
	color: #ffffff;
	box-shadow: 0 4px 0 #ffc93c;
}
.btn-small {
	min-height: 48px;
	padding: 8px 12px;
	font-size: 14px;
}
.btn:active,
.opt:active {
	transform: translateY(2px);
}

/* page heads */
.top {
	padding-top: 16px;
	text-align: center;
}
.page-title {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.page-lead {
	margin: 8px 0 0;
	font-size: 16px;
	line-height: 1.7;
	color: var(--sub);
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.block {
	margin-top: 32px;
}
.block-title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
}
.prose {
	margin: 0;
	font-size: 16px;
	line-height: 1.8;
}
.prose + .prose {
	margin-top: 16px;
}
.text .page-title {
	margin-top: 16px;
}
.text-section {
	margin-top: 32px;
}

/* a quiz's card */
.quiz-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.quiz-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 20px;
	border: 2px solid var(--ink);
	border-radius: 24px;
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
}
.faces {
	display: flex;
	justify-content: center;
	gap: 8px;
}
.quiz-card-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}
.quiz-card-name {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.quiz-card-tagline {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.quiz-card-meta {
	font-size: 12px;
	line-height: 1.5;
	color: var(--sub);
}

/* the quiz: opening */
.intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding-top: 16px;
	text-align: center;
}
.intro-title {
	margin: 8px 0 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.intro-tagline {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.intro-meta,
.intro-count {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sub);
}
.intro-count {
	font-weight: 700;
	color: var(--ink);
}
.intro .btn {
	margin-block: 16px 8px;
}

/* the quiz: questions */
main.is-playing > :not(.play),
html.is-playing main > :not(.play),
html.is-playing .site-footer {
	display: none;
}
.play {
	padding-top: 8px;
}
.play-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.back {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	min-height: 44px;
	margin: 0;
	padding: 8px 16px;
	border: 2px solid var(--ink);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
}
.play-count {
	margin: 0;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
}
.progress {
	height: 8px;
	margin-top: 8px;
	border-radius: 999px;
	background: var(--rail);
	overflow: hidden;
}
.progress-fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 999px;
	background: var(--ink);
	transition: width 0.2s ease-out;
}
.q-text {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60px;
	margin: 24px 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.5;
	text-align: center;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
	outline: none;
}
.opts {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.opt {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 64px;
	margin: 0;
	padding: 12px 20px;
	border: 2px solid var(--ink);
	border-radius: 20px;
	background: var(--card);
	color: var(--ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.opt.is-picked {
	background: var(--ink);
	color: #ffffff;
}
.q-text.is-in,
.opts.is-in {
	animation: slide 0.18s ease-out;
}

/* every type of a quiz */
.type-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.type-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	height: 100%;
	padding: 16px 12px;
	border: 2px solid var(--ink);
	border-radius: 20px;
	background: var(--card);
	color: var(--ink);
	text-align: center;
	text-decoration: none;
}
.type-card-name {
	margin-top: 4px;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.type-card-code {
	font-size: 12px;
	font-weight: 800;
	line-height: 1.4;
	color: var(--sub);
}
.type-card-catch {
	font-size: 14px;
	line-height: 1.5;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

/* one type */
.hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 24px 20px;
	border-radius: 24px;
	background: var(--type-bg);
	color: var(--type-on);
	text-align: center;
}
.hero-quiz {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}
.hero-catch {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.hero-char {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 208px;
	height: 208px;
	margin-block: 8px;
	border-radius: 50%;
	background: #ffffff;
}
.hero-char .chara {
	animation: pop 0.4s ease-out;
}
.hero-name {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.4;
	text-wrap: balance;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.hero-code {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
}
.actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 16px;
}
.share-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}
html.has-p .share-grid #copy {
	grid-column: 1 / -1;
}
.axes {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 16px;
	border-radius: 20px;
	background: var(--card);
}
.axis-name {
	margin: 0 0 4px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sub);
	text-align: center;
}
.axis-poles {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.pole {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	padding-block: 4px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sub);
}
.pole.is-win {
	padding-inline: 12px;
	background: var(--type-bg);
	color: var(--type-on);
	font-weight: 800;
}
.pct {
	font-variant-numeric: tabular-nums;
}
.track {
	display: flex;
	height: 12px;
	margin-top: 8px;
	border-radius: 999px;
	background: var(--rail);
	overflow: hidden;
}
.axis[data-win="1"] .track {
	justify-content: flex-end;
}
.fill {
	display: block;
	width: 50%;
	height: 100%;
	border: 2px solid var(--bar-edge, transparent);
	border-radius: 999px;
	background: var(--type-bg);
	background-clip: border-box;
	transition: width 0.5s ease-out;
}
.items {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.items li {
	padding: 12px 16px;
	border-radius: 16px;
	background: var(--card);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}
.items li,
.mine-item,
.pair-name,
.choice-label {
	word-break: keep-all;
	overflow-wrap: anywhere;
}
.items-tint li {
	background: var(--type-tint);
}
.pairs {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.pair {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	border: 2px solid var(--ink);
	border-radius: 20px;
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
}
.pair-head {
	display: flex;
	align-items: center;
	gap: 12px;
}
/* The two lines of text have their ink a pixel above their box's middle; the face follows. */
.pair-head .chara {
	position: relative;
	top: -1px;
}
.result-back {
	display: flex;
	margin-block: 8px 12px;
}
.actions-note {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sub);
	text-align: center;
}
.pair-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.pair-label {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sub);
}
.pair-name {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.4;
}
.pair-why {
	font-size: 14px;
	line-height: 1.7;
}
.stat {
	padding: 20px;
	border-radius: 20px;
	background: var(--card);
	text-align: center;
}
.stat-num {
	margin: 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}
.stat-note {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sub);
}
.more {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* a sheet: one item, three choices, everyone's shares. The three choice colours are fixed. */
.c0 {
	--c: #ffcdb8;
	--cd: #ffa27a;
}
.c1 {
	--c: #ffe38f;
	--cd: #ffcb33;
}
.c2 {
	--c: #c4dbff;
	--cd: #8fb9ff;
}
/* Who every item is about ("恋人が…"): a label that stays above the item. */
.premise {
	margin: 16px 0 0;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--sub);
	text-align: center;
}
.block-premise {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--sub);
}
.sheet-text {
	min-height: 108px;
	margin-bottom: 8px;
	font-size: 24px;
}
.premise + .sheet-text {
	margin-top: 4px;
}
.reveal-note {
	/* One line is kept free before a choice, so nothing below moves when the note appears. */
	min-height: 1.5em;
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--sub);
	text-align: center;
	visibility: hidden;
}
.choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.choice {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	/* Room for a label of two lines, so a row is as high after a choice as before it. */
	min-height: 64px;
	margin: 0;
	padding: 8px 16px;
	border: 2px solid var(--ink);
	border-radius: 16px;
	background: var(--card);
	color: var(--ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-align: left;
	overflow: hidden;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.choice-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--c);
	transition: width 0.4s ease-out;
}
.choice-label,
.choice-stat {
	position: relative;
}
.choice-stat {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	visibility: hidden;
	font-variant-numeric: tabular-nums;
}
/* "You": an ink badge on the chosen row, read from across a room. */
.choice-you {
	display: none;
	padding: 4px 8px;
	border-radius: 999px;
	background: var(--ink);
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.5;
	white-space: nowrap;
}
.choice-pct {
	min-width: 64px;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
	text-align: right;
}
/* The chosen row keeps its colour over its whole width, with the shares showing too. */
.choice.is-picked {
	background: var(--c);
	font-weight: 800;
	box-shadow: inset 0 0 0 2px var(--ink);
}
.choice.is-picked .choice-fill {
	background: var(--cd);
}
.choice.is-picked .choice-you {
	display: block;
}
.sheet-play.is-chosen .reveal-note,
.sheet-play.is-chosen .choice.is-picked .choice-stat,
.sheet-play.is-revealed .choice-stat,
.sheet-play.is-chosen #next {
	visibility: visible;
}
/* The pale bar carries an ink line along its foot, so its length reads on white. */
.sheet-play.is-revealed .choice-fill::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 4px;
	background: var(--ink);
}
.sheet-play #next {
	margin-top: 16px;
	visibility: hidden;
}

/* a sheet's result */
.meter {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}
.meter-end {
	flex: none;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.4;
	white-space: nowrap;
}
.meter-track {
	flex: 1;
	height: 12px;
	border: 2px solid var(--type-on);
	border-radius: 999px;
	overflow: hidden;
}
.meter-fill {
	display: block;
	width: 50%;
	height: 100%;
	border-radius: 999px;
	background: var(--type-on);
	transition: width 0.5s ease-out;
}
html:not(.has-p) .share-grid-band #copy {
	grid-column: 1 / -1;
}
html.has-p .share-grid-band #copy {
	grid-column: auto;
}
.mine {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mine li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-radius: 16px;
	background: var(--card);
}
.mine-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.mine-item {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}
.mine-note {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--sub);
}
.chip {
	display: inline-flex;
	align-items: center;
	flex: none;
	min-height: 32px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--c);
	font-size: 14px;
	font-weight: 800;
	line-height: 1.4;
	white-space: nowrap;
}
#split-list li {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* a sheet on a wide screen: read from across a room, or in a stream */
@media (min-width: 900px) {
	.sheet-play {
		max-width: 960px;
	}
	.sheet-text {
		min-height: 112px;
		font-size: 40px;
		line-height: 1.4;
	}
	.reveal-note {
		font-size: 20px;
	}
	.choices {
		gap: 12px;
	}
	.choice {
		min-height: 72px;
		padding: 12px 24px;
		font-size: 24px;
	}
	.choice-you {
		padding: 4px 12px;
		font-size: 20px;
	}
	.choice-pct {
		min-width: 96px;
		font-size: 28px;
	}
	/* The site's name and the sheet share one column. */
	html.is-playing .site-header .wrap {
		max-width: 960px;
	}
	.premise {
		font-size: 24px;
	}
	.sheet-play .back,
	.sheet-play .play-count {
		font-size: 20px;
	}
	.sheet-play #next {
		min-height: 72px;
		font-size: 24px;
		line-height: 1.5;
	}
}

@media (min-width: 600px) {
	.type-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 359px) {
	.page-title,
	.intro-title {
		font-size: 24px;
	}
	.hero-catch {
		font-size: 20px;
	}
	.hero-name {
		font-size: 24px;
	}
	.hero-char {
		width: 176px;
		height: 176px;
	}
	.hero-char .chara {
		width: 144px;
		height: 144px;
	}
	.axes {
		padding: 12px;
	}
	.type-card {
		padding-inline: 8px;
	}
	.q-text {
		margin-block: 16px;
		font-size: 18px;
	}
	.sheet-text {
		min-height: 82px;
		margin-bottom: 8px;
		font-size: 18px;
	}
	.reveal-note {
		margin-bottom: 4px;
	}
	.choice {
		padding-inline: 12px;
		font-size: 14px;
	}
	.premise {
		margin-top: 8px;
	}
	.sheet-play #next {
		margin-top: 8px;
	}
	.opts {
		gap: 8px;
	}
	.opt {
		min-height: 56px;
		padding: 8px 16px;
	}
}

@keyframes pop {
	from {
		transform: scale(0.8);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}
@keyframes slide {
	from {
		transform: translateX(12px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
