/* molihua skin — light only, warm paper, hairline rules */
:root {
	--paper: #FCFBF7;
	--ink:   #1A1A1A;
	--ink-2: #6B6B6B;
	--rule:  rgba(26,26,26,.14);
	--accent:#0E6B45;
}

html { color-scheme: light; height: 100%; }

body {
	margin: 0;
	padding: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	color: var(--ink);
	font: 14px/1.7 "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
	-webkit-text-size-adjust: 100%;
}

canvas { display: block; position: absolute; }

#main {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: stretch;
}

/* ---------- left panel ---------- */

#panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	width: 316px;
	flex: 0 0 316px;
	border-right: 1px solid var(--rule);
	box-sizing: border-box;
}

#head { flex: 0 0 auto; padding: 1.4rem 1.2rem .9rem; }

#head h1 {
	margin: 0 0 .5rem;
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: .04em;
}

#hint {
	margin: 0;
	font-size: .8125rem;
	line-height: 1.75;
	color: var(--ink-2);
}

/* the little swatch standing in for the blank tile */
.sw {
	display: inline-block;
	width: .72em; height: .72em;
	margin: 0 .2em;
	background: #D9D6CB;
	border: 1px solid var(--rule);
	transform: translateY(.04em) rotate(45deg) scaleY(.55);
}

#tools {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 1rem;
}

/* one lane per atlas row, cropped to that row's real artwork */
.lane {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 2px;
	padding: .55rem 1.2rem;
	border-top: 1px solid var(--rule);
}

.lane > div {
	background-image: url('../textures/01_130x66_130x230.png');
	background-repeat: no-repeat;
	background-size: 780px 690px;   /* sheet at 50% */
	width: 65px;
	cursor: pointer;
	outline: 2px solid transparent;
	outline-offset: -2px;
}

.lane > div:hover { outline-color: var(--rule); }
.lane > div.selected { outline-color: var(--accent); }

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

#area {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

#stage {
	position: relative;
	width: 910px;
	height: 666px;
	flex: 0 0 auto;
	transform-origin: top left;
}

#credit {
	flex: 0 0 auto;
	padding: .55rem 1.2rem;
	border-top: 1px solid var(--rule);
	font-size: .75rem;
	line-height: 1.6;
	color: var(--ink-2);
}

#credit a { color: var(--ink-2); text-underline-offset: .2em; }

/* ---------- phone ---------- */

@media only screen and (max-width: 966px) {
	#main { flex-direction: column; }

	#panel {
		width: auto;
		flex: 1 1 auto;
		min-height: 0;
		border-right: 0;
		border-bottom: 1px solid var(--rule);
	}

	#head { padding: .9rem 1rem .6rem; }
	#head h1 { font-size: 1.125rem; margin-bottom: .35rem; }
	#hint { font-size: .75rem; line-height: 1.7; }

	/* the palette takes the slack; the board keeps its own aspect ratio
	   so no dead band is left above or below it */
	#tools { max-height: none; }

	.lane { padding: .5rem 1rem; }

	#area {
		flex: 0 0 auto;
		width: 100%;
		aspect-ratio: 910 / 666;
		min-height: 210px;
	}
}
