@font-face {
	font-family: 'GMarketSans';
	src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
	font-weight: 300;
	font-display: swap;
}

@font-face {
	font-family: 'GMarketSans';
	src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
	font-weight: 500;
	font-display: swap;
}

@font-face {
	font-family: 'GMarketSans';
	src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
	font-weight: 700;
	font-display: swap;
}

/* Tokens and base */
:root {
	/* Palette */
	--bg: #f8f5e9;
	--paper: #fdfaf0;
	--ink: #25291f;
	--muted: #606852;
	--line: #d8d1bb;
	--paper-fold: #e7e0ca;
	--green: #536d4c;
	--shadow: #354637;
	--gold: #d8ac5b;
	/* Typography */
	--font-size-tiny: 12px;
	--font-size-small: 13px;
	--font-size-middle: 15px;
	--font-size-big: 18px;
	--font-size-huge: 20px;
	--font-size-title-small: 24px;
	--font-size-title-middle: 32px;
	--font-size-title-big: 48px;
	/* Shared colors */
	--focus-ring: #cf9d53;
	--shadow-translucent: #35463766;
	--daily-accent: #a67a19;
	--challenge-accent: #a5716a;
	/* Spacing */
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 10px;
	--space-4: 12px;
	--space-5: 16px;
	/* Corners */
	--radius-small: 4px;
	--radius-medium: 5px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 500 var(--font-size-middle) 'GMarketSans', sans-serif;
}

button {
	font: inherit;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
	min-height: 44px;
	border: 0;
}

input {
	font: inherit;
}

a {
	-webkit-tap-highlight-color: transparent;
	color: inherit;
	text-decoration: none;
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 4px;
}

h1, h2, h3, p {
	margin-top: 0;
}

/* Header and page layout */
.top {
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 78px;
	padding: 0 max(20px, 3vw);
	background: #faf7eb;
}

.logo {
	font-size: var(--font-size-title-small);
	display: flex;
	align-items: center;
	gap: var(--space-3);
	color: #2f4430;
	font-weight: 700;
	text-shadow: 2px 2px 0 #ccd0b5;
	letter-spacing: -2px;
}

.logo-dice {
	color: var(--green);
	font-size: var(--font-size-title-middle);
}

.header-right {
	display: flex;
	gap: var(--space-3);
	align-items: center;
}

.save {
	font-size: var(--font-size-small);
	color: #7b8975;
}

.icon-button {
	background: transparent;
	border: 1px solid var(--line);
	width: 38px;
	min-height: 38px;
	font-size: var(--font-size-huge);
	color: var(--green);
}

.primary {
	margin-top: var(--font-size-small);
	padding: var(--space-3) 15px;
	border: 1px solid var(--green);
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 26px;
	transition: transform 0.15s;
	background: var(--green);
	box-shadow: inset 0 2px #a9b98c, inset 2px 0 #94aa7b, 0 3px #354b36;
	color: #fffdf2;
	border-radius: 3px;
	font-weight: 700;
	text-shadow: 1px 1px #3b5138;
}

.secondary {
	margin-top: var(--font-size-small);
	padding: var(--space-3) 15px;
	border: 1px solid var(--green);
	font-weight: 700;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 26px;
	transition: transform 0.15s;
	color: var(--green);
	border-color: #c8cdbb;
	background: var(--paper);
	box-shadow: inset 0 2px #fffef6, 0 2px #d2d6c0;
}

.primary:hover:not(:disabled) {
	background: #425c41;
	transform: translateY(-1px);
}

.eyebrow {
	font-size: var(--font-size-tiny);
	letter-spacing: 2.5px;
	font-weight: 700;
	color: #919e82;
}

.muted {
	color: var(--muted);
}

.small {
	font-size: var(--font-size-small);
	line-height: 1.7;
}

/* Welcome and setup components */
.welcome {
	max-width: 800px;
	margin: auto;
	text-align: center;
	padding: 58px 20px 28px;
}

.welcome h1 {
	font-size: var(--font-size-title-big);
	line-height: 1.4;
	letter-spacing: -2.7px;
	font-weight: 700;
	margin: 18px 0;
}

.intro {
	color: var(--muted);
	line-height: 1.75;
	font-size: var(--font-size-middle);
}

.hero-art {
	margin: 0;
	position: relative;
	border-bottom: 1px solid var(--line);
}

.landscape {
	display: block;
	width: 100%;
	image-rendering: pixelated;
}

.hero-art .landscape {
	height: auto;
	object-fit: cover;
}

.welcome-actions {
	display: flex;
	justify-content: center;
	gap: var(--space-4);
	margin: 26px 0 var(--space-5);
}

.welcome.cover-page {
	max-width: 1040px;
	padding-top: clamp(16px, 4vw, 56px);
}

.home-cover {
	border: 1px solid var(--line);
	background: var(--paper);
	box-shadow: 3px 4px var(--paper-fold);
	text-align: left;
}

.cover-portrait {
	position: absolute;
	right: clamp(10px, 3vw, 42px);
	bottom: clamp(10px, 2vw, 26px);
	display: grid;
	place-items: center;
	width: clamp(52px, 9vw, 96px);
	aspect-ratio: 4 / 5;
	padding: 5px;
	border: 1px solid #948568;
	background: #fdfaf0;
	box-shadow: 2px 3px #56483177;
}

.cover-portrait .player-avatar {
	width: 100%;
	height: 100%;
}

.cover-introduction {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: clamp(18px, 4vw, 50px);
	padding: clamp(20px, 4vw, 44px);
}

.cover-page .cover-copy h1 {
	margin: 0 0 var(--space-2);
	font-size: clamp(29px, 4.8vw, 50px);
	letter-spacing: -0.06em;
	line-height: 1.32;
	word-break: keep-all;
}

.cover-copy .intro {
	max-width: 38ch;
	margin: 0;
	word-break: keep-all;
}

.cover-entry .welcome-actions {
	display: grid;
	margin: 0;
	gap: var(--space-2);
}

.cover-entry .welcome-actions button {
	margin: 0;
}

.cover-beta {
	margin: var(--space-4) 0 0;
	color: var(--muted);
}

@media (max-width: 760px) {
	.cover-page {
		padding-inline: 12px;
	}

	.cover-introduction {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-4);
		padding: 16px;
	}

	.cover-introduction .cover-entry .welcome-actions {
		max-width: none;
	}

	.cover-page .hero-art .landscape {
		aspect-ratio: 2.7;
	}

	.cover-copy .intro {
		font-size: max(13px, var(--font-size-small));
	}
}

.setup {
	margin: 45px auto;
	padding: 0 24px 50px;
	max-width: 1080px;
}

.setup h1 {
	font-size: var(--font-size-title-middle);
	letter-spacing: -1px;
}

.name-label {
	display: block;
	font-weight: 700;
	margin: 30px 0;
}

.name-label input {
	display: block;
	width: 100%;
	padding: 14px;
	margin-top: var(--space-3);
	background: #fffdf7;
	border: 1px solid #d9decc;
	color: var(--ink);
}

.allocation-heading {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.allocation-heading h2 {
	font-size: var(--font-size-big);
}

.allocation-heading span {
	font-size: var(--font-size-small);
	color: var(--green);
	font-weight: 700;
}

.allocation {
	border: 1px solid var(--line);
	background: var(--paper);
}

.allocation-row {
	display: flex;
	align-items: center;
	padding: var(--space-4) 18px;
	border-bottom: 1px solid #eeede4;
	gap: var(--space-3);
}

.allocation-row label {
	flex: 1;
}

.allocation-row small {
	display: block;
	font-size: var(--font-size-tiny);
	color: var(--muted);
	margin-top: 3px;
}

.allocation-row button {
	width: 34px;
	min-height: 34px;
	background: #edefe3;
	color: var(--green);
}

.allocation-row input {
	width: 40px;
	text-align: center;
	border: 0;
	background: transparent;
	color: var(--ink);
	appearance: textfield;
	font-weight: 700;
}

.allocation-row input::-webkit-inner-spin-button {
	appearance: none;
}

.stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	font-size: var(--font-size-title-small);
	color: #81936e;
	background: transparent;
	padding: 0;
}

.setup-note {
	font-size: var(--font-size-small);
	color: var(--muted);
	margin: 18px 0;
}

.form-actions {
	display: flex;
	justify-content: space-between;
	margin-top: 28px;
}

.play-heading {
	display: flex;
	justify-content: space-between;
	align-items: center;
	grid-column: 1;
	padding: var(--space-2) var(--space-3);
	border: 2px solid #7b8c6e;
	box-shadow: inset 0 0 0 3px #e4e7d2;
	background: var(--paper);
	margin: 0 0 20px;
	gap: var(--space-2);
}

.play-heading h1 {
	letter-spacing: -1px;
	font-size: var(--font-size-big);
	margin: 0;
}

.play-heading h1 span {
	font-weight: 500;
	margin-left: var(--space-4);
	color: #8f9785;
	font-size: var(--font-size-tiny);
}

.stage-tag {
	font-size: var(--font-size-small);
	border: 1px solid #d9dfce;
	padding: var(--space-2) 13px;
	color: #819173;
}

.stat {
	display: flex;
	align-items: center;
	border: 0;
	border-right: 2px solid #a6b091;
	border-radius: 0;
	background: transparent;
	padding: var(--space-3) 5px;
	justify-content: center;
	gap: 7px;
}

.stat:last-child {
	border: 0;
	border-right: 0;
}

.stat small {
	display: block;
	margin-bottom: 1px;
	font-size: var(--font-size-small);
	color: var(--ink);
	font-weight: 700;
}

.stat strong {
	font-weight: 700;
	font-size: var(--font-size-huge);
}

.health .stat-icon, .health.cell {
	color: #bf8a7b;
}

.asset .stat-icon, .asset.cell {
	color: #b59a5c;
}

.morality .stat-icon, .morality.cell {
	color: #789780;
}

.sensitivity .stat-icon, .sensitivity.cell {
	color: #bd939b;
}

.charm .stat-icon, .charm.cell {
	color: #a99a6b;
}

.knowledge .stat-icon, .knowledge.cell {
	color: #7f9d9c;
}

.stress .stat-icon {
	color: #a9a49a;
}

.panel {
	background: #faf8f0;
	border: 1px solid var(--line);
	padding: 20px var(--space-5);
}

.panel-title {
	font-size: var(--font-size-small);
	margin: 0 0 24px;
	display: flex;
	justify-content: space-between;
}

.panel-title > span {
	font-size: var(--font-size-tiny);
	color: #9ba48e;
	font-weight: 500;
}

.portrait {
	width: 25px;
	height: 35px;
	flex: 0 0 25px;
	display: grid;
	place-items: center;
}

.portrait img {
	display: block;
	width: 25px;
	height: 35px;
	object-fit: contain;
	image-rendering: pixelated;
}

.departed {
	opacity: 0.63;
}

[data-stage] {
	--stage-accent: #516b43;
}

[data-stage='2'], [data-stage='6'] {
	--stage-accent: #72541e;
}

[data-stage='3'], [data-stage='7'] {
	--stage-accent: #775043;
}

[data-stage='4'], [data-stage='8'] {
	--stage-accent: #625476;
}

[data-stage='5'], [data-stage='9'] {
	--stage-accent: #3a645d;
}

.board {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	grid-template-rows: repeat(8, minmax(0, 1fr));
	position: relative;
	aspect-ratio: 1.35;
	border: 5px solid #5e7051;
	padding: var(--space-2);
	gap: 2px;
	background: #b7b99d;
	box-shadow: inset 0 0 0 3px #d6d5bd, 3px 4px var(--paper-fold);
}

.cell {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 2px;
	position: relative;
	min-width: 0;
	border: 1px solid #8b9a77;
	background: #faf8e8;
}

.cell-icon {
	font-size: var(--font-size-huge);
	line-height: 1.2;
	margin: 0;
}

.cell.corner {
	color: #6f845e;
	background: #c3d0a7;
}

.cell.current {
	z-index: 2;
	background: #e3e8cd;
	background: color-mix(in srgb, var(--stage-accent) 21%, var(--paper));
	outline: 2px solid var(--stage-accent);
	box-shadow: inset 0 0 0 2px var(--paper);
}

.token {
	position: absolute;
	background: #435d43;
	color: #f5da91;
	box-shadow: 2px 2px 0 #324831;
	bottom: -4px;
	right: -4px;
	width: 19px;
	height: 19px;
	display: grid;
	place-items: center;
	font-size: var(--font-size-small);
	border: 2px solid #f4f0df;
}

.board-center {
	grid-row: 2 / -2;
	grid-column: 2 / -2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	text-align: center;
	background: var(--bg);
	padding: var(--space-4);
	position: relative;
	--board-action-width: 180px;
}

.board-center .landscape {
	width: 82%;
	max-height: 150px;
}

.progress {
	height: 6px;
	background: var(--paper-fold);
	margin-top: var(--space-4);
}

.progress > div {
	height: 100%;
	background: var(--stage-accent);
	transition: width 0.3s;
}

.under-board {
	display: flex;
	justify-content: space-between;
	color: #979f8a;
	margin-top: var(--space-2);
	font-size: var(--font-size-tiny);
}

.records {
	max-height: 610px;
	overflow: auto;
}

.record {
	padding: 14px 0;
	border-bottom: 1px solid #e7e7d9;
	text-align: left;
}

.record summary {
	cursor: pointer;
	list-style: none;
}

.record-time {
	display: block;
	color: #a6aa98;
	margin-bottom: 7px;
	font-size: var(--font-size-small);
}

.record strong {
	display: block;
	font-weight: 500;
	font-size: var(--font-size-small);
}

.record-kind {
	display: block;
	margin-top: 7px;
	color: #9fa38f;
	font-size: var(--font-size-small);
}

.record p {
	line-height: 1.8;
	margin-top: 14px;
	color: #7e8874;
	font-size: var(--font-size-small);
}

.delta-line {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.delta {
	display: inline-block;
	padding: 5px var(--space-2);
	background: #edefe2;
	color: #778b68;
	font-size: var(--font-size-small);
	border-radius: 2px;
}

.delta.negative {
	color: #aa827b;
	background: #f0e8e0;
}

.empty-record {
	padding: 30px 0;
	color: #a0a58e;
	line-height: 2.1;
	text-align: center;
	font-size: var(--font-size-middle);
}

.game-footer {
	margin-top: 34px;
	border-top: 1px solid var(--line);
	padding-top: 18px;
	display: flex;
	justify-content: space-between;
	color: #a4a792;
	font-size: var(--font-size-tiny);
	grid-column: 1 / -1;
}

.scrim {
	position: fixed;
	inset: 0;
	background: #293b2d73;
	backdrop-filter: blur(3px);
	display: grid;
	place-items: center;
	z-index: 10;
	padding: 20px;
	overflow: auto;
}

.event-modal {
	width: min(540px, 100%);
	max-height: 90dvh;
	overflow: auto;
	padding: 36px;
	text-align: center;
	border: 3px solid #6a7e5b;
	box-shadow: inset 0 0 0 3px #e2e7d0, 6px 6px var(--shadow-translucent);
	background: var(--paper);
}

.event-modal h2 {
	font-size: var(--font-size-title-small);
	letter-spacing: -1px;
	line-height: 1.5;
}

.event-modal.album-modal {
	border: 1px solid #a69c7e;
	border-inline-start: 6px double #a69c7e;
	background: linear-gradient(90deg, #eee9d8 0, var(--paper) 15px);
	box-shadow: 3px 3px #dbd2b8, 6px 6px #a69c7e, 9px 9px #25291f44;
}

.completion-album {
	text-align: left;
}

.completion-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
}

.completion-album .completion-header .album-chapter {
	margin: 0;
	word-break: keep-all;
}

.completion-close {
	flex: 0 0 44px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: var(--font-size-title-middle);
	line-height: 1;
	cursor: pointer;
}

.completion-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: var(--space-4);
	padding-top: var(--space-3);
	border-top: 1px solid var(--line);
}

.completion-footer button {
	min-width: 120px;
	min-height: 44px;
	margin: 0;
}

.album-chapter, .chapter-marker {
	margin-bottom: var(--space-2);
	font-size: max(12px, var(--font-size-tiny));
	font-weight: 700;
	color: var(--stage-accent, var(--green));
}

.completion-album > h2, .play-heading h1, .board-center-scene > h2 {
	color: var(--stage-accent);
}

.completion-album .event-story {
	margin-block: var(--space-2) var(--space-4);
}

.completion-album .event-effects {
	justify-content: start;
}

.completion-album .modal-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
	align-items: stretch;
	gap: var(--space-2);
	margin-block: 0 var(--space-3);
}

.completion-album .modal-actions > :is(a, button) {
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: var(--space-2) var(--space-3);
	font-size: max(12px, var(--font-size-small));
	line-height: 1.4;
	text-align: center;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

@media (max-width: 760px) {
	.event-modal.album-modal {
		padding-block: 18px;
	}

	.completion-album > h2 {
		margin-bottom: var(--space-2);
	}

	.completion-album .completion-stats {
		margin-bottom: var(--space-4);
		padding-block: var(--space-2);
	}
}

.event-symbol {
	font-size: var(--font-size-title-middle);
	color: #a3ac7b;
	margin: var(--space-3) 0 18px;
}

.event-story {
	text-align: left;
	line-height: 1.95;
	font-size: var(--font-size-big);
	margin: 22px 0 24px;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.event-effects {
	display: flex;
	justify-content: center;
	gap: 7px;
	flex-wrap: wrap;
	margin: var(--space-5) 0;
}

.modal-actions {
	display: flex;
	gap: var(--space-4);
	justify-content: center;
	margin-top: 24px;
}

.event-modal > .primary {
	margin-top: var(--space-5);
}

.cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 28px 20px;
}

.completion-stats {
	display: flex;
	justify-content: space-between;
	gap: var(--space-2);
	border-block: 1px solid var(--line);
	padding: 16px 0;
	margin-bottom: 24px;
}

.completion-stats small {
	display: block;
	color: var(--muted);
	font-size: var(--font-size-tiny);
}

.completion-stats strong {
	display: block;
	font-size: var(--font-size-title-small);
	margin-top: var(--space-2);
}

.coming {
	border-inline-start: 3px solid var(--stage-accent);
	background: #f1ecde;
	padding: 12px 15px;
}

.coming h3 {
	font-size: var(--font-size-title-small);
	margin: 0 0 var(--space-1);
}

.coming p {
	font-size: var(--font-size-small);
	color: var(--muted);
	margin: 0;
}

.mobile-tabs {
	display: none;
	grid-column: 1 / -1;
}

#toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #344b37;
	color: #fff;
	padding: var(--space-4) 20px;
	z-index: 30;
	font-size: var(--font-size-small);
	max-width: 90%;
	box-shadow: 2px 3px 0 #223525;
}

#toast:empty {
	display: none;
}

.loading {
	text-align: center;
	padding: 100px 20px;
}

/* Responsive rules stay at cascade boundaries when later component rules override them. Moving these queries to the end would change rendering. */
@media (min-width: 1440px) {
	.play {
		padding-top: 45px;
	}

	.board-center .landscape {
		max-height: 185px;
	}
}

@media (max-width: 1100px) {
	.play-grid {
		grid-template-columns: 180px minmax(320px, 1fr);
		gap: 22px;
	}

	.records {
		max-height: 250px;
		display: flex;
		gap: 24px;
	}

	.record {
		min-width: 180px;
	}

}

@media (max-width: 760px) {
	.logo {
		font-size: var(--font-size-title-small);
	}

	.save {
		font-size: var(--font-size-tiny);
	}

	.header-right {
		gap: var(--space-3);
		flex-wrap: wrap;
		justify-content: flex-end;
	}

	.welcome {
		padding-top: 40px;
	}

	.welcome h1 {
		font-size: var(--font-size-title-middle);
	}

	.stage-tag {
		display: none;
	}

	.stat:nth-child(3), .stat:nth-child(6) {
		border: 0;
	}

	.stat.stress {
		grid-column: 1/-1;
		border-top: 1px solid #eeeee0;
		padding-top: var(--space-2);
		gap: var(--space-2);
	}

	.stat.stress div {
		display: flex;
		gap: var(--space-3);
		align-items: center;
	}

	.stat.stress strong {
		font-size: var(--font-size-middle);
	}

	.stat.stress .stat-icon {
		height: 18px;
		font-size: var(--font-size-huge);
	}

	.stat strong {
		font-size: var(--font-size-huge);
	}

	.stat-icon {
		width: 25px;
		font-size: var(--font-size-huge);
	}

	.mobile-tabs button {
		flex: 1;
		background: #ebeede;
		color: #8c977e;
		border-bottom: 2px solid transparent;
	}

	.mobile-tabs button.active {
		color: #526e4f;
		border-color: #6b845d;
		background: #e2e8d2;
	}

	.family-panel {
		display: none;
		max-width: 480px;
		margin-inline: auto; }

	.play-grid[data-tab='family'] .family-panel {
		display: block;
	}

	.play-grid[data-tab='family'] .board-panel, .play-grid[data-tab='records'] .board-panel {
		display: none;
	}

	.records {
		display: block;
		max-height: none;
	}

	.record {
		min-width: 0;
	}

	.cell-icon {
		font-size: var(--font-size-middle);
	}

	.token {
		width: 15px;
		height: 15px;
		font-size: var(--font-size-tiny);
	}

	.game-footer {
		display: block;
		text-align: center;
		line-height: 2;
	}

	.game-footer span {
		display: block;
	}

	.event-modal {
		padding: 27px 20px;
	}

	.event-modal h2 {
		font-size: var(--font-size-title-small);
	}

	.event-story {
		font-size: var(--font-size-middle);
	}

	.cards {
		margin: 22px 5px;
	}

	.setup h1 {
		font-size: var(--font-size-title-small);
	}

	.welcome-actions {
		flex-direction: column;
		max-width: 300px;
		margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* The traveling piece follows the perimeter; dialogs wait for its arrival. */
/* Motion and board states */
.board.is-moving .cell .token {
	visibility: hidden;
}

.travel-token {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: 3px solid #fff5d7;
	background: #435d43;
	color: #f5da91;
	box-shadow: 3px 3px 0 #32483180;
	font-size: var(--font-size-middle);
	line-height: 1;
}

.dice-reveal {
	animation: dice-reveal 350ms ease-out both;
}

.just-landed {
	animation: landing-glow 240ms ease-out;
}

@keyframes dice-reveal {
	0% {
		transform: scale(0.75) rotate(-14deg);
		opacity: 0.5;
	}

	65% {
		transform: scale(1.15) rotate(5deg);
		opacity: 1;
	}

	100% {
		transform: scale(1) rotate(0);
		opacity: 1;
	}
}

@keyframes landing-glow {
	0% {
		background-color: #ecd78e;
	}

	100% {
		background-color: #fff7d9;
	}
}

@media (max-width: 760px) {
	.travel-token {
		width: 21px;
		height: 21px;
		font-size: var(--font-size-small);
		border-width: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dice-reveal, .just-landed {
		animation: none !important;
	}
}

.cell-label {
	font-size: var(--font-size-small);
	color: #6f7d61;
}

.board-center .roll {
	font-size: var(--font-size-middle);
	min-height: 42px;
	margin-top: var(--space-1);
	padding: var(--space-2) 22px;
	flex-shrink: 0;
}

.family-panel .panel-title {
	font-size: var(--font-size-middle);
}

.family-panel .panel-title > span, .record .delta, .empty-record span {
	font-size: var(--font-size-small);
}

.board-center h2 {
	font-size: var(--font-size-big);
	font-weight: 700;
	color: #30462d;
	text-shadow: 2px 2px #d0d7b9;
	margin: var(--space-1) 0;
}

.center-note {
	color: #a2a58e;
	margin: 14px 0 0;
	font-size: var(--font-size-small);
	margin-top: 6px;
}

@media (max-width: 760px) {
	:root {
		--font-size-tiny: clamp(9px, 2.35vw, 10px);
		--font-size-small: clamp(11px, 3.5vw, 12px);
		--font-size-middle: 14px;
		--font-size-big: 16px;
		--font-size-huge: 18px;
		--font-size-title-small: 22px;
		--font-size-title-middle: 28px;
		--font-size-title-big: 36px;
	}

	.cell-label {
		font-size: var(--font-size-tiny);
		white-space: nowrap;
	}

	.board-center h2 {
		margin: var(--space-1) 0;
		font-size: var(--font-size-middle);
		line-height: 1.4;
	}

	.board-center .landscape {
		width: 65%;
		max-height: clamp(36px, 14vw, 76px);
	}

	.center-note {
		margin: 6px 0 0;
		font-size: var(--font-size-tiny);
	}

	.under-board {
		font-size: var(--font-size-tiny);
	}

	.board-top {
		gap: var(--space-2);
		font-size: var(--font-size-small);
	}

	.name-label input {
		font-size: var(--font-size-big);
	}

	.event-modal > .modal-actions {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
		gap: var(--space-2);
	}

	.event-modal > .modal-actions > button {
		min-width: 0;
		min-height: 44px;
		margin: 0;
		padding: var(--space-2) var(--space-3);
		font-size: max(12px, var(--font-size-small));
		line-height: 1.4;
		word-break: keep-all;
		overflow-wrap: anywhere;
	}
}

@media (max-width: 380px) {
	.play {
		padding-inline: var(--space-3);
	}

	.board-center h2 {
		margin-block: var(--space-1); }

	.board-center .landscape {
		max-height: 40px;
	}

	.center-note {
		display: none;
	}

	.board-center .roll {
		padding-inline: var(--space-2); }

	.header-right {
		gap: 6px;
	}

	.save {
		max-width: 110px;
		text-align: right;
	}
}

/* Layered pixel player, shared by setup and chapter headers. */
/* Character and setup components */
.player-avatar {
	display: inline-block;
	position: relative;
	width: 48px;
	height: 64px;
	flex: 0 0 48px;
	vertical-align: middle;
	isolation: isolate;
}

.player-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	pointer-events: none;
}

.avatar-editor {
	display: grid;
	margin: 28px 0;
	background: var(--paper);
	border: 1px solid var(--line);
	grid-template-columns: 210px minmax(0, 1fr);
	gap: 28px;
	padding: 28px;
	box-shadow: inset 0 0 0 2px #e6e8d3, 3px 3px #c3cbb4;
}

.avatar-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: var(--space-5);
	background: var(--bg);
	padding: var(--space-5) var(--space-2);
	position: sticky;
	top: 24px;
	align-self: start;
	min-height: 300px;
	border: 2px solid #a1af8b;
	box-shadow: inset 0 0 0 3px #f7f8eb;
}

.avatar-preview button {
	padding: var(--space-3) var(--space-2);
	font-size: var(--font-size-tiny);
}

.avatar-controls h2 {
	font-size: var(--font-size-big);
	margin: 0 0 var(--space-2);
}

.avatar-controls fieldset {
	border: 0;
	padding: 0;
	min-width: 0;
	margin: 0;
}

.avatar-controls legend {
	font-size: var(--font-size-small);
	margin-bottom: 7px;
	font-weight: 700;
}

.avatar-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.avatar-options button {
	border: 1px solid var(--line);
	padding: var(--space-2);
	color: var(--ink);
	font: inherit;
	font-size: var(--font-size-tiny);
	cursor: pointer;
	min-height: 36px;
	border-radius: 3px;
	background: var(--paper);
}

.avatar-options button:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.avatar-options button:disabled, .avatar-lock:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.player-heading {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	min-width: 0;
}

.player-heading > div {
	min-width: 0;
}

@media (max-width: 760px) {
	.avatar-options button {
		min-width: 44px;
		min-height: 44px;
	}

	.player-heading {
		gap: var(--space-2);
	}

	.player-heading > .player-avatar {
		width: 36px;
		height: 48px;
		flex-basis: 36px;
	}
}

.avatar-lock {
	margin-left: var(--space-2);
	padding: 5px var(--space-2);
	min-height: 32px;
	border: 1px solid var(--line);
	background: var(--paper);
	color: var(--muted);
	font: inherit;
	font-size: var(--font-size-tiny);
	cursor: pointer;
}

.avatar-lock[aria-pressed='true'] {
	border-color: var(--green);
	color: var(--green);
	background: var(--bg);
}

.avatar-lock:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

@media (max-width: 760px) {
	.avatar-lock {
		min-width: 44px;
		min-height: 44px;
	}
}

.setup .name-label, .setup .allocation-heading, .setup .allocation, .setup .setup-note, .setup .form-actions {
	max-width: 620px;
	margin-left: auto;
	margin-right: auto;
}

.avatar-preview .player-avatar {
	width: 144px;
	height: 192px;
	flex-basis: 144px;
	image-rendering: pixelated;
}

.avatar-controls {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-5) 24px;
	min-width: 0;
}

.avatar-controls > h2, .avatar-controls > p {
	grid-column: 1/-1;
	margin: 0;
}

.avatar-controls > fieldset:last-child {
	grid-column: 1/-1;
}

@media (max-width: 900px) {
	.avatar-editor {
		grid-template-columns: 160px minmax(0, 1fr);
		gap: 20px;
		padding: 20px;
	}

	.avatar-preview .player-avatar {
		width: 120px;
		height: 160px;
		flex-basis: 120px;
	}

	.avatar-controls {
		gap: var(--space-5);
	}
}

@media (max-width: 760px) {
	.setup {
		max-width: 620px;
	}

	.avatar-editor {
		gap: 20px;
		grid-template-columns: 1fr;
		padding: var(--space-5);
	}

	.avatar-preview {
		justify-content: space-around;
		position: static;
		min-height: 0;
		flex-direction: row;
	}

	.avatar-preview .player-avatar {
		width: 96px;
		height: 128px;
		flex-basis: 96px;
	}

	.avatar-controls {
		grid-template-columns: 1fr;
	}

	.avatar-controls > h2, .avatar-controls > p, .avatar-controls > fieldset:last-child {
		grid-column: auto;
	}
}

.floating-avatar {
	display: none;
}

@media (max-width: 760px) {
	.floating-avatar:not([hidden]) {
		display: grid;
		place-items: center;
		position: fixed;
		top: calc(12px + env(safe-area-inset-top, 0px));
		right: calc(12px + env(safe-area-inset-right, 0px));
		z-index: 40;
		width: 76px;
		padding: var(--space-2);
		background: var(--paper);
		border: 1px solid var(--line);
		box-shadow: 3px 3px 0 #35463733;
		pointer-events: none;
	}

	.floating-avatar .player-avatar {
		width: 48px;
		height: 64px;
		flex-basis: 48px;
	}
}

.auth-button {
	font: inherit;
	font-size: var(--font-size-small);
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--line);
	padding: var(--space-2) var(--space-3);
	cursor: pointer;
}

.auth-user {
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: var(--font-size-small);
}

#google-login-button {
	display: flex;
	justify-content: center;
	margin: 24px 0;
}

@media (max-width: 760px) {
	.auth-user {
		max-width: 70px;
	}

	.auth-button {
		min-width: 44px;
		min-height: 44px;
	}
}

.archive-note-heading {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
}

.archive-note-heading h2 {
	margin: 0;
	font-size: var(--font-size-middle);
	color: var(--ink);
}

.archive-status {
	display: inline-block;
	padding: 3px 7px;
	background: #eee9db;
	color: #837553;
	font-size: var(--font-size-tiny);
	white-space: nowrap;
}

.login-archive-info p {
	margin: var(--space-3) 0;
	line-height: 1.8;
	font-size: var(--font-size-small);
	color: var(--ink);
}

.login-archive-info {
	text-align: left;
	padding: 18px;
	background: var(--bg);
	border: 1px solid var(--line);
	margin: 20px 0 var(--space-4);
}

.archive-tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-top: 14px;
}

.archive-tags span {
	font-size: var(--font-size-tiny);
	color: var(--green);
	padding: 5px var(--space-2);
	background: var(--paper);
}

.login-storage-note {
	font-size: var(--font-size-tiny);
	line-height: 1.8;
	color: var(--muted);
	margin: 14px 0;
}

@media (max-width: 760px) {
	.login-archive-info p br {
		display: none;
	}
}

.completion-login-note {
	margin: 20px 0;
	padding: 18px;
	text-align: left;
	background: var(--bg);
	border: 1px solid var(--line);
}

.completion-login-note strong {
	font-size: var(--font-size-middle);
	color: var(--green);
}

.completion-login-note p {
	font-size: var(--font-size-small);
	line-height: 1.7;
	margin: var(--space-3) 0;
}

.completion-login-note small {
	display: block;
	font-size: var(--font-size-tiny);
	color: var(--muted);
	line-height: 1.7;
}

.completion-login-note button {
	margin-top: 14px;
}

/* Settings dialog: independent spacing from event cards. */
/* Settings and account components */
.settings-content {
	display: grid;
	gap: 24px;
	text-align: left;
}

.settings-heading h2 {
	margin: 6px 0 var(--space-3);
}

.settings-heading p {
	margin: 0;
	line-height: 1.7;
	font-size: var(--font-size-small);
}

.settings-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-5);
	padding: 20px;
	background: var(--paper);
	border: 1px solid var(--line);
}

.settings-option-copy {
	min-width: 0;
}

.settings-option-copy h3 {
	margin: 0 0 var(--space-2);
	font-size: var(--font-size-middle);
}

.settings-option-copy p {
	margin: 0;
	color: var(--muted);
	font-size: var(--font-size-small);
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.settings-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	flex-shrink: 0;
	min-height: 44px;
	padding: var(--space-3) 14px;
	border: 2px solid var(--line);
	background: var(--bg);
	color: var(--ink);
	font-size: var(--font-size-small);
}

.settings-toggle.is-on {
	background: var(--green);
	border-color: var(--green);
	color: var(--paper);
}

.settings-toggle-dot {
	width: 8px;
	height: 8px;
	background: currentColor;
}

.settings-help {
	margin: 0;
	font-size: var(--font-size-tiny);
	line-height: 1.8;
}

.settings-actions {
	border-top: 1px solid var(--line);
	padding-top: 20px;
}

.settings-actions button {
	width: 100%;
	min-height: 48px;
}

@media (max-width: 480px) {
	.settings-content {
		gap: 20px;
	}

	.settings-option {
		padding: var(--space-5);
		flex-wrap: wrap;
	}

	.settings-option-copy {
		flex: 1 1 160px;
	}

	.settings-toggle {
		margin-left: auto;
	}
}

.home-archive {
	margin: 40px 0 24px;
	padding: 24px;
	border: 1px solid var(--line);
	border-inline-start: 6px double var(--line);
	background: var(--paper);
	text-align: left;
}

.archive-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.home-archive h2 {
	font-size: var(--font-size-huge);
	margin: var(--space-2) 0;
}

.archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 14px;
	margin: var(--space-5) 0;
}

.archive-card {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	width: 100%;
	padding: 18px;
	text-align: left;
	border: 1px solid var(--line);
	border-inline-start: 5px solid var(--paper-fold);
	background: var(--bg);
	color: var(--ink);
}

.archive-card:hover {
	border-color: var(--green);
}

.archive-card .player-avatar {
	flex-shrink: 0;
	width: 48px;
	height: 64px;
}

.archive-card-copy {
	display: grid;
	gap: var(--space-2);
	min-width: 0;
	font-size: var(--font-size-small);
	overflow-wrap: anywhere;
}

.archive-card-copy strong {
	font-size: var(--font-size-middle);
}

.archive-card-link {
	color: var(--green);
	font-size: var(--font-size-tiny);
}

.archive-empty {
	padding: 24px 0 0;
	line-height: 1.9;
	color: var(--muted);
}

.saved-life {
	text-align: left;
	position: relative;
}

.saved-life-summary {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 24px 0;
	line-height: 1.8;
}

.saved-stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	padding: var(--space-5);
	background: var(--bg);
	font-size: var(--font-size-small);
}

.saved-life h3 {
	margin: 24px 0 14px;
	font-size: var(--font-size-middle);
}

.saved-family {
	display: grid;
	gap: var(--space-3);
	font-size: var(--font-size-small);
}

.saved-chapter {
	padding: 0 var(--space-2);
	border-block-start: 1px dashed var(--line);
}

.saved-chapter summary {
	min-height: 44px;
	padding-block: var(--space-2);
	cursor: pointer;
	font-size: var(--font-size-middle);
}

.saved-chapter article {
	padding: var(--space-5) 0;
}

.saved-chapter h4 {
	margin: var(--space-2) 0;
}

.saved-chapter p {
	margin: 0;
	line-height: 1.9;
	font-size: var(--font-size-small);
	overflow-wrap: anywhere;
}

@media (max-width: 480px) {
	.home-archive {
		padding: 18px;
		margin-top: 28px;
	}

	.archive-card {
		padding: 14px;
	}
}

.saved-life-close {
	position: absolute;
	top: -16px;
	right: -16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: var(--font-size-title-middle);
	line-height: 1;
	cursor: pointer;
}

.saved-life-close:hover {
	background: var(--bg);
}

.saved-life > .album-chapter, .saved-life > h2 {
	padding-right: 36px;
}

/* Player appearance is shared by the resting and traveling board piece. */
.board .token {
	width: 50%;
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	filter: drop-shadow(1px 2px 0 var(--shadow-translucent));
	pointer-events: none;
	top: 50%;
	left: 50%;
	bottom: auto;
	right: auto;
	transform: translate(-50%, -50%);
	z-index: 4;
}

.board .travel-token {
	width: 60px;
	height: 80px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	filter: drop-shadow(1px 2px 0 var(--shadow-translucent));
	pointer-events: none;
}

.board .token .player-avatar, .board .travel-token .player-avatar {
	width: 100%;
	height: 100%;
	display: block;
}

/* Family members and their always-visible details. */
.house-resident {
	cursor: default;
	color: var(--ink);
}

.house-resident span {
	max-width: 100%;
	background: #fffdf7eb;
	font-size: var(--font-size-tiny);
	line-height: 1.5;
	overflow-wrap: anywhere;
	box-shadow: 1px 1px 0 #9c886455;
}

.family-heart {
	color: #b46d77;
	font-weight: 700;
}

.house-resident.is-departed img {
	opacity: 0.35;
	filter: grayscale(1);
}

.house-resident.is-departed span {
	color: var(--muted);
}

.house-resident .family-bubble {
	display: grid;
	color: var(--ink);
	font-size: var(--font-size-tiny);
	line-height: 1.6;
	pointer-events: none;
	z-index: 40;
	position: static;
	transform: none;
	width: 100%;
	min-width: 0;
	border: 0;
	box-shadow: none;
	background: transparent;
	justify-content: center;
}

.house-resident .family-bubble span {
	background: transparent;
	color: var(--ink);
	box-shadow: none;
	padding: 0;
}

.house-resident .family-bubble .family-heart {
	color: #b46d77;
	justify-self: center;
}

.board-center-scene {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
	min-height: 0;
	width: 100%;
	gap: 3px;
	position: relative;
}

.board-center.has-story {
	justify-content: flex-start;
	overflow: hidden;
	padding: var(--space-3);
	gap: 14px;
}

.board-story {
	width: 100%;
	flex-shrink: 0;
	text-align: left;
	padding: var(--space-1) var(--space-3) 14px;
	border-bottom: 1px solid var(--line);
}

.board-story h3 {
	margin: 0 0 var(--space-4);
	font-size: var(--font-size-big);
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.board-story-body {
	min-height: 5.4em;
	margin: 0;
	font-size: var(--font-size-small);
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.board-story .event-effects {
	justify-content: flex-start;
}

.board-center.has-story .landscape {
	max-height: 60px;
}

.board-center.has-story .center-note {
	display: none;
}

/* Accessibility utilities */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.board-story-log {
	overscroll-behavior: contain;
	text-align: left;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #a9b49a #eeeee2;
	scrollbar-gutter: stable;
	height: calc((var(--log-slot-height) + var(--log-slot-margin)) * 2);
	min-height: calc((var(--log-slot-height) + var(--log-slot-margin)) * 2);
	max-height: calc((var(--log-slot-height) + var(--log-slot-margin)) * 2);
	flex: 0 0 auto;
	scroll-snap-type: none;
	--log-slot-height: 80px;
	--log-slot-margin: 6px;
	border: 0;
	width: 100%;
	background: transparent;
	scroll-padding: 4px;
}

.board-story-log .board-story {
	position: relative;
	box-sizing: border-box;
	height: auto;
	min-height: 0;
	max-height: none;
	overflow: visible;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-content: start;
	margin: 0 0 var(--log-slot-margin);
	padding: 5px var(--space-3);
	border: 2px solid #d1d5bc;
	border-radius: var(--radius-small);
	background: #fffdf3;
}

.board-story-log .board-story small {
	color: var(--muted);
	font-size: var(--font-size-tiny);
	display: block;
	line-height: 1.4;
}

.board-center.has-story .board-center-scene {
	min-height: 0;
	flex: 1 1 auto;
	padding: 0;
	justify-content: center;
}

.board-story-log .board-story .delta {
	line-height: 1.4;
	padding: 2px var(--space-1);
	font-size: var(--font-size-tiny);
	background: #d9e3c7;
	color: #3a5d39;
	border: 0;
	border-radius: 3px;
	font-weight: 700;
}

.board-story-log .board-story .event-effects {
	text-align: right;
	top: 6px;
	right: 8px;
	gap: 3px;
	justify-content: flex-end;
	position: static;
	max-width: none;
	grid-column: 2;
	grid-row: 1;
	margin: 0;
}

.board-story-log:focus-visible {
	outline: 2px solid var(--green);
	outline-offset: -2px;
}

/* Keep all events scrollable, with a viewport sized to the latest two. */
.board-center.has-story .board-center-scene .landscape {
	width: 82%;
	max-height: 85px;
}

.board-story-log .board-story:first-child {
	box-sizing: border-box;
	height: auto;
	min-height: 0;
	max-height: none;
	overflow: visible;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2px 5px;
	align-content: start;
	margin: 0 0 var(--log-slot-margin);
	padding: var(--space-2) var(--space-3);
	border: 2px solid #d1d5bc;
	border-radius: var(--radius-small);
	background: #fffdf3;
}

.board-story-log .board-story.is-latest {
	background: #f1edde;
	border-color: var(--line);
	border-inline-start-color: var(--stage-accent);
	border-inline-start-width: 3px;
}

.board-story-log .board-story > small {
	top: 9px;
	left: 8px;
	position: static;
	max-width: none;
	grid-column: 1;
	grid-row: 1;
	align-self: center;
}

/* Individual events expand for their text; only the full log scrolls. */
.action-panel {
	border: 1px solid var(--line);
	margin-top: var(--space-5);
	width: 100%;
	padding: 14px;
	box-shadow: inset 0 0 0 2px #e6e8d3, 2px 3px #c8ceb8;
	background: var(--paper);
}

.action-panel h2 {
	line-height: 1.6;
	display: inline-block;
	font-size: var(--font-size-big);
	margin: 0 var(--space-4) var(--space-2) 0;
}

.action-help {
	line-height: 1.7;
	display: inline;
	font-size: var(--font-size-tiny);
}

.action-status {
	line-height: 1.7;
	background: var(--bg);
	color: var(--green);
	display: inline-block;
	margin: 0 0 var(--space-3) var(--space-2);
	padding: 3px 6px;
	font-size: var(--font-size-tiny);
}

.action-list {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: var(--space-2);
}

.action-list button {
	display: grid;
	gap: 3px;
	align-content: center;
	text-align: left;
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
	cursor: pointer;
	padding: var(--space-2);
	min-height: 0;
	justify-content: center;
}

.action-list strong {
	line-height: 1.5;
	font-size: var(--font-size-tiny);
	font-weight: 700;
	word-break: keep-all;
}

.action-list small {
	font-size: var(--font-size-tiny);
	line-height: 1.5;
}

.action-list button:disabled {
	cursor: default;
	background: #eeeee4;
	color: #858979;
	border-color: var(--line);
	box-shadow: none;
	opacity: 0.7;
}

.action-condition {
	color: var(--muted);
}

.action-list button:not(:disabled) {
	background: var(--green);
	color: var(--paper);
	border: 2px solid #354d36;
	box-shadow: inset 0 2px #a9b98c, inset 2px 0 #94aa7b, 0 3px #354b36;
	border-radius: 3px;
	font-weight: 700;
	text-shadow: 1px 1px #3b5138;
}

.action-list button:not(:disabled):active {
	transform: translateY(2px);
	box-shadow: 0 1px 0 #354637;
}

.action-list button:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
}

.event-modal.records-modal {
	display: flex;
	max-height: 90dvh;
	overflow: hidden;
}

.records-dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 0;
	text-align: left;
}

.records-dialog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	flex-shrink: 0;
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--line);
}

.records-dialog-header .panel-title {
	margin: 0;
}

.records-dialog .records {
	display: block;
	min-height: 0;
	max-height: min(65dvh, 610px);
	padding-inline: 4px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.records-dialog .records:focus-visible {
	outline: 2px solid var(--green);
	outline-offset: -2px;
}

.records-dialog .record {
	min-width: 0;
	overflow-wrap: anywhere;
}

.records-dialog .record summary {
	min-height: 44px;
}

.records-dialog-close {
	flex: 0 0 44px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: var(--font-size-title-middle);
	line-height: 1;
	cursor: pointer;
}

.records-dialog-close:hover {
	background: var(--bg);
}

.house-resident img {
	width: 40px;
	height: 50px;
	object-fit: contain;
	image-rendering: pixelated;
	filter: none;
}

/* Self-contained SVG portraits include the face and eyes. */
.family-sprite {
	display: inline-block;
	flex-shrink: 0;
	width: 40px;
	height: auto;
	object-fit: contain;
	image-rendering: pixelated;
	position: relative;
}

.house-resident > .family-sprite {
	padding: 0;
	background-color: transparent;
	box-shadow: none;
	max-width: none;
}

.house-resident.is-departed > .family-sprite {
	background-color: transparent;
}

.portrait .family-sprite {
	width: 30px;
	height: auto;
	image-rendering: auto;
}

.primary:hover, .action-list button:not(:disabled):hover {
	background: linear-gradient(#7e976b, #597950);
}

/* Game layout theme overrides (keep after earlier responsive rules) */
.play {
	margin: auto;
	max-width: 1280px;
	padding: 24px 0 0 0;
	display: grid;
	overflow-anchor: none;
	grid-template-columns: 250px minmax(0, 1fr);
	column-gap: 22px;
}

.play-heading .eyebrow {
	font-size: var(--font-size-tiny);
	letter-spacing: 0;
}

.play-heading .stage-tag {
	display: none;
}

.play:not(.is-complete) .play-heading .player-heading {
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.play-heading .completion-button {
	width: 100%;
	padding: 6px;
	font-size: var(--font-size-tiny);
}

.completion-heading {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	column-gap: var(--space-4);
	row-gap: var(--space-2);
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.completion-heading h1 {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	column-gap: var(--space-2);
}

.completion-heading h1 span {
	margin-left: 0;
}

.completion-heading > .player-statuses {
	grid-column: 1 / -1;
	margin: 0;
}

.completion-heading .completion-button {
	grid-column: 1 / -1;
	justify-self: start;
	width: fit-content;
	min-height: 44px;
	margin: 0;
	padding-inline: var(--space-3);
	font-size: max(12px, var(--font-size-small));
}

@media (min-width: 761px) {
	.play.is-complete > .completion-heading {
		position: static;
		grid-column: 1 / -1;
		grid-row: 1;
		margin-bottom: 0;
	}

	.play.is-complete > .stats {
		grid-row: 2;
		margin-bottom: 0;
	}

	.play.is-complete .family-panel {
		grid-column: 1;
		grid-row: 2 / span 2;
	}

	.play.is-complete .board-panel {
		grid-column: 2;
		grid-row: 3;
	}
}

@media (min-width: 761px) {
	.completion-heading {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	}

	.completion-heading > .player-statuses {
		grid-column: 2;
		grid-row: 1;
	}
}

@media (max-width: 480px) {
	.completion-heading .completion-button {
		width: 100%;
	}
}

.stats {
	padding: var(--space-5) var(--space-2);
	grid-column: 2;
	grid-row: 1;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 0;
	margin: 0 0 20px;
	border: 3px solid #6a7c5e;
	box-shadow: inset 0 0 0 2px #d9dfc6, 3px 3px #c3c9b0;
	background: var(--paper);
	align-self: stretch;
}

.pixel-stat-icon {
	width: 26px;
	height: 26px;
	display: block;
	image-rendering: pixelated;
}

.play-grid {
	grid-column: 1 / -1;
	align-items: start;
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 22px;
}

.family-panel {
	padding: var(--space-2);
	scrollbar-width: none;
	background: #e8e8d4;
	border: 3px solid #536c4e;
	box-shadow: inset 0 0 0 2px #b9c7a5, 3px 3px #c0c8af;
}

.family-panel::-webkit-scrollbar {
	display: none;
}

.family-banner {
	padding: var(--space-3) var(--space-4);
	margin: -3px -3px var(--space-2);
	color: #fff9e7;
	background: linear-gradient(#627c53, #435d42);
	border: 2px solid #839773;
	box-shadow: inset 0 0 0 1px #c1cda7;
	font-size: var(--font-size-big);
}

.family-banner > span {
	color: #edf2dc;
}

/* Family theme overrides */
.family-room-art {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1.15;
	object-fit: cover;
	border: 2px solid #9b9879;
	image-rendering: pixelated;
}

.house-resident > span:not(.family-sprite):not(.family-bubble) {
	color: var(--ink);
}

.board-panel {
	min-width: 0;
}

.board-top {
	display: flex;
	justify-content: space-between;
	color: #89937d;
	margin: 0 0 7px;
	font-size: var(--font-size-tiny);
	margin-bottom: 7px;
}

.cell::before {
	content: attr(data-position);
	position: absolute;
	top: 3px;
	left: 5px;
	font-size: 10px;
	font-weight: 700;
	color: #687958;
}

.cell-icon .pixel-stat-icon {
	width: 27px;
	height: 27px;
}

.board-center.has-story .board-center-scene h2 {
	margin: 3px 0;
}

.board-story-log .board-story .delta.negative {
	color: #8a5547;
	background: #eee0cd;
}

.action-help br {
	display: none;
}

.board-story-log .board-story h3 {
	font-weight: 700;
	font-size: var(--font-size-small);
	line-height: 1.5;
	margin: 0;
	grid-column: 1 / -1;
}

.board-story-log .board-story-body {
	min-height: 0;
	margin: 0;
	word-break: keep-all;
	font-size: var(--font-size-small);
	line-height: 1.65;
	grid-column: 1 / -1;
	overflow-wrap: anywhere;
}

@media (max-width: 760px) {
	.board .token, .board .travel-token {
		width: 31.5px;
		height: 42px;
	}

	.board-story {
		padding: 0 2px var(--space-4);
	}

	.board-story h3 {
		font-size: var(--font-size-middle);
	}

	.board-center.has-story .board-center-scene .landscape {
		display: block;
		width: 70%;
		max-height: 48px;
	}

	.board-center.has-story .board-center-scene {
		padding-top: 0;
		padding-bottom: 0;
		gap: 2px;
	}

	.play-grid[data-tab='family'] .action-panel {
		display: none;
	}

	.board-story-log .board-story h3, .board-story-log .board-story-body {
		font-size: calc(var(--font-size-small) - 1px);
	}

	.board-story-log .board-story > small, .board-story-log .board-story .delta {
		font-size: calc(var(--font-size-tiny) - 1px);
	}

	.top {
		height: auto;
		min-height: 70px;
		padding: var(--space-3) 14px 0;
		gap: var(--space-3);
		flex-wrap: wrap;
	}

	.play {
		display: block;
		padding: var(--space-5) var(--space-3);
	}

	.play-heading {
		margin-bottom: 14px;
	}

	.stats {
		padding: var(--space-2) var(--space-1);
		gap: 0;
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		margin-bottom: var(--space-5);
	}

	.stats > .stat:nth-child(n + 4) {
		border-top: 1px solid #a6b091;
	}

	.stat {
		flex-direction: column;
		gap: 2px;
		padding: 6px 1px;
	}

	.stat .pixel-stat-icon {
		width: 20px;
		height: 20px;
	}

	.stat small {
		font-size: 10px;
	}

	.play-grid {
		display: block;
	}

	.mobile-tabs {
		display: flex;
		gap: 6px;
		margin: 0 0 14px;
	}

	.cell::before {
		font-size: 8px;
		top: 1px;
		left: 2px;
	}

	.cell-icon .pixel-stat-icon {
		width: 19px;
		height: 19px;
	}

	.board-center, .board-center.has-story {
		padding: var(--space-2);
		gap: var(--space-3);
	}

	.board-center .roll {
		font-size: var(--font-size-small);
		gap: var(--space-2);
		white-space: nowrap;
		min-height: 44px;
		padding: 5px 0px;
	}

	.board-story-log {
		--log-slot-height: 78px;
		flex: 0 1 auto;
		height: calc((var(--log-slot-height) + var(--log-slot-margin)) * 2);
		min-height: 0;
		max-height: calc((var(--log-slot-height) + var(--log-slot-margin)) * 2);
		overflow-y: auto;
		overflow-x: hidden;
		overscroll-behavior: contain;
		scrollbar-gutter: auto;
		scroll-snap-type: none;
	}

	.board-center:not(.has-story) > .board-story-log {
		height: auto;
		max-height: none;
	}

	.board-story-log .board-story, .board-story-log .board-story:first-child {
		padding: 7px;
		height: auto;
		min-height: 0;
		max-height: none;
		overflow: visible;
	}

	.action-panel {
		padding: var(--space-4);
		margin-top: 14px;
	}

	.action-panel h2 {
		display: block;
		font-size: 17px;
	}

	.action-help {
		display: block;
	}

	.action-status {
		margin-left: 0;
	}

	.action-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.action-list button {
		min-height: 0;
	}

	.family-room-art {
		aspect-ratio: 1.6;
	}

	.stats .stat.stress {
		grid-column: 1 / -1;
		border-top: 1px solid #a6b091;
		flex-direction: row;
		padding: 6px 1px;
		gap: 2px;
	}

	.stats .stat.stress div {
		display: flex;
	}

	.stats .stat.stress .stat-icon {
		height: auto;
	}

	.stats .stat.stress strong {
		font-size: 15px;
	}

	.board {
		padding: 5px;
		border-width: 3px;
		gap: 1px;
		aspect-ratio: 0.8;
	}
}

@media (min-width: 761px) {
	/* Keep the character heading sticky within the whole play area. */ .play-grid {
		display: contents;
	}

	.play-heading {
		position: sticky;
		top: 10px;
		z-index: 5;
		align-self: start;
	}

	.family-panel {
		align-self: start;
	}
}

@media (min-width: 761px) and (max-width: 1100px) {
	.play {
		grid-template-columns: 190px minmax(0, 1fr);
		padding: var(--space-5);
		gap: var(--space-5);
	}

	.play-grid {
		grid-template-columns: 190px minmax(0, 1fr);
		gap: var(--space-5);
	}

	.stat {
		flex-direction: column;
		align-items: center;
		gap: 3px;
		padding: var(--space-2) 2px;
		text-align: center;
	}

	.stat .pixel-stat-icon {
		width: 20px;
		height: 20px;
	}

	.stat small {
		font-size: 11px;
		white-space: nowrap;
	}

	.action-list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.primary, .action-list button {
		transition: none;
	}
}

/* Center each family sprite and keep its label independently below it. */
/* Family tree: each nested list belongs to the person directly above it. */
.family-tree-viewport {
	max-width: 100%;
	overflow-x: auto;
	padding: 12px 0;
}

.family-tree {
	position: relative;
	width: max-content;
	min-width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.family-tree-couple {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	gap: 14px;
}

.family-tree .family-tree-branches {
	display: flex;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 5px 0 0;
	position: relative;
}

.family-tree-branches > li {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 13.5px 6px 0;
}

.family-tree .family-tree-node, .family-tree-separate .family-tree-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	position: relative;
	width: 68px;
	min-width: 68px;
	min-height: 108px;
	padding: 6px 3px;
	gap: 1px;
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	z-index: 1;
}

.family-tree-node > .family-sprite, .family-tree-node > .assembled-avatar {
	width: 37.5px;
	height: 60px;
	object-fit: contain;
	margin-bottom: 3px;
}

.family-tree-node > .assembled-avatar {
	flex: 0 0 60px;
}

.family-tree-node > span:not(.family-bubble), .family-tree-node > small {
	max-width: 100%;
	font-size: var(--font-size-tiny);
	white-space: normal;
	overflow-wrap: anywhere;
	text-align: center;
	line-height: 1.4;
}

.family-tree-node > small {
	color: var(--muted);
}

.family-tree-lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
}

.family-tree-lines path {
	fill: none;
	stroke: var(--green);
	stroke-width: 1.5;
	vector-effect: non-scaling-stroke;
}

.family-tree-node > span:not(.family-bubble) {
	background: transparent;
	box-shadow: none;
	padding: 0;
	font-weight: 700;
	color: var(--daily-accent);
}

.family-tree-separate {
	margin-top: 9px;
	padding-top: 9px;
	border-top: 1px solid var(--line);
}

.family-tree-separate .family-tree-couple {
	flex-wrap: wrap;
	gap: 8px;
}

.family-tree-separate .family-tree-couple > *::before {
	display: none;
}

.avatar-preview #avatar-preview {
	padding: var(--space-4);
	background: radial-gradient(ellipse at 50% 90%, #bcc7a855 0, transparent 65%);
}

.avatar-options button[aria-pressed='true'] {
	background: #dbe5ca;
	border-color: #5d7850;
	color: #30462f;
	box-shadow: inset 0 0 0 1px #edf1e0;
}

/* Avatar layers and action components */
.assembled-avatar > .avatar-layer {
	width: 96px;
	height: 128px;
	image-rendering: auto;
	pointer-events: none;
}

.assembled-avatar {
	image-rendering: auto;
}

.fixed-action-heading {
	color: #665775;
}

@media (min-width: 961px) {
	.action-panel .action-list {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.fixed-action-list button:not(:disabled) {
	border-color: #8c7c9a;
	background: linear-gradient(#eee8f3, #ded3e7);
	color: #493b58;
	text-shadow: none;
	box-shadow: inset 0 2px #faf7fc, 0 3px #a99ab5;
}

.fixed-action-list button:not(:disabled):hover {
	background: linear-gradient(#e8dff0, #d6c7e2);
}

.fixed-action-list button:not(:disabled):active {
	box-shadow: inset 0 1px #faf7fc, 0 1px #a99ab5;
}

.fixed-action-list button:focus-visible {
	outline-color: #79638d;
}

.fixed-action-list button:disabled {
	background: #eeeaf0;
	color: #807589;
	border-color: #c8bfce;
	opacity: 1;
}

.fixed-action-list button.is-complete:disabled {
	background: #e8e8e2;
	color: #75776c;
	border-color: #c4c7ba;
}

.partner-status {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	margin-top: var(--space-1);
	padding: 3px var(--space-2);
	border: 1px solid #c9b8c4;
	border-radius: var(--radius-small);
	background: #f0e5ec;
	color: #705267;
	line-height: 1.4;
	font-size: var(--font-size-tiny);
}

.partner-status.no-partner {
	background: #eeeee7;
	border-color: #c6c9bc;
	color: #6c7263;
}

.board-roll-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	width: 100%;
	flex-shrink: 0;
	margin-bottom: 0;
	flex-direction: column;
}

.board-center .board-roll-controls .roll {
	margin-top: 0;
	width: min(100%, var(--board-action-width));
	gap: var(--space-4);
}

.board-center .regression-card {
	width: min(100%, var(--board-action-width));
	padding: 3px var(--space-2);
	font-size: var(--font-size-tiny);
}

.board-roll-controls .roll .roll-dice {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 1px solid currentColor;
	border-radius: var(--radius-small);
	background: #ffffff12;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	text-shadow: none;
}

.daily-action-disclosure {
	width: 100%;
	flex-shrink: 0;
	min-width: 0;
}

.daily-action-trigger {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-1);
	min-height: 38px;
	padding: 6px var(--space-2);
	border: 2px solid #b59565;
	background: #ecd7b4;
	color: #674b30;
	font-size: var(--font-size-small);
	font-weight: 700;
	cursor: pointer;
	box-shadow: inset 0 1px #fff3dd, 0 2px #a68b66;
	border-radius: 3px;
	width: 100%;
}

.daily-action-trigger:focus-visible {
	outline: 2px solid var(--green);
	outline-offset: 2px;
}

/* Golden yellow palette for the daily choices. */
.daily-action-disclosure:has(#daily-action-options) {
	--daily-yellow: #e8b629;
	--daily-yellow-light: #f8df87;
	--daily-yellow-border: #a67a19;
	--daily-yellow-ink: #503a12;
}

.daily-action-trigger[aria-controls='daily-action-options'] {
	background: var(--daily-yellow);
	color: var(--daily-yellow-ink);
	border-color: var(--daily-yellow-border);
	box-shadow: inset 0 1px #fff0b2, 0 2px #9a721b;
}

.daily-action-trigger[aria-controls='daily-action-options']:hover {
	background: #f0c13d;
}

#daily-action-options {
	background: var(--daily-yellow-light);
	color: var(--daily-yellow-ink);
	border-color: var(--daily-yellow-border);
	box-shadow: inset 0 0 0 2px #ffecab, 2px 3px #b58b2c;
	scrollbar-color: var(--daily-yellow-border) var(--daily-yellow-light);
}

#daily-action-options .action-status {
	background: #efd06a;
	color: var(--daily-yellow-ink);
	border-color: var(--daily-yellow-border);
}

#daily-action-options .action-list button:not(:disabled) {
	background: linear-gradient(#f2c846, var(--daily-yellow));
	color: var(--daily-yellow-ink);
	border-color: var(--daily-yellow-border);
	box-shadow: inset 0 1px #fff0b2, 0 2px var(--daily-accent);
	text-shadow: none;
}

#daily-action-options .action-list button:not(:disabled):hover {
	background: linear-gradient(#ffdb63, #edbd32);
}

#daily-action-options .action-list button:not(:disabled):active {
	box-shadow: inset 0 1px #f4ce65, 0 1px var(--daily-accent);
}

#daily-action-options .action-list button:disabled {
	background: #e7d59b;
	color: #78673c;
	border-color: #bcaa70;
	text-shadow: none;
}

#daily-action-options .action-list button:focus-visible {
	outline-color: var(--daily-yellow-ink);
}

#daily-action-options .action-list .partner-daily-action:not(:disabled) {
	background: linear-gradient(#f8dfc3, #edc49e);
	color: #68452d;
	border-color: #bc8c64;
	box-shadow: inset 0 1px #fff1e1, 0 2px #b9855d;
}

#daily-action-options .action-list .partner-daily-action:not(:disabled):hover {
	background: linear-gradient(#fbe7d1, #f1cfad);
}

#daily-action-options .action-list .partner-daily-action:not(:disabled):active {
	box-shadow: inset 0 1px #edc49e, 0 1px #b9855d;
}

#daily-action-options .action-list .partner-daily-action:disabled {
	background: #e9d7c5;
	color: #806a57;
	border-color: #bea58d;
}

#daily-action-options .action-list .partner-daily-action:focus-visible {
	outline-color: #68452d;
}

#daily-action-options::-webkit-scrollbar-track {
	background: var(--daily-yellow-light);
}

#daily-action-options::-webkit-scrollbar-thumb {
	background: var(--daily-yellow-border);
	border-color: var(--daily-yellow-light);
}

/* Muted rose keeps the once-only challenges distinct without a vivid red. */
.daily-action-disclosure:has(#fixed-action-options) {
	--challenge-red: #d6a09a;
	--challenge-red-light: #f2dcd6;
	--challenge-red-border: #b77e77;
	--challenge-red-ink: #623c38;
}

.daily-action-trigger[aria-controls='fixed-action-options'] {
	background: var(--challenge-red);
	color: var(--challenge-red-ink);
	border-color: var(--challenge-red-border);
	box-shadow: inset 0 1px #fae3dd, 0 2px var(--challenge-accent);
}

.daily-action-trigger[aria-controls='fixed-action-options']:hover {
	background: #dfb0a8;
}

#fixed-action-options {
	background: var(--challenge-red-light);
	color: var(--challenge-red-ink);
	border-color: var(--challenge-red-border);
	box-shadow: inset 0 0 0 2px #fbeae5, 2px 3px #c1958c;
	scrollbar-color: var(--challenge-red-border) var(--challenge-red-light);
}

#fixed-action-options .daily-action-heading h2 {
	color: var(--challenge-red-ink);
}

#fixed-action-options .action-status {
	background: #e7bfb6;
	color: var(--challenge-red-ink);
	border-color: var(--challenge-red-border);
}

#fixed-action-options .action-list button:not(:disabled) {
	background: linear-gradient(#e5b7ae, var(--challenge-red));
	color: var(--challenge-red-ink);
	border-color: var(--challenge-red-border);
	box-shadow: inset 0 1px #fae3dd, 0 2px var(--challenge-accent);
	text-shadow: none;
}

#fixed-action-options .action-list button:not(:disabled):hover {
	background: linear-gradient(#edc6be, #ddb0a7);
}

#fixed-action-options .action-list button:not(:disabled):active {
	box-shadow: inset 0 1px #e9bbb3, 0 1px var(--challenge-accent);
}

#fixed-action-options .action-list button:disabled {
	background: #e3cbc5;
	color: #826b65;
	border-color: #c2a59e;
	text-shadow: none;
}

#fixed-action-options .action-list button.is-complete:disabled {
	background: #b9827a;
	color: #fff4ee;
	border-color: #a36d65;
	box-shadow: inset 0 1px #d09c94;
	opacity: 1;
}

#fixed-action-options .action-list button.is-complete:disabled small {
	color: #fff4ee;
}

#fixed-action-options .action-list button:focus-visible {
	outline-color: var(--challenge-red-ink);
}

#fixed-action-options::-webkit-scrollbar-track {
	background: var(--challenge-red-light);
}

#fixed-action-options::-webkit-scrollbar-thumb {
	background: var(--challenge-red-border);
	border-color: var(--challenge-red-light);
}

.board-center .daily-action-popover {
	position: static;
	width: 100%;
	margin: var(--space-2) 0 0;
	max-height: clamp(100px, 20vh, 160px);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	text-align: left;
	word-break: keep-all;
	overflow-wrap: anywhere;
	scrollbar-width: thin;
	scrollbar-color: var(--green) var(--line);
}

.daily-action-close {
	display: block;
	margin: 0 0 var(--space-2) auto;
}

@media (max-width: 380px) {
	.board-center.has-story .board-center-scene > h2 {
		display: none;
	}

	.board-center.has-story .board-roll-controls .roll {
		min-height: 44px;
		padding: var(--space-1) var(--space-3);
	}

	.board-center.has-story .daily-action-trigger {
		min-height: 44px;
		padding: var(--space-1);
	}
}

.daily-action-trigger:hover {
	background: #e4c99f;
}

.daily-action-trigger:active {
	transform: translateY(1px);
	box-shadow: inset 0 1px #fff3dd, 0 1px #a68b66;
}

.daily-action-popover[hidden] {
	display: none;
}

.board-action-menu-buttons {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: min(100%, var(--board-action-width));
	margin-top: 5px;
	flex-shrink: 0;
}

.board-action-menu-buttons.has-fixed-challenges {
	grid-template-columns: minmax(0, 1fr);
	width: min(100%, var(--board-action-width));
}

.fixed-challenge-trigger {
	background: #e6dced;
	color: #594569;
	border-color: #a18bb1;
	box-shadow: inset 0 1px #f8f2fc, 0 2px #9a83aa;
}

.fixed-challenge-trigger:hover {
	background: #dbcee5;
}

.fixed-challenge-trigger:active {
	box-shadow: inset 0 1px #f8f2fc, 0 1px #9a83aa;
}

@media (max-width: 760px) {
	.board-action-menu-buttons .daily-action-trigger {
		font-size: 12px;
		min-height: 44px;
	}

	.daily-action-content::-webkit-scrollbar {
		width: 10px;
	}

	.daily-action-content::-webkit-scrollbar-track {
		background: var(--line);
		border-radius: var(--radius-medium);
	}

	.daily-action-content::-webkit-scrollbar-thumb {
		background: var(--green);
		border: 2px solid var(--line);
		border-radius: var(--radius-medium);
	}
}

/* Status and career components */
.player-statuses {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	margin-top: var(--space-1);
}

.player-statuses .partner-status {
	margin-top: 0;
}

.player-statuses .partner-controls {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 6px;
	max-width: 100%;
}

.player-statuses .partner-controls .partner-status {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.player-statuses .breakup-button {
	flex-shrink: 0;
	white-space: nowrap;
	min-height: 0;
	margin: 0;
	padding: 3px var(--space-2);
	gap: 0;
	border: 1px solid #bc7e76;
	border-radius: var(--radius-small);
	background: linear-gradient(#fae7e2, #efd0c8);
	color: #823a33;
	box-shadow: inset 0 1px #fff5f0, inset 0 -1px #c18d83;
	font-size: var(--font-size-tiny);
	font-weight: 700;
	line-height: 1.4;
	text-shadow: none;
	transition: background-color 0.15s, border-color 0.15s;
}

.player-statuses .breakup-button:hover:not(:disabled) {
	background: #f0d5cf;
	border-color: #b9766f;
	color: #7d302d;
}

.player-statuses .breakup-button:active:not(:disabled) {
	background: #e8c5be;
	box-shadow: inset 0 1px 2px #c99b90;
}

.player-statuses .breakup-button:focus-visible {
	outline: 2px solid #b45c54;
	outline-offset: 2px;
}

.school-group-status, .career-status {
	display: inline-flex;
	align-items: center;
	padding: 3px var(--space-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-small);
	font-size: var(--font-size-tiny);
	line-height: 1.4;
}

.school-group-status {
	background: #eee0d9;
	color: #785547;
	border-color: #d0b6aa;
}

.career-status {
	background: #e8ecde;
	color: var(--ink);
}

.occupation-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-2);
	margin-bottom: var(--space-5);
}

.occupation-options button {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.occupation-options small {
	font-size: var(--font-size-tiny);
}

.choice-requirement {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 4px 10px;
	width: 100%;
}

.choice-requirement-value {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.choice-requirement.is-met {
	color: #365b35;
}

.choice-requirement.is-unmet {
	color: #94551b;
}

.graduation-requirements {
	margin-top: var(--space-5);
	padding: 0 var(--space-3);
	border: 1px solid var(--line);
	border-block-start-style: dashed;
	background: var(--bg);
	text-align: left;
}

.graduation-requirements summary {
	min-height: 44px;
	padding-block: var(--space-3);
	font-weight: 700;
	cursor: pointer;
}

.graduation-requirement-list {
	display: grid;
	gap: var(--space-2);
	padding-bottom: var(--space-3);
}

.graduation-requirement-list p {
	margin: 0;
}

.graduation-tier {
	padding: var(--space-3);
	border: 1px solid var(--line);
	border-radius: var(--space-2);
}

.graduation-tier-heading {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-2);
	margin-bottom: var(--space-1);
}

.graduation-tier-status {
	flex-shrink: 0;
	font-size: var(--font-size-tiny);
}

.graduation-tier.is-met .graduation-tier-status {
	color: #365b35;
}

.graduation-tier.is-unmet .graduation-tier-status {
	color: #94551b;
}

.graduation-tier .choice-requirement {
	justify-content: space-between;
}

.occupation-status {
	display: inline-flex;
	align-items: center;
	padding: 3px var(--space-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-small);
	background: #eee4cf;
	color: var(--ink);
	font-size: var(--font-size-tiny);
	line-height: 1.4;
}

@media (max-width: 480px) {
	.occupation-options {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Career routes use the same folded paper as the chapter album. */
.event-modal.career-modal {
	width: min(790px, 100%);
}

.career-sheet {
	--route-color: #4f6047;
	--route-paper: #edf0e3;
	font-size: max(13px, var(--font-size-small));
	line-height: 1.55;
	text-align: left;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.career-sheet > p {
	max-width: 60ch;
	margin-block: 0 var(--space-4);
}

.career-sheet-heading, .job-postings-heading, .job-posting-heading, .career-route-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
}

.career-sheet-heading {
	align-items: start;
	margin-bottom: var(--space-2);
}

.career-sheet-heading h2, .career-sheet-heading button, .job-postings-heading h3 {
	margin: 0;
}

.career-sheet-heading button {
	flex: 0 0 auto;
	padding-inline: var(--space-3);
}

.career-map-origin {
	display: grid;
	grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
	align-items: center;
	gap: var(--space-2);
	margin-block: var(--space-5) var(--space-2);
}

.career-map-origin::before, .career-map-origin::after {
	content: '';
	border-block-start: 2px dashed #b8aa8a;
}

.career-map-origin p {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: var(--space-2) var(--space-5);
	background: #efe7d1;
	text-align: center;
}

.career-map-origin small, .job-postings-heading small {
	font-size: 12px;
}

.career-map, .job-postings {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3);
}

.career-route, .job-posting {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: var(--space-2);
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: var(--space-3) 12px;
	border: 1px solid var(--line);
	border-inline-start: 4px solid var(--route-color);
	border-radius: var(--radius-small);
	background: var(--route-paper);
	color: var(--ink);
	box-shadow: 0 2px var(--paper-fold);
	line-height: 1.5;
	text-align: left;
	overflow-wrap: anywhere;
}

[data-track='humanities-social'] { --route-color: #676032; --route-paper: #f2eedb; }
[data-track='natural-medical'] { --route-color: #396853; --route-paper: #e7f1e7; }
[data-track='engineering'] { --route-color: #3e6682; --route-paper: #e8eff2; }
[data-track='performing-arts'] { --route-color: #884c45; --route-paper: #f5e9e5; }
[data-track='fine-art'] { --route-color: #71518a; --route-paper: #f0e8f2; }
[data-track='music'] { --route-color: #60508d; --route-paper: #ebe8f5; }
[data-track='sports'] { --route-color: #496b34; --route-paper: #eef2e2; }
[data-track='vocational'] { --route-color: #825a2e; --route-paper: #f4ebd9; }

.career-route-heading {
	justify-content: start;
	font-size: 15px;
	color: var(--route-color);
}

.career-route-heading img {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
}

.career-route:not(:disabled):hover, .job-posting:hover {
	border-color: var(--route-color);
	box-shadow: 0 3px var(--route-color);
}

.career-route:disabled {
	opacity: 1;
	background: var(--paper);
	border-inline-start-style: dashed;
	color: var(--muted);
	cursor: default;
}

.career-route small, .job-posting small {
	font-size: 12px;
}

.career-route-next {
	color: var(--muted);
}

.career-route-free {
	font-weight: 700;
}

.career-route .choice-requirement, .job-posting .choice-requirement {
	justify-content: space-between;
	border-top: 1px solid var(--line);
	padding-top: var(--space-1);
}

.career-route .choice-requirement-value, .job-posting .choice-requirement-value {
	white-space: normal;
}

.job-postings-heading {
	justify-content: start;
	align-items: baseline;
	flex-wrap: wrap;
	padding-block: var(--space-2);
	border-block-start: 1px solid var(--line);
}

.job-posting {
	background: var(--paper);
}

.job-posting[data-income='middle'] { --route-color: #446968; --route-paper: #e5eeea; }
.job-posting[data-income='high'] { --route-color: #765328; --route-paper: #f1e7d6; }

.job-posting-heading {
	align-items: start;
	flex-wrap: wrap;
}

.job-posting-heading strong {
	font-size: 15px;
}

.job-income {
	padding: 3px 6px;
	background: var(--route-paper);
	color: var(--route-color);
	font-variant-numeric: tabular-nums;
}

.job-description {
	font-weight: 500;
}

.degree-sheet {
	padding-top: var(--space-4);
	border-block-start: 2px dashed var(--line);
}

@media (min-width: 561px) {
	.career-map:not(.degree-map) {
		position: relative;
	}

	.career-map:not(.degree-map)::before {
		content: '';
		position: absolute;
		inset-block: 0;
		left: 50%;
		border-inline-start: 1px dashed #b8aa8a;
	}

	.career-map:not(.degree-map) > .career-route {
		position: relative;
	}

	.career-map:not(.degree-map) > .career-route::after {
		content: '';
		position: absolute;
		top: 25px;
		width: calc(var(--space-3) / 2 + 2px);
		border-block-start: 1px solid var(--route-color);
	}

	.career-map:not(.degree-map) > .career-route:nth-child(odd)::after {
		left: 100%;
	}

	.career-map:not(.degree-map) > .career-route:nth-child(even)::after {
		right: calc(100% + 3px);
	}
}

@media (max-width: 560px) {
	.career-map, .job-postings {
		grid-template-columns: minmax(0, 1fr);
	}

	.career-map-origin {
		grid-template-columns: minmax(0, 1fr);
	}

	.career-map-origin::before, .career-map-origin::after {
		display: none;
	}
}

.education-certificate {
	font-size: max(13px, var(--font-size-small));
	text-align: left;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.education-certificate[data-track]:not([data-track='']) {
	border-block-start: 3px double var(--route-color, #4f6047);
}

.education-certificate-header {
	padding: var(--space-5) var(--space-4);
	border-block: 1px solid var(--line);
	background: var(--route-paper, #edf0e3);
	color: var(--route-color, #4f6047);
}

.education-certificate-header h2 {
	margin: 0;
	font-size: clamp(25px, 5vw, 37px);
}

.education-certificate-header p {
	margin: var(--space-1) 0 0;
	font-weight: 700;
}

.education-certificate-story {
	padding: var(--space-4);
}

.education-certificate-story h3 {
	margin: 0 0 var(--space-2);
	font-size: 16px;
}

.education-certificate-story p {
	margin: 0;
	line-height: 1.65;
}

.education-certificate-story .event-effects, .graduation-immediate .event-effects {
	justify-content: start;
	margin: var(--space-2) 0 0;
}

.graduation-paths {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3);
}

.graduation-path {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	min-width: 0;
	padding: var(--space-4);
	border: 1px solid var(--line);
	border-block-start: 4px solid #77643b;
	background: #f4efde;
	overflow-wrap: anywhere;
}

.graduation-path + .graduation-path {
	border-block-start-color: #466b63;
	background: #e9f0e9;
}

.graduation-path h3, .graduation-path p {
	margin: 0;
}

.graduation-path h3 {
	font-size: 17px;
}

.graduation-path button {
	width: 100%;
	margin-top: auto;
	min-height: 44px;
}

.graduation-sheet > .graduation-movement {
	margin-block: var(--space-3) 0;
}

.graduation-immediate > span {
	font-size: 12px;
	font-weight: 700;
}

@media (max-width: 560px) {
	.event-modal.education-modal {
		padding-block: var(--space-4);
	}

	.graduation-paths {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The scene and action menus are independent flex children of the board center. */
.board-center:has(.daily-action-popover:not([hidden])) {
	justify-content: flex-start;
}

.board-center > .board-action-menu-buttons {
	flex: 1 0 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 3px;
	scrollbar-color: var(--green) var(--line);
}

.board-center .board-action-menu-buttons:has(.daily-action-popover:not([hidden])) {
	width: 100%;
}

.board-action-menu-buttons .daily-action-trigger {
	width: min(100%, var(--board-action-width));
	margin-inline: auto; }

.board-center .daily-action-popover .action-list {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-action-heading, .daily-action-content {
	display: contents;
}

.board-center .daily-action-popover .action-list button {
	justify-content: start;
	padding: var(--space-3);
	font-weight: 500;
}

/* Responsive overrides — query and declaration order is intentional. */
@media (min-width: 761px) {
	.board-panel {
		container-type: inline-size;
	}

	.board {
		aspect-ratio: auto;
		min-height: calc(100cqw / 1.35);
	}

	.board-center {
		min-height: 0;
	}

	.board-center:not(.has-story) > .board-story-log {
		height: auto;
		min-height: 0;
		max-height: none;
	}

	.board-center > .board-center-scene, .board-center.has-story > .board-center-scene {
		flex: 0 0 auto;
		justify-content: center;
	}

	.board-center > .board-action-menu-buttons {
		flex: 0 0 auto;
		margin-top: auto;
		padding-top: var(--space-2);
		grid-auto-rows: auto;
		overflow: visible;
	}

	.board-center > .board-action-menu-buttons > .daily-action-disclosure {
		min-height: 0;
	}

	.board-center > .board-action-menu-buttons .daily-action-popover {
		max-height: none;
		overflow: visible;
	}

	.board-action-menu-buttons.is-always-open .daily-action-trigger, .board-action-menu-buttons.is-always-open .daily-action-close {
		display: none;
	}

	.board-center .daily-action-popover {
		padding: var(--space-2);
	}

	.board-center .daily-action-popover .action-list {
		grid-template-columns: repeat(6, minmax(0, 1fr));
		gap: var(--space-1);
	}

	.board-center .daily-action-popover .action-list button {
		padding: 5px var(--space-1);
		min-width: 0;
		min-height: 46px;
		align-content: center;
		justify-content: stretch;
		text-align: center;
		border-radius: var(--radius-small);
		gap: 2px;
		overflow-wrap: anywhere;
	}

	.board-center .daily-action-popover .action-list strong {
		font-size: 11px;
		line-height: 1.5;
		word-break: keep-all;
	}

	.board-center .daily-action-popover .action-list small {
		font-size: 10px;
		line-height: 1.4;
	}
}

@media (min-width: 761px) and (max-width: 1100px) {
	.board {
		min-height: calc(100cqw / 1.05);
	}

	.board-center .daily-action-popover .action-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.board-center .daily-action-popover .action-list strong {
		font-size: 13px;
	}

	.board-center .daily-action-popover .action-list small {
		font-size: 12px;
	}
}

@media (max-width: 760px) {
	.board-center .daily-action-popover .action-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-1);
	}

	.board-center .daily-action-popover .action-list button {
		min-width: 0;
		padding: 6px 3px;
		min-height: 44px;
		text-align: center;
		justify-content: stretch;
		overflow-wrap: anywhere;
	}

	.board-center > .board-center-controls {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: var(--space-2);
		width: 100%;
		min-height: 0;
		flex: 1 0 auto;
		overflow-y: auto;
		overflow-x: hidden;
		overscroll-behavior: contain;
		scrollbar-width: auto;
		scrollbar-color: var(--green) var(--line);
		padding: 3px;
	}

	.board-center-controls > .board-center-scene, .board-center-controls > .board-action-menu-buttons {
		flex: 0 0 auto;
		gap: 3px;
	}

	.board-center-controls > .board-action-menu-buttons {
		margin-top: auto;
		padding-top: 5px;
	}

	.board-center .board-center-controls .daily-action-popover:not([hidden]) {
		position: absolute;
		bottom: 0;
		left: 0;
		display: grid;
		grid-template-rows: auto minmax(0, 1fr);
		gap: var(--space-2);
		max-height: min(100%, 45vh);
		overflow: hidden;
		padding: var(--space-2);
	}

	.daily-action-heading {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-1);
	}

	.daily-action-heading h2 {
		margin: 0;
		font-size: 16px;
		word-break: keep-all;
	}

	.daily-action-heading .daily-action-close {
		display: grid;
		place-items: center;
		flex: 0 0 44px;
		width: 44px;
		min-height: 44px;
		margin: 0;
		padding: 0;
		font-size: 22px;
		line-height: 1;
	}

	.daily-action-content {
		display: block;
		min-height: 0;
		padding: 3px;
		overflow: auto;
		overscroll-behavior: contain;
		scrollbar-gutter: stable;
	}

	.daily-action-content:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: -2px;
	}

	.daily-action-content .action-help,
	.daily-action-content .action-status,
	.daily-action-content .action-list small {
		font-size: 12px;
	}

	.daily-action-content .action-list strong {
		font-size: 14px;
	}
}

@media (max-width: 350px) {
	.board-center .daily-action-popover .action-list {
		grid-template-columns: minmax(0, 1fr);
	}
}

.board-center #daily-action-options .action-list .is-available strong {
	font-weight: 700;
}

.fixed-action-threshold.is-unmet {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.completion-reflection, .completion-share {
	margin-block: var(--space-4);
	text-align: left;
	overflow-wrap: anywhere;
}

.completion-reflection ul {
	padding-inline-start: 1.4em;
}

.completion-reflection-changes {
	display: block;
	font-size: max(12px, var(--font-size-tiny));
}

.completion-share textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	font: inherit;
	resize: vertical;
}

.completion-share #completion-share-status:empty {
	margin: 0;
}

.completion-letters {
	margin-block: var(--space-4);
	font-size: max(13px, var(--font-size-small));
	text-align: left;
	overflow-wrap: anywhere;
}

.completion-letters > details {
	padding: var(--space-2);
	margin-block: var(--space-2);
	border: 1px solid var(--line);
	border-block-start-style: dashed;
	border-radius: var(--radius-small);
	background: #f8f4e7;
}

.completion-letters summary {
	min-height: 44px;
	padding-block: var(--space-2);
	font-weight: 700;
	cursor: pointer;
}

.completion-letters button {
	min-height: 44px;
}

.completion-letter-memory span, .completion-letter-memory strong {
	display: block;
}

.completion-letter-choices, .completion-letter-replies {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-1);
	min-width: 0;
	margin: 0 0 var(--space-2);
}

.completion-letter-choices label {
	display: flex;
	align-items: center;
	gap: var(--space-1);
	min-height: 44px;
}

.completion-letter-replies button[aria-pressed='true'] {
	border-color: var(--green);
	box-shadow: inset 0 0 0 1px var(--green);
}

.past-letter-list {
	padding-inline-start: 1.4em;
}

#completion-letter-status:empty {
	margin: 0;
}

/* Service navigation stays visible on every game screen. */
.site-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	justify-self: center;
	gap: 18px;
	font-size: var(--font-size-tiny);
}

.site-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	line-height: 1.5;
}

.site-nav a:hover, .site-nav a[aria-current="page"] {
	color: var(--green);
	text-decoration: underline;
	text-underline-offset: 5px;
}

.site-nav a[href="/privacy"] {
	font-weight: 700;
}

@media (max-width: 1100px) {
	.top {
		height: auto;
		min-height: 78px;
		flex-wrap: wrap;
		column-gap: 16px;
	}

	.top > .site-nav {
		order: 3;
		width: 100%;
		gap: 24px;
		border-top: 1px solid var(--line);
	}
}

@media (max-width: 380px) {
	.top > .site-nav {
		gap: 14px;
	}
}

/* Keep the header width stable while restoring the login session. */
.header-auth { display: flex; flex: 0 0 176px; width: 176px; min-height: 44px; align-items: center; justify-content: flex-end; gap: var(--space-2); white-space: nowrap; }

/* Reserve header space while authentication and saved games load. */
.top .save { flex: 0 0 152px; width: 152px; min-height: 18px; line-height: 18px; white-space: nowrap; text-align: right; }
.top > .header-right { flex-wrap: nowrap; }
@media (max-width: 760px) {
 .top > .header-right { display: grid; grid-template-columns: 176px 44px; gap: 6px 8px; }
 .top .header-auth { grid-column: 1; grid-row: 1; }
 .top .icon-button { grid-column: 2; grid-row: 1; width: 44px; min-height: 44px; }
 .top .save { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
}

@media (max-width: 760px) {
	.allocation-row {
		gap: var(--space-1);
		padding-inline: var(--space-2);
	}

	.allocation-row label {
		min-width: 0;
		overflow-wrap: anywhere;
	}

	.allocation-row button, .allocation-row input {
		flex: 0 0 44px;
		width: 44px;
		min-height: 44px;
	}
}

@media (max-width: 480px) {
	.play {
		padding-top: var(--space-4);
	}

	.play-heading, .stats, .mobile-tabs {
		margin-bottom: var(--space-3);
	}

	.stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		padding-block: var(--space-1);
	}

	.stats > .stat {
		padding-block: 3px;
		border: 0;
		border-inline-end: 1px solid var(--line);
	}

	.stats > .stat:nth-child(n + 4) {
		border-block-start: 0;
	}

	.stats > .stat:nth-child(n + 5) {
		border-block-start: 1px solid var(--line);
	}

	.stats > .stat:nth-child(4), .stats > .stat.stress {
		border-inline-end: 0;
	}

	.stats > .stat.stress {
		grid-column: span 2;
		padding-block: 3px;
	}
}

@media (max-width: 380px) {
	.top {
		column-gap: var(--space-2);
		padding-inline: var(--space-4);
	}

	.top > .logo {
		flex: 0 0 auto;
	}

	.top > .header-right {
		flex: 1 1 0;
		min-width: 0;
		grid-template-columns: minmax(44px, 1fr) 44px;
	}

	.top .header-auth {
		width: auto;
		min-width: 0;
		flex-wrap: wrap;
		white-space: normal;
	}

	.top .auth-user, .top .auth-button {
		max-width: 100%;
		white-space: normal;
		overflow-wrap: anywhere;
	}
}

html { scrollbar-gutter: stable; }

/* Life review */
.completion-review { margin-block: var(--space-4); padding: var(--space-4); background: #e6ecdb; border: 1px solid #a4b293; }
.completion-review h3 { margin: 0 0 var(--space-2); }
.completion-review button { width: 100%; min-height: 48px; margin-top: var(--space-2); }
.life-review-page { min-height: 100vh; background: #eae9dd; color: var(--ink); }
.life-review-header { max-width: 960px; margin: auto; padding: 24px; }
.life-review-main { max-width: 760px; margin: 0 auto; padding: 0 20px 60px; }
.life-review-back { display: inline-block; padding: 12px 0; color: var(--ink); }
.life-review-paper { padding: clamp(24px, 6vw, 60px); border: 1px solid #c3bba1; background: var(--paper); box-shadow: 6px 6px #d3cfbc; }
.life-review-paper h1 { margin: 0; color: var(--green); line-height: 1.4; }
.life-review-intro { color: #626c58; }
.life-review-paper #review-status { margin-top: 32px; color: #626c58; font-size: 14px; }
.life-review-text { min-height: 120px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; }
.life-review-actions { display: flex; gap: 12px; margin-top: 28px; }
.life-review-actions button { min-height: 44px; }
.life-review-actions [hidden] { display: none; }
