/* Styles for the playable web shell (web/shell.html): full-viewport canvas,
   screen-reader live region, and pixel-art loading overlay. */

html, body, #canvas {
	margin: 0;
	padding: 0;
	border: 0;
}

/* The game fills the window exactly: the page never scrolls (a phone's
   browser would otherwise show a scroll bar for a pixel of overflow). */
html, body {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

body {
	color: var(--cvb-ink);
	background-color: var(--cvb-cream);
	overflow: hidden;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

#canvas {
	display: block;
	position: fixed;
	left: 0;
	top: 0;
}

#canvas:focus {
	outline: none;
}

/* What the game says for a screen reader (cvb.announce / cvbAnnounce): off
   screen, but read out. */
#announce {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ?dpr=N (web/bridge.js): the canvas has fewer pixels than the screen, and the
   browser scales it up a pixel to a block of pixels, never smoothed. */
.dpr-capped #canvas {
	image-rendering: crisp-edges;
	image-rendering: pixelated;
}

/* The loading screen: the logo on cream with a soft dot pattern, a pixel
   progress bar, and something cozy to read while the yard loads. */
#status {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 28px;
	visibility: hidden;
	background-color: var(--cvb-cream);
	background-image: radial-gradient(var(--cvb-dot) 2px, transparent 2px);
	background-size: 24px 24px;
	font-family: var(--cvb-font-display);
	z-index: 1;
}

#logo {
	image-rendering: pixelated;
	image-rendering: crisp-edges;
	max-width: 92vw;
	animation: bob 2.4s steps(2, jump-none) infinite;
}

@keyframes bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
	#logo {
		animation: none;
	}
}

#bar {
	width: min(360px, 70vw);
	height: 20px;
	border: 4px solid var(--cvb-ink);
	background: var(--cvb-tan);
	box-shadow: 0 4px 0 var(--cvb-brown);
	position: relative;
}

#bar-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0%;
	background: var(--cvb-leaf);
	border-top: 4px solid var(--cvb-leaf-light);
	box-sizing: border-box;
	transform-origin: left;
}

#line {
	font-size: 40px;
	color: var(--cvb-rust);
	min-height: 1.2em;
	text-align: center;
	padding: 0 16px;
}

#status-notice {
	display: none;
	max-width: 520px;
	margin: 0 24px;
	padding: 16px 20px;
	border: 4px solid var(--cvb-ink);
	background: var(--cvb-peach);
	box-shadow: 0 4px 0 var(--cvb-brown);
	font-size: 20px;
	line-height: 1.25;
	text-align: center;
}
