/* Dead Roll - style.css
   Design direction: a screen printed survival poster. Heavy black ink,
   newsprint paper, three spot colors, halftone shading from canvas. */

:root {
	--ink: #0d1014;
	--ink-soft: #161d26;
	--panel: #1b2129;
	--panel-hi: #232c37;
	--edge: #38424f;
	--paper: #e9e3d4;
	--paper-dim: #c3bba6;
	--dust: #8b8672;
	--rust: #b8402f;
	--rust-dim: #7d2418;
	--amber: #e0a03a;
	--toxic: #7c9a4e;
	--cold: #4d6b83;

	--display: "Haettenschweiler", "Arial Narrow", "Franklin Gothic Medium", Impact, sans-serif;
	--body: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
	--util: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

	--gap: 14px;
	--radius: 2px;
	--stroke: 2px solid var(--ink);
	--shadow-hard: 4px 4px 0 var(--ink);
}

html.high-contrast {
	--panel: #10151b;
	--panel-hi: #1b232c;
	--paper: #ffffff;
	--edge: #6d7a89;
}

html.large-text {
	font-size: 19px;
}

html.color-safe {
	--rust: #c85a1e;
	--toxic: #4f93c4;
	--amber: #edc04a;
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--body);
	overscroll-behavior: none;
}

body {
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

#app {
	position: relative;
	height: 100%;
	overflow: hidden;
}

.hidden {
	display: none !important;
}

/* --- type ---------------------------------------------------------------- */

h1, h2, h3, .display {
	font-family: var(--display);
	font-weight: normal;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	margin: 0;
}

.eyebrow {
	font-family: var(--util);
	font-size: 0.66rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--dust);
}

.num {
	font-family: var(--util);
	font-variant-numeric: tabular-nums;
}

/* --- screens ------------------------------------------------------------- */

.screen {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.screen.stacked {
	overflow-y: auto;
	padding: 24px 18px 60px;
	align-items: center;
}

.sheet {
	width: min(820px, 100%);
	background: var(--panel);
	border: var(--stroke);
	box-shadow: var(--shadow-hard);
	padding: 20px;
}

.sheet + .sheet {
	margin-top: 18px;
}

.sheet h2 {
	font-size: 1.9rem;
	color: var(--paper);
	border-bottom: 2px solid var(--edge);
	padding-bottom: 8px;
	margin-bottom: 14px;
}

/* --- buttons ------------------------------------------------------------- */

button {
	font-family: var(--display);
	font-size: 1.05rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ink);
	background: var(--paper);
	border: var(--stroke);
	border-radius: var(--radius);
	padding: 10px 16px;
	cursor: pointer;
	box-shadow: 3px 3px 0 var(--ink);
	transition: transform 90ms ease, box-shadow 90ms ease, background 120ms ease;
}

button:hover:not(:disabled) {
	background: var(--amber);
}

button:active:not(:disabled) {
	transform: translate(3px, 3px);
	box-shadow: 0 0 0 var(--ink);
}

button:disabled {
	opacity: 0.42;
	cursor: not-allowed;
	box-shadow: 2px 2px 0 var(--ink);
}

button:focus-visible {
	outline: 3px solid var(--amber);
	outline-offset: 3px;
}

button.ghost {
	background: transparent;
	color: var(--paper);
	border-color: var(--edge);
	box-shadow: none;
}

button.ghost:hover:not(:disabled) {
	background: var(--panel-hi);
	color: var(--paper);
}

button.danger {
	background: var(--rust);
	color: var(--paper);
}

button.danger:hover:not(:disabled) {
	background: var(--rust-dim);
}

button.primary {
	background: var(--amber);
}

button.wide {
	width: 100%;
	margin-bottom: 10px;
}

/* --- title --------------------------------------------------------------- */

#screen-title {
	justify-content: center;
	align-items: center;
}

#title-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.title-content {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 20px;
	width: min(460px, 92vw);
	max-height: 100%;
	overflow-y: auto;
}

.logo {
	font-size: clamp(3.6rem, 15vw, 6.4rem);
	line-height: 0.82;
	color: var(--paper);
	text-shadow: 5px 5px 0 var(--ink), 9px 9px 0 var(--rust);
}

.logo span {
	display: block;
	color: var(--rust);
	text-shadow: 5px 5px 0 var(--ink);
}

.tagline {
	font-size: 0.95rem;
	color: var(--paper-dim);
	margin: 14px 0 22px;
	font-style: italic;
}

.menu {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.build-tag {
	margin-top: 18px;
	font-family: var(--util);
	font-size: 0.66rem;
	color: var(--dust);
	letter-spacing: 0.14em;
}

/* --- hud ----------------------------------------------------------------- */

#hud {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: var(--ink-soft);
	border-bottom: 3px solid var(--ink);
	flex-wrap: wrap;
}

.hud-day {
	font-family: var(--display);
	font-size: 1.3rem;
	color: var(--amber);
	white-space: nowrap;
}

.hud-turn {
	color: var(--paper-dim);
	padding-left: 10px;
	border-left: 1px solid var(--edge);
}

/* the resource strip sits hard against the menu button on the right */
#hud .res-strip {
	margin-left: auto;
	justify-content: flex-end;
}

.hud-day small {
	display: block;
	font-family: var(--util);
	font-size: 0.56rem;
	letter-spacing: 0.2em;
	color: var(--dust);
}

.res-strip {
	display: flex;
	gap: 6px;
	flex: 1 1 320px;
	flex-wrap: wrap;
	min-width: 0;
}

.res {
	display: flex;
	align-items: baseline;
	gap: 4px;
	background: var(--panel);
	border: 1px solid var(--edge);
	padding: 3px 7px;
	font-family: var(--util);
	font-size: 0.78rem;
}

.res b {
	color: var(--paper);
	font-weight: 700;
}

.res span {
	color: var(--dust);
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.res.low b {
	color: var(--rust);
}

.res.flash {
	animation: resFlash 700ms ease;
}

@keyframes resFlash {
	0% { background: var(--amber); }
	100% { background: var(--panel); }
}

/* --- game layout --------------------------------------------------------- */

#game-body {
	flex: 1;
	display: flex;
	min-height: 0;
	overflow: hidden;
}

#left-col {
	width: 340px;
	flex: 0 0 340px;
	display: flex;
	flex-direction: column;
	border-right: 3px solid var(--ink);
	background: var(--panel);
	overflow: hidden;
}

#left-col .block {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

#shelter-canvas {
	width: 100%;
	height: 190px;
	display: block;
	border-bottom: 3px solid var(--ink);
	background: var(--ink);
}

#board-col {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
	background:
		repeating-linear-gradient(45deg, rgba(255,255,255,0.014) 0 2px, transparent 2px 8px),
		var(--ink-soft);
}

/* --- structures and survivors -------------------------------------------- */

.block {
	padding: 10px 12px;
	border-bottom: 1px solid var(--edge);
}

.block h3 {
	font-size: 1rem;
	color: var(--paper-dim);
	margin-bottom: 8px;
}

.meter {
	margin-bottom: 5px;
}

.meter-top {
	display: flex;
	justify-content: space-between;
	font-family: var(--util);
	font-size: 0.68rem;
	color: var(--paper-dim);
	margin-bottom: 2px;
}

.meter-bar {
	height: 9px;
	background: var(--ink);
	border: 1px solid var(--edge);
	position: relative;
	overflow: hidden;
}

.meter-fill {
	height: 100%;
	background: var(--toxic);
	transition: width 320ms ease;
}

.meter-fill.warn { background: var(--amber); }
.meter-fill.bad { background: var(--rust); }
.meter-fill.cold { background: var(--cold); }

.survivor {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	border-bottom: 1px dashed var(--edge);
}

.survivor:last-child { border-bottom: none; }

.survivor canvas {
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border: 2px solid var(--ink);
	background: var(--ink);
}

.survivor-info {
	flex: 1;
	min-width: 0;
}

.survivor-name {
	font-family: var(--display);
	font-size: 0.95rem;
	color: var(--paper);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.survivor-tags {
	font-family: var(--util);
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--dust);
}

.tag-injured { color: var(--amber); }
.tag-infected { color: var(--rust); }
.tag-dead { color: var(--dust); text-decoration: line-through; }
.tag-you { color: var(--toxic); }

.survivor.gone { opacity: 0.4; }

/* --- event card ---------------------------------------------------------- */

.event-card {
	background: var(--paper);
	color: var(--ink);
	border: var(--stroke);
	box-shadow: var(--shadow-hard);
	padding: 12px 14px;
	margin-bottom: 14px;
	position: relative;
}

.event-card .eyebrow { color: var(--rust-dim); }

.event-card h3 {
	font-size: 1.5rem;
	margin: 2px 0 6px;
}

.event-card p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.45;
}

.event-card.tone-bad { border-left: 9px solid var(--rust); }
.event-card.tone-good { border-left: 9px solid var(--toxic); }
.event-card.tone-neutral { border-left: 9px solid var(--cold); }

/* --- task board ---------------------------------------------------------- */

.board-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 8px;
	gap: 10px;
	flex-wrap: wrap;
}

.board-head h2 {
	font-size: 1.5rem;
}

#board {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
	gap: 9px;
}

.task {
	background: var(--paper);
	color: var(--ink);
	border: var(--stroke);
	box-shadow: 3px 3px 0 var(--ink);
	padding: 8px 9px 9px;
	text-align: left;
	font-family: var(--body);
	text-transform: none;
	letter-spacing: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 108px;
	cursor: pointer;
}

.task:hover:not(:disabled) {
	background: var(--paper);
	transform: translate(-1px, -1px);
	box-shadow: 5px 5px 0 var(--ink);
}

.task:active:not(:disabled) {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--ink);
}

.task-combo {
	font-family: var(--display);
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--paper);
	background: var(--ink);
	display: inline-block;
	padding: 2px 7px;
	align-self: flex-start;
}

.task-name {
	font-family: var(--display);
	font-size: 1.1rem;
	line-height: 1.05;
	text-transform: uppercase;
}

.task-blurb {
	font-size: 0.76rem;
	line-height: 1.32;
	color: #3a3f45;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.task-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: var(--util);
	font-size: 0.66rem;
	border-top: 1px solid rgba(13,16,20,0.25);
	padding-top: 5px;
	gap: 6px;
}

.task-need {
	color: var(--rust-dim);
	font-weight: 700;
	white-space: nowrap;
}

.task-cost {
	color: #4a4f55;
	text-align: right;
}

.task-preview {
	position: absolute;
	top: 8px;
	right: 8px;
	font-family: var(--display);
	font-size: 1.5rem;
	line-height: 1;
	padding: 2px 6px;
	background: var(--ink);
	color: var(--paper);
	border: 2px solid var(--ink);
}

.task-preview.hit {
	background: var(--toxic);
	color: var(--ink);
}

.task-preview.miss {
	background: var(--rust);
	color: var(--paper);
}

.task-preview.zero {
	background: var(--dust);
	color: var(--ink);
}

.task.used {
	background: var(--panel-hi);
	color: var(--paper-dim);
	box-shadow: none;
	cursor: default;
	border-color: var(--edge);
}

.task.used .task-name { color: var(--paper-dim); }
.task.used .task-blurb { color: var(--dust); }
.task.used .task-combo { background: var(--edge); color: var(--ink); }

.task.locked {
	filter: grayscale(0.55);
	opacity: 0.72;
}

.stamp {
	position: absolute;
	right: 6px;
	bottom: 40px;
	font-family: var(--display);
	font-size: 1.35rem;
	letter-spacing: 0.06em;
	border: 3px solid var(--toxic);
	color: var(--toxic);
	padding: 1px 8px;
	transform: rotate(-11deg);
	opacity: 0.95;
	pointer-events: none;
}

.stamp.partial { border-color: var(--amber); color: var(--amber); }
.stamp.fail { border-color: var(--rust); color: var(--rust); }

.task-result {
	font-family: var(--util);
	font-size: 0.66rem;
	color: var(--toxic);
	line-height: 1.35;
}

.task.wildcard-slot {
	background: #f2e3c0;
	border-width: 3px;
}

.task.wildcard-slot .task-combo { background: var(--rust); }

/* --- dice tray ----------------------------------------------------------- */

#tray {
	background: var(--ink-soft);
	border-top: 3px solid var(--ink);
	padding: 0;
	flex: 0 0 auto;
	display: grid;
	/* the side panels match the shelter column above them exactly */
	grid-template-columns: 340px minmax(0, 1fr) 340px;
	gap: 0;
	align-items: stretch;
	min-height: clamp(148px, 23vh, 214px);
}

/* Flush into the corners of the bar, top and bottom, no gutter. The inner
   layer does the scrolling so a long list cannot stretch the bar. */
.tray-side {
	position: relative;
	background: var(--panel);
	min-height: 0;
	overflow: hidden;
}

#tray-people {
	border-right: 3px solid var(--ink);
}

#tray-log {
	border-left: 3px solid var(--ink);
}

.tray-side-inner {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	padding: 7px 10px 8px;
}

.tray-side h3 {
	font-family: var(--util);
	font-size: 0.62rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--dust);
	margin: 0 0 6px;
	position: sticky;
	top: -7px;
	background: var(--panel);
	padding: 4px 0;
	z-index: 1;
}

#tray-people .survivor {
	padding: 4px 0;
}

#tray-people .survivor canvas {
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
}

#tray-people .survivor-name {
	font-size: 0.86rem;
}

#tray-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0;
	padding: 4px 12px 8px;
	gap: 2px;
}

/* the tip line, and the spot where task messages land so they stop
   covering the buttons under the dice */
#tray-message {
	position: relative;
	min-height: 24px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

#tray-message #toast-stack {
	position: absolute;
	left: 50%;
	top: 50%;
	bottom: auto;
	transform: translate(-50%, -50%);
	width: min(560px, 100%);
}

#turn-banner {
	font-family: var(--util);
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--dust);
	width: 100%;
	text-align: center;
}

#turn-banner .who { color: var(--amber); }

#dice-row {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 2px 0 6px;
	flex-wrap: wrap;
	flex: 0 0 auto;
}

.die {
	width: 58px;
	height: 58px;
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 8px;
	box-shadow: 3px 3px 0 var(--ink);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	padding: 7px;
	cursor: pointer;
	position: relative;
	transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
}

.die:focus-visible {
	outline: 3px solid var(--amber);
	outline-offset: 2px;
}

.pip {
	width: 9px;
	height: 9px;
	background: var(--ink);
	border-radius: 50%;
	align-self: center;
	justify-self: center;
}

.die.held {
	background: var(--amber);
	transform: translateY(-7px);
	box-shadow: 3px 8px 0 var(--ink);
}

.die.held::after {
	content: "HELD";
	position: absolute;
	bottom: -17px;
	left: 0;
	right: 0;
	text-align: center;
	font-family: var(--util);
	font-size: 0.54rem;
	letter-spacing: 0.14em;
	color: var(--amber);
}

.die.rolling {
	animation: tumble 480ms ease-in-out;
}

@keyframes tumble {
	0% { transform: rotate(0) scale(1); }
	25% { transform: rotate(-18deg) scale(1.12); }
	50% { transform: rotate(14deg) scale(0.94); }
	75% { transform: rotate(-8deg) scale(1.06); }
	100% { transform: rotate(0) scale(1); }
}

.die.empty {
	background: var(--panel);
	border-color: var(--edge);
	box-shadow: none;
	cursor: default;
}

.die.empty .pip { background: var(--edge); }

#tray-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	flex: 0 0 auto;
}

#rolls-left {
	font-family: var(--util);
	font-size: 0.76rem;
	color: var(--paper-dim);
	min-width: 92px;
	text-align: center;
}

.hand-name {
	font-family: var(--display);
	font-size: 0.95rem;
	color: var(--amber);
	text-align: center;
	min-height: 1.1em;
	line-height: 1.1;
	margin: 0;
	flex: 0 0 auto;
}

/* --- scrollbars ---------------------------------------------------------- */
/* Firefox */
* {
	scrollbar-width: thin;
	scrollbar-color: var(--rust) var(--ink);
}

/* WebKit and Blink */
::-webkit-scrollbar {
	width: 11px;
	height: 11px;
}

::-webkit-scrollbar-track {
	background: var(--ink);
	border: 1px solid var(--edge);
}

::-webkit-scrollbar-thumb {
	background: var(--rust);
	border: 2px solid var(--ink);
	border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--amber);
}

::-webkit-scrollbar-thumb:active {
	background: var(--toxic);
}

::-webkit-scrollbar-corner {
	background: var(--ink);
}

/* --- overlays ------------------------------------------------------------ */

.overlay {
	position: absolute;
	inset: 0;
	background: rgba(6, 8, 11, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	z-index: 40;
	overflow-y: auto;
}

.overlay-card {
	width: min(720px, 100%);
	background: var(--panel);
	border: 3px solid var(--ink);
	box-shadow: 8px 8px 0 rgba(0,0,0,0.55);
	padding: 18px;
	max-height: 100%;
	overflow-y: auto;
	animation: cardIn 260ms ease;
}

@keyframes cardIn {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

.overlay-card h2 {
	font-size: 2rem;
	color: var(--amber);
	margin-bottom: 4px;
}

.overlay-card h2.bad { color: var(--rust); }
.overlay-card h2.good { color: var(--toxic); }

.overlay-sub {
	font-family: var(--util);
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--dust);
	margin-bottom: 14px;
}

.report-list {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
}

.report-list li {
	padding: 5px 0 5px 14px;
	border-bottom: 1px dashed var(--edge);
	font-size: 0.92rem;
	position: relative;
}

.report-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12px;
	width: 6px;
	height: 6px;
	background: var(--rust);
}

.report-list li.good::before { background: var(--toxic); }
.report-list li.neutral::before { background: var(--cold); }

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

.stat {
	background: var(--ink-soft);
	border: 1px solid var(--edge);
	padding: 8px 10px;
}

.stat b {
	display: block;
	font-family: var(--display);
	font-size: 1.6rem;
	color: var(--amber);
	line-height: 1;
}

.stat span {
	font-family: var(--util);
	font-size: 0.6rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dust);
}

.overlay-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 16px;
	flex-wrap: wrap;
}

/* --- cinematic ----------------------------------------------------------- */

#screen-night {
	background: #06080b;
	justify-content: center;
	align-items: center;
	padding: 16px;
}

.strip {
	width: min(940px, 100%);
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.comic-panel {
	opacity: 0;
	transform: translateY(18px);
	animation: panelIn 620ms ease forwards;
	position: relative;
}

@keyframes panelIn {
	to { opacity: 1; transform: none; }
}

.comic-panel canvas {
	width: 100%;
	height: 190px;
	display: block;
	border: 3px solid var(--ink);
	background: var(--paper);
}

.caption {
	background: var(--paper);
	color: var(--ink);
	border: 2px solid var(--ink);
	border-top: none;
	padding: 8px 10px;
	font-size: 0.85rem;
	line-height: 1.4;
	font-style: italic;
}

.night-actions {
	margin-top: 18px;
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.night-title {
	font-family: var(--display);
	font-size: 2.2rem;
	color: var(--paper);
	text-align: center;
	margin-bottom: 14px;
	letter-spacing: 0.06em;
}

/* --- forms --------------------------------------------------------------- */

label.field {
	display: block;
	margin-bottom: 12px;
}

label.field > span {
	display: block;
	font-family: var(--util);
	font-size: 0.64rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--dust);
	margin-bottom: 5px;
}

input[type="text"], select {
	width: 100%;
	background: var(--ink);
	border: 2px solid var(--edge);
	color: var(--paper);
	font-family: var(--body);
	font-size: 1rem;
	padding: 9px 10px;
}

input[type="text"]:focus, select:focus {
	outline: none;
	border-color: var(--amber);
}

input[type="range"] {
	width: 100%;
	accent-color: var(--rust);
}

.choice-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

.choice {
	background: var(--ink-soft);
	border: 2px solid var(--edge);
	color: var(--paper);
	box-shadow: none;
	text-align: left;
	padding: 10px;
	font-family: var(--display);
	font-size: 1rem;
}

.choice small {
	display: block;
	font-family: var(--body);
	font-size: 0.76rem;
	text-transform: none;
	letter-spacing: 0;
	color: var(--paper-dim);
	margin-top: 4px;
	line-height: 1.35;
}

.choice.selected {
	border-color: var(--amber);
	background: var(--panel-hi);
	color: var(--amber);
}

.choice:hover:not(:disabled) {
	background: var(--panel-hi);
	color: var(--paper);
}

.toggle-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px dashed var(--edge);
}

.toggle-row span {
	font-size: 0.92rem;
}

/* --- portrait editor ------------------------------------------------------ */

.portrait-editor {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
}

#portrait-canvas {
	width: 150px;
	height: 150px;
	border: 3px solid var(--ink);
	box-shadow: var(--shadow-hard);
	background: var(--ink);
	flex: 0 0 auto;
}

.portrait-controls {
	flex: 1 1 260px;
	min-width: 230px;
}

.pc-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.pc-row span {
	flex: 1;
	font-family: var(--util);
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dust);
}

.pc-row button {
	padding: 5px 12px;
	font-size: 0.88rem;
}

/* --- lobby --------------------------------------------------------------- */

.code-display {
	font-family: var(--display);
	font-size: 3rem;
	letter-spacing: 0.3em;
	color: var(--amber);
	text-align: center;
	background: var(--ink);
	border: 3px dashed var(--edge);
	padding: 14px;
	margin-bottom: 14px;
}

.player-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	background: var(--ink-soft);
	border: 1px solid var(--edge);
	margin-bottom: 7px;
}

.player-row canvas {
	width: 34px;
	height: 34px;
	border: 2px solid var(--ink);
}

.player-row .pname {
	flex: 1;
	font-family: var(--display);
	font-size: 1.05rem;
}

.dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--toxic);
}

.dot.off { background: var(--rust); }

.net-status {
	font-family: var(--util);
	font-size: 0.7rem;
	color: var(--dust);
	margin-bottom: 10px;
}

.net-status.err { color: var(--rust); }
.net-status.ok { color: var(--toxic); }

/* --- toast --------------------------------------------------------------- */

#toast-stack {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: 7px;
	align-items: center;
	pointer-events: none;
	width: min(560px, 94vw);
}

.toast {
	background: var(--paper);
	color: var(--ink);
	border: 2px solid var(--ink);
	box-shadow: 3px 3px 0 var(--ink);
	padding: 7px 13px;
	font-size: 0.86rem;
	animation: toastIn 220ms ease;
}

.toast.win { background: var(--toxic); }
.toast.warn { background: var(--amber); }
.toast.bad { background: var(--rust); color: var(--paper); }

@keyframes toastIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

/* --- log ----------------------------------------------------------------- */

#log-list {
	font-family: var(--util);
	font-size: 0.7rem;
	line-height: 1.55;
	color: var(--paper-dim);
}

#log-list div {
	padding: 2px 0;
	border-bottom: 1px dotted var(--edge);
}

/* --- responsive ----------------------------------------------------------- */

/* Shorter desktop windows: shave the card and tray so the board still sits
   in frame without a scrollbar. */
@media (min-width: 901px) and (max-height: 880px) {
	#shelter-canvas {
		height: 158px;
	}

	#board-col {
		padding: 9px;
	}

	#board {
		gap: 8px;
	}

	.board-head {
		margin-bottom: 7px;
	}

	.task {
		padding: 7px 9px 8px;
	}

	#tray-center {
		padding: 2px 12px 6px;
	}

	#tray-message {
		min-height: 20px;
	}

	#turn-banner {
		font-size: 0.64rem;
	}

	.hand-name {
		font-size: 0.86rem;
	}

	#dice-row {
		gap: 7px;
		margin: 1px 0 5px;
	}

	.task {
		min-height: 94px;
	}

	.task-name {
		font-size: 1.02rem;
	}

	.task-blurb {
		-webkit-line-clamp: 1;
		font-size: 0.74rem;
	}

	.die {
		width: 50px;
		height: 50px;
		padding: 6px;
	}

	.die.held::after {
		bottom: -14px;
		font-size: 0.5rem;
	}

	#tray-actions button {
		padding: 7px 13px;
		font-size: 0.9rem;
	}
}

/* Very short windows, which is what a 1280x720 browser viewport really is. */
@media (min-width: 901px) and (max-height: 760px) {
	#shelter-canvas {
		height: 132px;
	}

	.die {
		width: 44px;
		height: 44px;
		padding: 5px;
	}

	.pip {
		width: 7px;
		height: 7px;
	}

	#dice-row {
		gap: 6px;
		margin: 0 0 4px;
	}

	.hand-name {
		font-size: 0.8rem;
	}

	#tray-actions button {
		padding: 6px 11px;
		font-size: 0.85rem;
	}

	#tray-center {
		padding: 2px 10px 5px;
	}

	#board-col {
		padding: 8px;
	}

	#board {
		gap: 7px;
	}

	.board-head {
		margin-bottom: 6px;
	}

	.board-head h2 {
		font-size: 1.3rem;
	}

	.task {
		min-height: 84px;
		padding: 6px 8px 7px;
		gap: 3px;
	}

	.task-name {
		font-size: 0.95rem;
	}

	.task-blurb {
		font-size: 0.71rem;
	}

	.task-foot {
		font-size: 0.6rem;
		padding-top: 4px;
	}

	.task-combo {
		font-size: 0.72rem;
	}
}

@media (max-width: 900px) {
	#game-body {
		flex-direction: column;
		overflow-y: auto;
	}

	#left-col {
		width: 100%;
		flex: 0 0 auto;
		border-right: none;
		border-bottom: 3px solid var(--ink);
		overflow: visible;
	}

	#shelter-canvas {
		height: 150px;
	}

	#board-col {
		overflow: visible;
	}

	#board {
		grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	}

	.task {
		min-height: 112px;
	}

	.task-name {
		font-size: 1.02rem;
	}

	.die {
		width: 48px;
		height: 48px;
		padding: 5px;
	}

	.pip {
		width: 7px;
		height: 7px;
	}

	.hud-day {
		font-size: 1.05rem;
	}

	#hud .res-strip {
		margin-left: 0;
		justify-content: flex-start;
		order: 3;
		width: 100%;
	}

	#left-col {
		overflow: visible;
	}

	#left-col .block {
		flex: 0 0 auto;
		overflow: visible;
	}

	#tray {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.tray-side {
		overflow-y: auto;
		border-left: none;
		border-right: none;
		border-top: 2px solid var(--ink);
	}

	.tray-side-inner {
		position: static;
		inset: auto;
		overflow: visible;
	}

	#tray-center {
		padding: 8px 10px;
	}

	#tray-people {
		max-height: 108px;
		order: 3;
		margin-top: 8px;
	}

	#tray-log {
		max-height: 92px;
		order: 4;
		margin-top: 8px;
	}

	.logo {
		text-shadow: 4px 4px 0 var(--ink), 7px 7px 0 var(--rust);
	}
}

@media (max-width: 420px) {
	#board {
		grid-template-columns: 1fr 1fr;
	}

	.task-blurb {
		display: none;
	}

	.task {
		min-height: 96px;
	}

	button {
		font-size: 0.95rem;
		padding: 9px 12px;
	}
}

html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
