/* Sudoku Farm player and studio pages (play.html, create.html, variants.html). */
:root {
	--barn: #A3222E;
	--field: #F6F1E3;
	--ink: #2B2117;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	font-family: Verdana, sans-serif;
	color: var(--ink);
	background: #5B4330;
}
#top {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: center;
	padding: 0.4rem;
	background: var(--barn);
	color: white;
	text-align: center;
}
#top h1 {
	margin: 0;
	font-size: clamp(1.1rem, 5vw, 1.6rem);
	flex: 1;
}
#top a {
	color: white;
}
.back {
	font-size: 0.9rem;
	text-decoration: none;
}
main {
	max-width: 34rem;
	margin: 0 auto;
	padding: 0.4rem;
	background: var(--field);
	min-height: calc(100vh - 3rem);
}
.emoji {
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
	line-height: 1;
}
img {
	max-width: 100%;
}
#resources table, #dashboard table {
	width: 100%;
	border-collapse: collapse;
	text-align: center;
	background: white;
	font-size: clamp(0.75rem, 3.2vw, 0.95rem);
}
#resources th, #resources td, #dashboard th, #dashboard td {
	padding: 0.15rem 0.1rem;
	border: 1px solid #DDD;
}
#resources th .emoji, #dashboard th .emoji {
	font-size: 1.2rem;
}
#dashboard th img {
	height: 1.4rem;
	vertical-align: middle;
}
#resources .delta td {
	background: #F3F3F3;
	min-height: 1.4em;
}
.up {
	color: #157A1F;
}
.down {
	color: #A15C00;
}
.neg {
	color: white;
	background: #C0182A !important;
	font-weight: bold;
}
#status {
	min-height: 1.4rem;
	margin: 0.3rem 0;
	text-align: center;
	font-size: 0.9rem;
}
#tray {
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	gap: 0.2rem;
	margin-bottom: 0.4rem;
}
#tray .item {
	position: relative;
	aspect-ratio: 1;
	border: 2px solid #999;
	border-radius: 0.4rem;
	background: white;
	padding: 2px;
	cursor: pointer;
	font-size: clamp(1rem, 5vw, 1.6rem);
	display: flex;
	align-items: center;
	justify-content: center;
}
#tray .item img {
	width: 80%;
}
#tray .item.selected {
	border: 3px solid #1A8F2A;
	background: #DFF6DF;
}
#tray .item.done {
	opacity: 0.35;
}
#tray .left {
	position: absolute;
	right: 1px;
	bottom: 0;
	font-size: 0.55rem;
	font-weight: bold;
	color: #555;
}
#board {
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	border: 3px solid var(--ink);
	background: white;
	width: min(100%, 70vh);
	margin: 0 auto;
	touch-action: manipulation;
}
#board .cell {
	aspect-ratio: 1;
	border: none;
	border-right: 1px solid #BBB;
	border-bottom: 1px solid #BBB;
	background: white;
	padding: 6%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(1rem, 6vw, 2.2rem);
	cursor: pointer;
}
#board .cell:nth-child(9n) {
	border-right: none;
}
#board .cell:nth-last-child(-n+9) {
	border-bottom: none;
}
#board .cell.br {
	border-right: 3px solid var(--ink);
}
#board .cell.bb {
	border-bottom: 3px solid var(--ink);
}
#board .cell.given {
	background: #EFE8D6;
}
#board .cell img {
	width: 100%;
}
#board .cell.hint {
	outline: 3px solid #F2A900;
	outline-offset: -3px;
}
#board .cell.wrong {
	outline: 3px solid #D00;
	outline-offset: -3px;
}
#scorebar {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin: 0.4rem 0;
	font-size: 0.9rem;
	font-weight: bold;
}
#controls {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.3rem;
}
button, .button {
	font-family: inherit;
	font-size: 0.95rem;
	padding: 0.45rem 0.3rem;
	border: 1px solid #5A4630;
	border-radius: 0.4rem;
	background: #FFF8E0;
	cursor: pointer;
	color: var(--ink);
	text-decoration: none;
	text-align: center;
}
button:hover, .button:hover {
	background: #FFEFB0;
}
#levels, #help {
	margin-top: 0.5rem;
	padding: 0.5rem;
	background: white;
	border: 1px solid #CCC;
}
#levels h2, #help h2 {
	font-size: 1rem;
	margin: 0.5rem 0 0.25rem 0;
}
.levelGrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
	gap: 0.25rem;
}
.levelGrid a {
	display: block;
	text-align: center;
	padding: 0.3rem 0;
	border: 1px solid #999;
	border-radius: 0.3rem;
	color: var(--ink);
	text-decoration: none;
}
.levelGrid a.won {
	background: #BFE8BF;
}
