/* Carrom Hub: Chess Hub's look as the app uses it (black with a warm glow, mint accent),
   with the app's maple board and wooden frame as the brand colours. Like the app, it
   follows the device's light or dark mode. */
:root {
	--bg: #0b0a09;
	--bg-raised: #1a1a1a;
	--line: rgba(255, 255, 255, 0.1);
	--text: #ffffff;
	--text-muted: rgba(255, 255, 255, 0.7);
	--doc-text: #d9d9d9;
	--accent: #7fffb0;
	--accent-text: #7fffb0;
	--accent-ink: #07301a;
	--ray: rgba(255, 244, 232, 0.06);
	--glow: rgba(78, 66, 56, 0.55);
	--icon-rim: rgba(255, 255, 255, 0.18);
	/* The Classic Maple board and pieces (skins.dart). */
	--frame: #5b2e14;
	--frame-dark: #341808;
	--maple: #f1d29a;
	--maple-edge: #ddb574;
	--queen: #c62828;
	--white-coin: #f3e6c8;
	--black-coin: #2b1d16;
}

@media (prefers-color-scheme: light) {
	:root {
		color-scheme: light;
		--bg: #f2f2f7;
		--bg-raised: #ffffff;
		--line: rgba(0, 0, 0, 0.1);
		--text: #111114;
		--text-muted: rgba(17, 17, 20, 0.65);
		--doc-text: #2c2c30;
		--accent: #5ee89a;
		--accent-text: #13874a;
		--accent-ink: #06331b;
		--ray: rgba(91, 46, 20, 0.06);
		--glow: rgba(241, 210, 154, 0.55);
		--icon-rim: rgba(0, 0, 0, 0.1);
	}

	.hero-shot img {
		filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.22));
	}

	.feature,
	.rule {
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	}
}

/* site.css assumes a dark page in a few places. */
.brand img {
	border-color: var(--icon-rim);
}

h1 em,
.doc a {
	color: var(--accent-text);
}

.doc p,
.doc li {
	color: var(--doc-text);
}

.doc ol {
	padding-left: 22px;
}

.doc ol li {
	margin: 8px 0;
}

/* The app's GlowBackground: a warm glow at the top of the page. */
body {
	background:
		radial-gradient(ellipse 90% 60% at 70% -10%, var(--glow), transparent 70%) no-repeat,
		var(--bg);
}

/* The board's wooden frame as a strip under the header. */
.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	background: linear-gradient(90deg, var(--frame-dark), var(--frame) 30%, var(--maple-edge) 50%, var(--frame) 70%, var(--frame-dark));
	opacity: 0.9;
}

.hero-shot {
	width: min(100%, 400px);
}

/* "Coming soon" store buttons, until the app is in the stores. */
.soon-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.cta .soon-badges {
	justify-content: center;
}

.soon-badge {
	position: relative;
	display: block;
	border-radius: 9px;
}

.soon-badge img {
	height: 54px;
	width: auto;
	opacity: 0.55;
	filter: grayscale(0.4);
}

.soon-badge span {
	position: absolute;
	top: -14px;
	right: -8px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--accent-ink);
	font: 700 11px/1.5 var(--body);
	letter-spacing: 0.02em;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* How to play: four cards, each marked with a carrom piece. */
.rules {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.rule {
	position: relative;
	padding: 22px 22px 20px;
	border-radius: var(--radius);
	background: var(--bg-raised);
	border: 1px solid var(--line);
}

.rule b {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin-bottom: 14px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%);
	color: var(--ink, #fff);
	font: 800 17px/1 var(--display);
	box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.12), inset 0 0 0 7px color-mix(in srgb, var(--c) 85%, #fff), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.rule h3 {
	font-size: 19px;
	font-weight: 700;
	margin-bottom: 6px;
}

.rule p {
	margin: 0;
	color: var(--text-muted);
	font-size: 15px;
}

/* Classic and Freestyle side by side, on a slice of the maple board. */
.modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 16px;
}

.mode {
	padding: 24px;
	border-radius: var(--radius);
	background: linear-gradient(160deg, var(--maple), var(--maple-edge));
	border: 6px solid var(--frame);
	color: #2a1a10;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.mode h3 {
	font-size: 24px;
	font-weight: 800;
	margin-bottom: 8px;
}

.mode p {
	margin: 0;
	color: rgba(42, 26, 16, 0.82);
	font-size: 16px;
}

.mode .points {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 14px;
	font: 700 15px/1 var(--display);
}

.mode .points span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.mode .points i {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--c);
	box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.15);
}

/* Screens: phones with a caption under each. */
.screens figure {
	flex: 0 0 auto;
	width: clamp(200px, 26vw, 260px);
	margin: 0;
	scroll-snap-align: start;
}

.screens figure img {
	width: 100%;
}

.screens figcaption {
	margin-top: 12px;
	text-align: center;
	font: 700 16px/1.3 var(--display);
}

@media (max-width: 860px) {
	.rules {
		grid-template-columns: 1fr 1fr;
	}

	.soon-badges {
		justify-content: center;
	}
}

@media (max-width: 560px) {
	.soon-badge img {
		height: 48px;
	}

	.rules,
	.modes {
		grid-template-columns: 1fr;
	}
}
