/*
 * The registry: masthead, the map, a deed panel and the signed-in file.
 * Terrain colours are mixed from the palette in site.css.
 */

:root {
	--sea: #050a1f;
	--sea-lit: #0a1740;
	--turf: #14290f;
	--turf-lit: #1c3a14;
	--soil: #3d2f18;
	--pasture: #2b5417;
	--fallow: #574d33;
	--hedge: #16300d;
}

/* ---- masthead ---- */

.masthead {
	display: grid;
	gap: 1rem 2rem;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	margin-bottom: 1.1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--line);
}

.lede {
	max-width: 44ch;
	color: var(--ink-dim);
	margin: 0;
}

.ledger {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.6rem;
	margin: 0;
	font-family: var(--mono);
}

.ledger div {
	display: flex;
	flex-direction: column-reverse;
}

.ledger dt {
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ink-dim);
}

.ledger dd {
	margin: 0;
	font-size: 1.45rem;
	font-weight: 700;
	color: var(--white);
	font-variant-numeric: tabular-nums;
}

.ledger .filed dd {
	font-size: 0.9rem;
	color: var(--ink-dim);
	font-weight: 400;
}

/* ---- the map ---- */

.survey {
	display: grid;
	gap: 1rem;
	grid-template-columns: minmax(0, 1fr) 19rem;
	align-items: start;
}

.mapframe {
	border: 1px solid var(--line-lit);
	border-radius: var(--radius);
	background: var(--sea);
	overflow: hidden;
	box-shadow: inset 0 0 0 1px #000;
}

.mapscroll {
	overflow: auto;
	max-height: min(74vh, 42rem);
}

.loading {
	margin: 0;
	padding: 4rem 1rem;
	text-align: center;
	font-family: var(--mono);
	color: var(--ink-dim);
}

.worldmap {
	display: block;
	width: 100%;
	min-width: 34rem;
	image-rendering: pixelated;
}

.worldmap .sea {
	fill: var(--sea);
}

.worldmap .swell {
	fill: none;
	stroke: var(--sea-lit);
	stroke-width: 0.18;
}

.worldmap .turf {
	fill: var(--turf);
}

.worldmap .tuft {
	stroke: var(--turf-lit);
	stroke-width: 0.16;
	stroke-linecap: round;
}

.worldmap .field {
	fill: var(--pasture);
}

.worldmap .graze {
	fill: var(--pasture);
}

/* An acre with something on it is ploughed; the rest is grazing. */
.worldmap .worked {
	fill: var(--soil);
}

.worldmap .hedge {
	fill: none;
	stroke: var(--hedge);
	stroke-width: 0.22;
}

.worldmap .pole {
	fill: var(--grey);
}

/* Wealth is the strip along the foot of a parcel, which the key repeats. */
[data-band="newcomer"] {
	--band: #2f5c22;
}
[data-band="settler"] {
	--band: var(--teal);
}
[data-band="landowner"] {
	--band: var(--cyan);
}
[data-band="industrialist"] {
	--band: var(--yellow);
}
[data-band="magnate"] {
	--band: var(--orange);
}
[data-band="tycoon"] {
	--band: var(--magenta);
}

.parcel[data-band] .strip {
	fill: var(--band);
}

.bands li[data-band] i {
	border-color: var(--band);
}

.parcel {
	cursor: pointer;
}

.worldmap .bare {
	fill: var(--fallow);
}

.worldmap .clod {
	stroke: #6d6144;
	stroke-width: 0.14;
	stroke-linecap: round;
}

.parcel.unnamed .hedge {
	stroke: #756848;
	stroke-dasharray: 0.5 0.4;
}

/* Sized in map.js, which also clips the nick to fit. */
.parcel .nameplate {
	font-family: var(--mono);
	fill: var(--ink);
	text-anchor: middle;
	paint-order: stroke;
	stroke: #000;
	stroke-width: 0.18px;
	stroke-linejoin: round;
	pointer-events: none;
}

.parcel:hover .worked,
.parcel:focus-visible .worked {
	fill: #3f3018;
}

.parcel:hover .hedge,
.parcel:focus-visible .hedge,
.parcel.picked .hedge {
	stroke-width: 0.4;
}

.parcel.mine .hedge {
	stroke: var(--lime);
	stroke-width: 0.4;
}

.parcel.unnamed .nameplate {
	fill: var(--ink-dim);
	font-style: italic;
}

.parcel.mine .nameplate {
	fill: var(--lime);
}

.maptools {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.7rem;
	border-top: 1px solid var(--line);
	background: var(--panel);
}

#findme {
	margin-left: auto;
}

.zoom {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	margin-left: auto;
}

.zoom output {
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--ink-dim);
	min-width: 2.6ch;
	text-align: center;
}

.zoom button {
	width: 1.9rem;
	padding: 0.2rem 0;
	text-align: center;
}

/* The map is as wide as the zoom says; the scroller takes up the difference. */
.mapscroll .worldmap {
	width: 100%;
}

.scalebar {
	display: flex;
	border: 1px solid var(--line-lit);
}

.scalebar i {
	width: 11px;
	height: 9px;
	background: var(--soil);
}

.scalebar i:nth-child(odd) {
	background: var(--turf);
}

/* ---- the deed ---- */

.deed {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	padding: 0.9rem 1rem 1rem;
	min-height: 12rem;
	position: sticky;
	top: 1rem;
}

.deed h3 {
	margin: 0;
	font-size: 1.15rem;
	color: var(--white);
	overflow-wrap: anywhere;
}

.deed h3.anon {
	color: var(--ink-dim);
	font-style: italic;
	font-size: 0.95rem;
}

.deed .band {
	font-family: var(--mono);
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
}

.deed .facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.1rem 0.7rem;
	margin: 0.6rem 0 0.8rem;
	font-family: var(--mono);
	font-size: 0.8rem;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	padding: 0.5rem 0;
}

.deed .facts dt {
	color: var(--ink-dim);
}

.deed .facts dd {
	margin: 0;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.deed .deer {
	margin: 0 0 0.7rem;
}

.deed .deer img {
	display: block;
	width: 100%;
	max-width: 9rem;
	image-rendering: pixelated;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: #000;
}

.deed .deer figcaption {
	font-family: var(--mono);
	font-size: 0.7rem;
	color: var(--ink-dim);
	margin-top: 0.25rem;
}

/* ---- an item, drawn ---- */

.holdings {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.holdings li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
}

.holdings img {
	width: 22px;
	height: 22px;
	flex: none;
	image-rendering: pixelated;
}

.holdings b {
	font-family: var(--mono);
	color: var(--white);
	font-variant-numeric: tabular-nums;
	min-width: 2.2ch;
	text-align: right;
}

/* ---- key ---- */

.key {
	margin: 1.2rem 0;
}

.bands {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1rem;
	padding: 0;
	margin: 0 0 0.5rem;
	font-family: var(--mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-dim);
}

.bands li {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.bands i {
	width: 14px;
	height: 10px;
	border: 2px solid currentColor;
	border-radius: 2px;
}

/* ---- a filed parcel, on its own page ---- */

.certificate img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--line-lit);
	border-radius: var(--radius);
}

.certificate {
	margin-bottom: 1.4rem;
}

/* ---- your file ---- */

.file {
	margin-top: 1.6rem;
}

.panels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	gap: 0.7rem;
	align-items: start;
}

.panels .panel h3 {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ink-dim);
	margin: 0 0 0.4rem;
}

.panels .wide {
	grid-column: span 2;
}

.meter {
	height: 6px;
	margin-top: 0.4rem;
	background: var(--panel-2);
	border: 1px solid var(--line);
	overflow: hidden;
}

.meter span {
	display: block;
	height: 100%;
	background: var(--accent);
}

.rows {
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--mono);
	font-size: 0.82rem;
}

.rows li {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	padding: 0.12rem 0;
}

.rows b {
	color: var(--white);
	font-variant-numeric: tabular-nums;
}

.countdown {
	color: var(--yellow);
}

.panel.warn {
	border-color: var(--red);
}

.ask {
	display: flex;
	gap: 0.35rem;
	margin-bottom: 0.4rem;
}

.ask input {
	flex: 1 1 auto;
	min-width: 0;
}

.notice {
	margin-top: 1.4rem;
	max-width: 60ch;
}

@media (max-width: 60rem) {
	.survey,
	.masthead {
		grid-template-columns: minmax(0, 1fr);
	}

	.deed {
		position: static;
	}
}
