.tbmg-game--reaction-test {
	--tbmg-accent: #2878b8;
	--tbmg-accent-dark: #175d96;
}

.tbmg-reaction__summary {
	display: flex;
	gap: 1.25rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.tbmg-reaction__summary p {
	margin: 0.35rem 0 0;
	color: var(--tbmg-muted);
	line-height: 1.7;
}

.tbmg-reaction__summary h2 {
	margin: 0.2rem 0 0;
	color: var(--tbmg-ink);
	font-size: clamp(1.35rem, 3.8vw, 1.85rem);
	font-weight: 800;
	line-height: 1.4;
}

.tbmg-reaction__eyebrow,
.tbmg-reaction__result-label {
	color: var(--tbmg-accent);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.tbmg-reaction__best-card {
	min-width: 118px;
	padding: 0.75rem 1rem;
	border: 1px solid rgba(40, 120, 184, 0.2);
	border-radius: 15px;
	background: linear-gradient(145deg, rgba(40, 120, 184, 0.08), rgba(114, 173, 50, 0.07));
	text-align: center;
}

.tbmg-reaction__best-card > span {
	display: block;
	color: var(--tbmg-muted);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.12em;
}

.tbmg-reaction__best-card strong {
	display: block;
	margin-top: 0.2rem;
	font-size: 1.4rem;
}

.tbmg-reaction__best-card small {
	margin-left: 0.2rem;
	font-size: 0.65rem;
	font-weight: 600;
}

.tbmg-reaction__settings {
	display: flex;
	gap: 1rem;
	align-items: end;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.tbmg-reaction__field {
	display: grid;
	flex: 1 1 220px;
	gap: 0.4rem;
}

.tbmg-reaction__field label {
	color: var(--tbmg-muted);
	font-size: 0.8rem;
	font-weight: 700;
}

.tbmg-reaction__field select {
	width: 100%;
	min-height: 48px;
	padding: 0.65rem 2.5rem 0.65rem 0.9rem;
	border: 1px solid #d9dce7;
	border-radius: 12px;
	background-color: #fff;
	color: var(--tbmg-ink);
	font: inherit;
	font-weight: 700;
}

.tbmg-reaction__start {
	flex: 0 0 210px;
	gap: 0.55rem;
}

.tbmg-game--reaction-test .tbmg-reaction__start,
.tbmg-game--reaction-test .tbmg-reaction__retry {
	-webkit-appearance: none !important;
	appearance: none !important;
	border: 0 !important;
	background-color: var(--tbmg-accent) !important;
	background-image: linear-gradient(135deg, var(--tbmg-accent), var(--tbmg-accent-dark)) !important;
	box-shadow: 0 10px 24px rgba(40, 120, 184, 0.22) !important;
	color: #fff !important;
	text-decoration: none !important;
}

.tbmg-game--reaction-test .tbmg-reaction__start:hover:not(:disabled),
.tbmg-game--reaction-test .tbmg-reaction__retry:hover:not(:disabled) {
	background-color: var(--tbmg-accent-dark) !important;
	background-image: linear-gradient(135deg, #3288c8, var(--tbmg-accent-dark)) !important;
	color: #fff !important;
}

.tbmg-reaction__progress {
	display: flex;
	min-height: 1.7em;
	align-items: center;
	gap: 0.55rem;
	margin: 1.1rem 0 0.75rem;
	color: var(--tbmg-muted);
	font-size: 0.9rem;
	font-weight: 700;
}

.tbmg-reaction__stage {
	position: relative;
}

.tbmg-reaction__progress > span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--tbmg-accent);
	box-shadow: 0 0 0 5px rgba(40, 120, 184, 0.1);
}

.tbmg-reaction__area {
	display: grid;
	position: relative;
	overflow: hidden;
	width: 100%;
	min-height: clamp(230px, 38vw, 310px);
	place-items: center;
	padding: 1.5rem;
	cursor: pointer;
	border: 1px solid #e1e5ee;
	border-radius: 16px;
	background:
		radial-gradient(circle at 50% 40%, #fff 0%, rgba(255, 255, 255, 0) 42%),
		linear-gradient(145deg, #f4f7fa, #eaf0f5);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(28, 58, 84, 0.07);
	color: var(--tbmg-ink);
	font: 800 clamp(1.2rem, 4vw, 1.85rem) / 1.5 inherit;
	text-align: center;
	touch-action: manipulation;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tbmg-reaction__area::before,
.tbmg-reaction__area::after {
	position: absolute;
	width: 160px;
	height: 160px;
	border: 1px solid rgba(40, 120, 184, 0.1);
	border-radius: 50%;
	content: "";
}

.tbmg-reaction__area::before {
	top: -80px;
	left: -55px;
}

.tbmg-reaction__area::after {
	right: -60px;
	bottom: -90px;
}

.tbmg-reaction__area:disabled {
	cursor: default;
	opacity: 1;
}

.tbmg-reaction__area-content {
	display: grid;
	position: relative;
	z-index: 1;
	place-items: center;
	gap: 1rem;
}

.tbmg-reaction__signal {
	width: 58px;
	height: 58px;
	border: 3px solid rgba(40, 120, 184, 0.24);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.75);
	box-shadow: 0 0 0 12px rgba(40, 120, 184, 0.07);
}

.tbmg-reaction__area[data-state="waiting"] .tbmg-reaction__signal {
	animation: tbmg-reaction-pulse 1.4s ease-in-out infinite;
}

.tbmg-reaction__area[data-state="ready"] {
	border-color: transparent;
	background: linear-gradient(145deg, #18a45b, #087c41);
	box-shadow: 0 18px 40px rgba(8, 124, 65, 0.24);
	color: #fff;
}

.tbmg-reaction__area[data-state="ready"] .tbmg-reaction__signal {
	border-color: rgba(255, 255, 255, 0.9);
	background: #fff;
	box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.17);
}

.tbmg-reaction__area[data-state="false-start"] {
	border-color: transparent;
	background: linear-gradient(145deg, #d94343, #a51f35);
	color: #fff;
}

.tbmg-reaction__area[data-state="false-start"] .tbmg-reaction__signal {
	border-color: #fff;
	background: transparent;
	box-shadow: none;
}

.tbmg-reaction__area[data-state="measured"],
.tbmg-reaction__area[data-state="finished"] {
	border-color: transparent;
	background: linear-gradient(145deg, #52627e, #2f3b51);
	color: #fff;
}

.tbmg-reaction__area:focus-visible {
	outline: 3px solid rgba(40, 120, 184, 0.35);
	outline-offset: 4px;
}

.tbmg-reaction__help {
	margin: 0.85rem 0 1.5rem;
	padding-left: 1.5rem;
	background: linear-gradient(90deg, var(--tbmg-accent), var(--tbmg-accent)) no-repeat 0 0.25em / 3px 1.2em;
	color: var(--tbmg-muted);
	font-size: 0.84rem;
	line-height: 1.75;
}

.tbmg-reaction__result {
	min-height: clamp(230px, 38vw, 310px);
	padding: clamp(1.4rem, 4vw, 2.25rem);
	border: 1px solid rgba(40, 120, 184, 0.16);
	border-radius: 20px;
	background:
		radial-gradient(circle at 50% 0%, rgba(40, 120, 184, 0.11), transparent 38%),
		#f6f9fc;
	text-align: center;
}

.tbmg-reaction[data-view="result"] .tbmg-reaction__settings,
.tbmg-reaction[data-view="result"] .tbmg-reaction__progress,
.tbmg-reaction[data-view="result"] .tbmg-reaction__area,
.tbmg-reaction[data-view="result"] .tbmg-reaction__help {
	display: none;
}

.tbmg-reaction[data-view="result"] .tbmg-reaction__result {
	display: flex;
	align-items: center;
	flex-direction: column;
	justify-content: center;
	animation: tbmg-reaction-result-in 0.28s ease-out both;
}

.tbmg-reaction__result h3 {
	margin: 0.35rem 0 1.2rem;
	font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.tbmg-reaction__score-card {
	display: inline-block;
	min-width: min(100%, 310px);
	padding: 1.25rem 1.5rem;
	border: 1px solid rgba(40, 120, 184, 0.13);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 12px 30px rgba(28, 90, 136, 0.08);
}

.tbmg-reaction__score-card > span {
	color: var(--tbmg-muted);
	font-size: 0.8rem;
	font-weight: 700;
}

.tbmg-reaction__score {
	margin: 0.4rem 0 0;
	color: var(--tbmg-accent-dark);
	font-size: clamp(3rem, 11vw, 5rem);
	font-weight: 850;
	letter-spacing: -0.04em;
	line-height: 1;
}

.tbmg-reaction__score small {
	margin-left: 0.25em;
	font-size: 0.25em;
	font-weight: 700;
	letter-spacing: 0;
}

.tbmg-reaction__rank {
	display: inline-block;
	margin: 1rem 0;
	padding: 0.5rem 0.9rem;
	border-radius: 999px;
	background: rgba(114, 173, 50, 0.13);
	color: #4d7f1e;
	font-size: 0.9rem;
	font-weight: 800;
}

.tbmg-reaction__history {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin: 0.25rem 0 1rem;
	padding: 0;
	list-style: none;
}

.tbmg-reaction__history li {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--tbmg-line);
	border-radius: 9px;
	background: #fff;
	color: var(--tbmg-muted);
	font-size: 0.82rem;
	font-weight: 700;
}

.tbmg-reaction__best-result {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	color: var(--tbmg-muted);
	font-size: 0.85rem;
}

.tbmg-reaction__best-result strong {
	color: var(--tbmg-ink);
	font-size: 1rem;
}

.tbmg-reaction__retry {
	margin-top: 0.5rem;
}

@keyframes tbmg-reaction-pulse {
	0%, 100% { transform: scale(0.92); opacity: 0.7; }
	50% { transform: scale(1.08); opacity: 1; }
}

@keyframes tbmg-reaction-result-in {
	from { transform: translateY(8px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 560px) {
	.tbmg-reaction__summary {
		align-items: stretch;
	}

	.tbmg-reaction__best-card {
		min-width: 98px;
	}

	.tbmg-reaction__settings {
		align-items: stretch;
		flex-direction: column;
	}

	.tbmg-reaction__start {
		width: 100%;
	}

	.tbmg-reaction__area {
		min-height: 245px;
		border-radius: 16px;
	}

	.tbmg-reaction__result {
		min-height: 245px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tbmg-reaction__area,
	.tbmg-reaction__area[data-state="waiting"] .tbmg-reaction__signal,
	.tbmg-reaction[data-view="result"] .tbmg-reaction__result {
		animation: none;
		transition: none;
	}
}
