/* Rébus & charades — modern shared styles */

:root {
	--rb-accent: #7cb342;
	--rb-accent-dark: #5a8a2b;
	--rb-ink: #1f2430;
	--rb-ink-soft: #565d6d;
	--rb-bg: #f4f6f3;
	--rb-card: #ffffff;
	--rb-border: #e6e9e3;
	--rb-radius: 18px;
	--rb-shadow: 0 10px 30px rgba(31, 36, 48, .08), 0 2px 8px rgba(31, 36, 48, .05);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: linear-gradient(180deg, #eef4ea 0%, var(--rb-bg) 320px);
	color: var(--rb-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.rb-wrap {
	max-width: 640px;
	margin: 0 auto;
	padding: 20px 16px 56px;
}

.rb-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0 20px;
	text-decoration: none;
	color: var(--rb-ink);
}

.rb-brand img {
	width: 40px;
	height: 40px;
	border-radius: 10px;
}

.rb-brand span {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .2px;
}

.rb-card {
	background: var(--rb-card);
	border: 1px solid var(--rb-border);
	border-radius: var(--rb-radius);
	box-shadow: var(--rb-shadow);
	overflow: hidden;
	margin-bottom: 20px;
}

.rb-card-pad {
	padding: 26px 26px 22px;
}

.rb-card h1 {
	margin: 0 0 6px;
	font-size: 24px;
	font-weight: 800;
}

.rb-card h1 .rb-accent {
	color: var(--rb-accent-dark);
}

.rb-lede {
	margin: 0 0 18px;
	color: var(--rb-ink-soft);
	font-size: 15px;
}

.rb-info {
	font-size: 13.5px;
	color: var(--rb-ink-soft);
	background: #f7f9f5;
	border: 1px solid var(--rb-border);
	border-radius: 12px;
	padding: 14px 16px;
	margin-top: 16px;
}

.rb-info a {
	color: var(--rb-accent-dark);
	font-weight: 600;
	text-decoration: none;
}

.rb-info a:hover {
	text-decoration: underline;
}

/* Ad slot */
.rb-ad {
	padding: 14px 26px 0;
}

.rb-ad-label {
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #9aa19b;
	text-align: center;
	margin-bottom: 6px;
}

/* Form */
.rb-form {
	display: flex;
	gap: 10px;
	padding: 20px 26px 26px;
	background: #fafbf8;
	border-top: 1px solid var(--rb-border);
	flex-wrap: wrap;
}

.rb-input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 14px 16px;
	font-size: 16px;
	border: 1.5px solid var(--rb-border);
	border-radius: 12px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	background: #fff;
}

.rb-input:focus {
	border-color: var(--rb-accent);
	box-shadow: 0 0 0 3px rgba(124, 179, 66, .18);
}

.rb-btn {
	appearance: none;
	border: 0;
	border-radius: 12px;
	padding: 14px 22px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .1s ease, filter .15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
}

.rb-btn:active {
	transform: translateY(1px);
}

.rb-btn-primary {
	background: var(--rb-accent);
	color: #fff;
	flex: 1 1 140px;
}

.rb-btn-primary:hover {
	filter: brightness(1.06);
}

.rb-btn-dark {
	background: var(--rb-ink);
	color: #fff;
	width: 100%;
}

.rb-btn-dark:hover {
	filter: brightness(1.15);
}

.rb-btn-ghost {
	background: #fff;
	color: var(--rb-ink);
	border: 1.5px solid var(--rb-border);
	width: 100%;
}

.rb-btn-ghost:hover {
	border-color: var(--rb-accent);
	color: var(--rb-accent-dark);
}

/* Result page: puzzle tiles */
.rb-puzzle {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	padding: 28px 22px;
}

.rb-tile {
	background: #f7f9f5;
	border: 1px solid var(--rb-border);
	border-radius: 12px;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 68px;
	min-height: 68px;
}

.rb-tile img {
	width: clamp(46px, 12vw, 84px);
	height: auto;
	display: block;
}

/* Solution reveal */
.rb-solution-toggle {
	margin: 0 22px 4px;
}

.rb-solution {
	margin: 0 22px 22px;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height .35s ease, opacity .3s ease, margin .35s ease;
}

.rb-solution.is-open {
	max-height: 200px;
	opacity: 1;
}

.rb-solution-box {
	background: linear-gradient(135deg, #eef6e6, #f7f9f5);
	border: 1px solid var(--rb-border);
	border-radius: 12px;
	padding: 16px 18px;
	text-align: center;
	font-size: 18px;
	font-weight: 700;
	color: var(--rb-accent-dark);
}

/* Share buttons */
.rb-share {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 4px 22px 22px;
	justify-content: center;
}

.rb-share-btn {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: transform .12s ease, filter .15s ease;
}

.rb-share-btn:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
}

.rb-share-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.rb-share-whatsapp { background: #25D366; }
.rb-share-facebook { background: #1877F2; }
.rb-share-x { background: #111318; }
.rb-share-email { background: #ea4335; }
.rb-share-sms { background: #7c6ee6; }
.rb-share-copy { background: var(--rb-ink); }

.rb-share-toast {
	text-align: center;
	font-size: 13px;
	color: var(--rb-accent-dark);
	font-weight: 600;
	height: 18px;
	margin-top: -8px;
	padding-bottom: 6px;
	opacity: 0;
	transition: opacity .2s ease;
}

.rb-share-toast.is-visible {
	opacity: 1;
}

.rb-footer-actions {
	padding: 4px 22px 26px;
}

.rb-back {
	display: block;
	text-align: center;
	margin-top: 8px;
	font-size: 13.5px;
	color: var(--rb-ink-soft);
	text-decoration: none;
}

.rb-back:hover {
	color: var(--rb-accent-dark);
}

.rb-only-mobile {
	display: none;
}

@media (max-width: 758px) {
	.rb-only-mobile {
		display: flex;
	}

	.rb-only-desktop {
		display: none;
	}
}

@media (max-width: 480px) {
	.rb-card-pad {
		padding: 22px 18px 18px;
	}

	.rb-form,
	.rb-puzzle,
	.rb-ad,
	.rb-share,
	.rb-footer-actions {
		padding-left: 18px;
		padding-right: 18px;
	}

	.rb-solution-toggle,
	.rb-solution {
		margin-left: 18px;
		margin-right: 18px;
	}
}
