body {
	font-family: 'Segoe UI', Verdana, Geneva, Tahoma, sans-serif;
	background: linear-gradient(135deg, #6fa8ff 0%, #b3d8fd 100%);
	color: #222;
	margin: 0;
	padding: 0;
	touch-action: manipulation;
}

.game-area-bg {
	background: linear-gradient(180deg, rgba(111,168,255,0.95) 0%, rgba(179,216,253,0.85) 80%, rgba(179,216,253,0.0) 100%),
							url('images/hextris-background.webp') center top/cover no-repeat;
	border-radius: 18px;
	box-shadow: 0 4px 32px rgba(30,60,114,0.10);
	position: relative;
	overflow: hidden;
}

pre {
	background: rgba(44,62,80,0.7);
	color: #fff;
	border-radius: 8px;
	padding: 1em;
	font-size: 1em;
	overflow-x: auto;
}
/* --- Grid layout --- */
.main-outer {
	max-width: 800px;
	margin: 2em auto;
	padding: 0.5em;
	box-sizing: border-box;
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	font-size: 0.95em;
	margin-bottom: 1em;
}

.site-nav .nav-sep {
	color: rgba(37,99,235,0.7);
}

.site-footer {
	margin-top: 2em;
	font-size: 90%;
	color: #e6edff;
	text-align: center;
	min-height: 6em;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
}

.top-banner-ad {
	display: none;
	width: 100%;
	justify-content: center;
	align-items: center;
	margin: 0 0 0.75em 0;
}

.top-banner-ad .adsbygoogle {
	width: 320px;
	height: 100px;
}

.main-row {
	display: grid;
	grid-template-columns: 200px 400px 200px;
	gap: 8px;
	justify-content: center;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
}

.left-column-ad,
.center-column-game,
.right-column-info {
	min-height: 900px;
	box-sizing: border-box;
}

.left-column-ad {
	width: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
}

.center-column-game {
	width: 400px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
}

.right-column-info {
	width: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 1em;
}

.game-canvas {
	width: 400px;
	height: 740px;
	max-width: 100%;
	display: block;
}

.next-piece-canvas {
	width: 200px;
	height: 300px;
	max-width: 100%;
	display: block;
}

.controls-row {
	width: 400px;
	height: 100px;
	max-width: 100%;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: center;
	gap: 8px;
	margin: 0.5em 0 0.75em 0;
	touch-action: manipulation;
}

.right-col-stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1em;
}

.instructions-section {
	width: 100%;
	max-width: 200px;
	box-sizing: border-box;
}
.instructions-section pre {
	max-width: 100%;
	white-space: pre-wrap;
	word-break: break-word;
	box-sizing: border-box;
}

.bcontrol {
	width: 64px;
	height: 64px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(90deg, #4e54c8 0%, #8f94fb 100%);
	border: none;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(30,60,114,0.08);
	transition: background 0.2s, box-shadow 0.2s;
	cursor: pointer;
	touch-action: manipulation;
}
.bcontrol img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	pointer-events: none;
}
.bcontrol:hover, .bcontrol:focus {
	background: linear-gradient(90deg, #8f94fb 0%, #4e54c8 100%);
	box-shadow: 0 4px 16px rgba(30,60,114,0.16);
}

.share-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 1em;
}

.bottom-story-section {
	width: 100%;
	margin-top: 1em;
	font-size: 1em;
}

a {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	border-bottom: none;
	border-radius: 4px;
	padding: 2px 2px;
	transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
a:hover, a:focus {
	color: #fff;
	background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
	box-shadow: 0 2px 8px rgba(37,99,235,0.10);
	outline: none;
}

/* --- 600px to 799px: top banner visible, left column hidden --- */
@media (max-width: 799px) {
	.top-banner-ad {
		display: flex;
	}
	.left-column-ad {
		display: none;
	}
	.main-row {
		grid-template-columns: 400px 200px;
	}
}

/* --- <600px: stack game above info --- */
@media (max-width: 599px) {
	.main-row {
		grid-template-columns: 1fr;
	}
	.center-column-game,
	.right-column-info {
		width: 100%;
		min-height: auto;
	}
}
