:root {
	--bg-1: #2b2220;
	--panel: #f6efe6;
	--panel-soft: #f1e7db;
	--line: #ccb8a5;
	--ink: #2a201c;
	--ink-muted: #735d4f;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
}

body {
	font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
	color: var(--ink);
	background: var(--bg-1);
	display: grid;
	place-items: center;
	overflow: hidden;
}

.app-shell {
	width: min(1300px, 96vw);
	height: min(900px, 96vh);
	min-height: 0;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: none;
	display: grid;
	grid-template-rows: 44px 1fr 40px;
}

.app-shell:fullscreen {
	width: 100vw;
	height: 100vh;
	border-radius: 0;
}

.top-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 14px;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	font-size: 14px;
	letter-spacing: 0.1px;
}

.fullscreen-toggle {
	margin-left: auto;
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 18px;
	line-height: 1;
	padding: 4px 6px;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.fullscreen-toggle:hover {
	background: rgba(42, 32, 28, 0.08);
	border-color: rgba(42, 32, 28, 0.18);
}

.fullscreen-toggle:focus-visible {
	outline: 2px solid rgba(42, 32, 28, 0.75);
	outline-offset: 2px;
}

.app-icon {
	width: 18px;
	height: 18px;
}

.title {
	margin-left: 4px;
	font-weight: 600;
}

.stage-wrap {
	padding: 0;
	background: var(--panel-soft);
	position: relative;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

#gameCanvas {
	width: calc(100% - 24px);
	height: calc(100% - 24px);
	margin: 12px;
	display: block;
	background: #32553d;
	border: 1px solid var(--line);
	border-radius: 7px;
}

.game-over-controls {
	position: absolute;
	inset: 12px;
	z-index: 3;
}

.game-over-controls[hidden] {
	display: none;
}

.overlay-action-button {
	appearance: none;
	border: 1px solid var(--line);
	border-radius: 10px;
	background-color: #f6efe6;
	background-image: none;
	color: var(--ink);
	cursor: pointer;
	font: inherit;
	transition: background 120ms ease, border-color 120ms ease;
}

.overlay-action-button:hover {
	border-color: #b89c82;
	background-color: #f3eadf;
	background-image: none;
}

.game-over-controls {
	display: flex;
	align-items: end;
	justify-content: center;
	gap: 10px;
	pointer-events: none;
	padding-bottom: 28px;
}

.overlay-action-button {
	pointer-events: auto;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.status-bar {
	display: flex;
	align-items: center;
	padding: 0 14px;
	font-size: 13px;
	background: var(--panel);
	border-top: 1px solid var(--line);
}

.status-bar p {
	margin: 0;
	color: var(--ink-muted);
}

@media (max-width: 900px) {
	.app-shell {
		width: 100vw;
		height: 100vh;
		border-radius: 0;
	}

	.top-bar {
		font-size: 13px;
	}

	.status-bar {
		font-size: 12px;
	}

	.game-over-controls {
		flex-direction: column;
		align-items: stretch;
	}
}