/* biome-ignore-all lint/style/noDescendingSpecificity: the chip, card and pill rules read top to bottom; the later, more general ones are deliberate */
/* The browse tools: search and sort, the count line, the tier chips, trait
   cards and pills (muses/filters.ts), on the gallery, the sales wall and the
   store. Colors are site.css's. */
.tools {
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(0, 1fr) auto;
}
.tools input {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border-radius: var(--r-md);
	font: 400 var(--t-base) var(--sans);
	color: var(--bone);
	background: var(--card);
	border: 1px solid var(--line-hi);
}
.tools input::placeholder {
	color: var(--dim);
}
/* The sort menu takes its longest option's width; capped, so search keeps the room on a phone. */
.tools select {
	width: auto;
	max-width: 46vw;
}
/* The count line: "999 muses", with a reset link or button. */
.status {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 14px;
	margin: 0;
	color: var(--soft);
}
.status b {
	font: 700 var(--d-2) var(--sans);
	font-variant-numeric: tabular-nums;
	color: var(--bone);
}
.status button {
	padding: 0;
	font: inherit;
	color: var(--soft);
	background: none;
	border: 0;
	text-decoration: underline;
	text-decoration-color: var(--underline);
	text-underline-offset: 3px;
	cursor: pointer;
}
.status a {
	text-decoration-color: var(--underline);
	text-underline-offset: 3px;
}
.tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
/* A grid, so the name and count share a baseline while the row sits in the
   middle of the 44px chip (a flex row on baseline leaves the spare height
   below the text). */
.chip {
	display: inline-grid;
	grid-auto-flow: column;
	align-items: baseline;
	align-content: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	font: 500 var(--t-note) / 1.2 var(--sans);
	color: var(--bone);
	background: var(--card);
	border: 1px solid var(--line-hi);
	border-radius: var(--r-pill);
	cursor: pointer;
	transition:
		background-color 0.15s,
		border-color 0.15s,
		color 0.15s;
}
.chip small {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
.chip[aria-pressed="true"] {
	background: var(--cool);
	border-color: var(--cool);
	color: var(--void);
}
.chip[aria-pressed="true"] small {
	color: rgba(var(--void-rgb), 0.7);
}
.chip[aria-pressed="true"] .tier {
	background: none;
	-webkit-text-fill-color: var(--void);
	color: var(--void);
}
.chip:disabled {
	opacity: 0.6;
	cursor: default;
}
@media (hover: hover) {
	.chip:not(:disabled):not([aria-pressed="true"]):hover {
		border-color: rgba(var(--bone-rgb), 0.45);
	}
}

/* The traits: a card each, always open, in a row that scrolls sideways. */
.w-wrap {
	position: relative;
	margin: 0 calc(-1 * var(--pad));
}
.widgets {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: min(78vw, 260px);
	align-items: start;
	gap: 12px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding: 0 var(--pad);
	padding: 2px var(--pad) 6px;
	scrollbar-width: none;
}
.widgets::-webkit-scrollbar {
	display: none;
}
.w {
	position: relative;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 12px 10px;
	border-radius: var(--r-lg);
	background: var(--card);
	box-shadow: inset 0 0 0 1px var(--line);
	transition: box-shadow 0.15s;
}
.w.on {
	box-shadow: inset 0 0 0 1px rgba(var(--cool-rgb), 0.55);
}
.w header {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 0 6px;
	min-height: 28px;
}
.w h2 {
	margin: 0;
	font: 600 var(--d-1) / 1.2 var(--serif);
	color: var(--bone);
}
.w-n {
	font: 400 var(--t-xs) var(--mono);
	color: var(--cool);
}
.w-clear {
	margin-left: auto;
	padding: 0;
	font: 500 var(--t-sm) var(--sans);
	color: var(--soft);
	background: none;
	border: 0;
	text-decoration: underline;
	text-decoration-color: var(--underline);
	text-underline-offset: 3px;
	cursor: pointer;
}
.w.fold:not(.open):not(.finding) .f-list {
	max-height: calc(6 * 44px);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 55%, transparent);
	mask-image: linear-gradient(#000 55%, transparent);
}
.w.open .f-list,
.w.finding .f-list {
	max-height: 320px;
}
.w-all {
	align-self: start;
	min-height: 36px;
	padding: 0 8px;
	font: 500 var(--t-ui) var(--sans);
	color: var(--cool);
	background: none;
	border: 0;
	cursor: pointer;
}
.w-all::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-left: 8px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: translateY(-3px) rotate(45deg);
}
.w.open .w-all::after {
	transform: translateY(0) rotate(-135deg);
}
.w.finding .w-all {
	display: none;
}
.w-nav {
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--card-up);
	border: 0;
	color: var(--bone);
	cursor: pointer;
	box-shadow:
		inset 0 0 0 1px rgba(var(--bone-rgb), 0.12),
		var(--e-2);
}
.w-nav svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.w-nav.prev {
	left: 4px;
}
.w-nav.next {
	right: 4px;
}
.w-nav[hidden] {
	display: none;
}
@media (hover: none) {
	.w-nav {
		display: none;
	}
}
/* The peek: the cards' tops fade out, and a tap anywhere on them opens the row. */
.w-wrap.peek .widgets {
	max-height: 168px;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 30%, transparent);
	mask-image: linear-gradient(#000 30%, transparent);
}
.w-wrap.peek .w-nav {
	display: none;
}
.w-peek {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0 0 8px;
	background: none;
	border: 0;
	cursor: pointer;
}
.w-peek .btn {
	background: var(--card);
}
.w-peek .btn::after {
	content: "";
	width: 7px;
	height: 7px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: translateY(-2px) rotate(45deg);
}
@media (hover: hover) {
	.w-peek:hover .btn {
		border-color: var(--gold);
	}
}
.w-peek:focus-visible {
	outline: 0;
}
.w-peek:focus-visible .btn {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}
/* On a phone the tiers are one row that scrolls sideways, like the traits
   under them, and the traits peek shorter, so the muses start a screen sooner. */
@media (max-width: 759px) {
	.tiers {
		flex-wrap: nowrap;
		margin: -3px calc(-1 * var(--pad));
		padding: 3px var(--pad);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
	}
	.tiers::-webkit-scrollbar {
		display: none;
	}
	.tiers .chip,
	.tiers .chip-skel {
		flex: none;
	}
	.w-wrap.peek .widgets {
		max-height: 104px;
	}
}
@media (min-width: 760px) {
	.w-wrap {
		margin: 0;
	}
	.widgets {
		padding: 2px 0 6px;
		scroll-padding: 0;
	}
}
.f-search {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--r-md);
	background: var(--card-hi);
	border: 1px solid var(--line-hi);
}
.f-search:focus-within {
	border-color: var(--cool);
}
.f-search svg {
	width: 20px;
	height: 20px;
	flex: none;
	fill: none;
	stroke: var(--soft);
	stroke-width: 1.8;
	stroke-linecap: round;
}
.f-search input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0;
	font: 400 var(--t-base) var(--sans);
	color: var(--bone);
	background: none;
	border: 0;
	outline: 0;
}
.f-search input::placeholder {
	color: var(--dim);
}
.f-list {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	/* One column the list's width: a long value wraps instead of widening every row. */
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: 2px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
/* A value's row: the box, its name with the lowest listing under it (.fl, on
   the sales wall), and its count at the end. */
.f-list label {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 12px;
	min-height: 42px;
	padding: 4px 8px;
	box-sizing: border-box;
	border-radius: var(--r-sm);
	cursor: pointer;
}
@media (hover: hover) {
	.f-list label:hover {
		background: var(--card-hi);
	}
}
.f-list input {
	appearance: none;
	width: 22px;
	height: 22px;
	flex: none;
	margin: 0;
	border-radius: 6px;
	border: 1.5px solid rgba(var(--bone-rgb), 0.35);
	display: grid;
	place-content: center;
	cursor: pointer;
}
.f-list input::before {
	content: "";
	width: 11px;
	height: 6px;
	border: solid var(--void);
	border-width: 0 0 2px 2px;
	transform: translateY(-1px) rotate(-45deg);
	opacity: 0;
}
.f-list input:checked {
	background: var(--cool);
	border-color: var(--cool);
}
.f-list input:checked::before {
	opacity: 1;
}
.f-list input:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}
.f-list span {
	min-width: 0;
	overflow-wrap: break-word;
}
.f-list small {
	font: 400 var(--t-ui) var(--mono);
	color: var(--soft);
}
.f-list .off {
	opacity: 0.6;
	cursor: default;
}
.w .none {
	margin: 0;
	padding: 4px 8px;
	color: var(--dim);
}
.f-list li[hidden] {
	display: none;
}

.pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.pills:empty {
	display: none;
}
.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 8px 0 14px;
	border-radius: var(--r-pill);
	font: 500 var(--t-ui) var(--sans);
	color: var(--bone);
	background: rgba(var(--cool-rgb), 0.12);
	border: 1px solid rgba(var(--cool-rgb), 0.35);
	cursor: pointer;
}
.pill small {
	color: var(--dim);
	font: 400 var(--t-xs) var(--mono);
}
.pill::after {
	content: "\00d7";
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	font-size: var(--t-base);
	color: var(--soft);
}
@media (hover: hover) {
	.pill:hover {
		border-color: var(--cool);
	}
}

/* A value's lowest listing, when the page has one (the sales wall's listed view). */
.fl:empty {
	display: none;
}
.chip .fl,
.f-list .fl {
	color: var(--gold);
}
.f-list .fl {
	grid-column: 2;
	grid-row: 2;
	font-size: var(--t-xs);
	white-space: nowrap;
}
.f-list label > input {
	grid-row: span 2;
}
.f-list label > small:last-child {
	grid-column: 3;
	grid-row: 1 / span 2;
}

/* Until the index loads: the chips and cards as skeletons (site.css .skel),
   the size of the real ones so nothing moves when they land. */
.chip-skel {
	display: inline-block;
	width: var(--w, 112px);
	height: 44px;
	border-radius: var(--r-pill);
}
.w-skel .skel {
	display: block;
}
.w-skel .sk-h {
	width: 55%;
	height: 20px;
	margin: 4px 6px;
}
.w-skel .sk-q {
	height: 48px;
	border-radius: var(--r-md);
}
.w-skel ul {
	display: grid;
	margin: 0;
	padding: 0 6px;
	list-style: none;
}
.w-skel li {
	display: flex;
	align-items: center;
	height: 44px;
}
.w-skel li .skel {
	width: var(--w, 70%);
	height: 14px;
}
.w-skel li:nth-child(odd) .skel {
	--w: 52%;
}
.w-skel .sk-all {
	width: 40%;
	height: 20px;
	margin: 8px;
}
